﻿var videopath = "";
var swfplayer = videopath + "swf/flowplayer.swf";

function callBoxFancy(my_href) {
    var j1 = document.getElementById("Popup-img");
    j1.href = my_href;
    //alert(my_href);
    $('#Popup-img').trigger('click');
}

//function triggerClose() {
//    var el = $("#Popup-div");
//    el.bind("click", $.fn.fancybox.close);
//    el.trigger('click');
//}

//function autoClose() {
//    setTimeout("triggerClose()", 10000);
//}

$(document).ready(function () {
    // fancyBox anable
    $("a[href*=.jpg], a[href*=.gif], a[href*=.png],a[href*=.JPG], a[href*=.GIF], a[href*=.PNG]").fancybox();

    $("#Popup-div a[href*=.jpg]").fancybox();
    // Call the Fancy Box 3 seconds after the page loads
    //alert(document.referrer.indexOf("samanyolu.k12.tr"));
    //document.write("<div>" + document.referrer + "</div>");
    if (document.referrer.indexOf("samanyolu.k12.tr") == -1 || document.referrer.indexOf("google") > -1) {
        var pHref = $("#Popup-img").attr("href");
        window.setTimeout("callBoxFancy('" + pHref + "');", 1000)
    }

    $(".anaokulu, .ilkogretim, .lise, .menu ul li ul").click(
        function () { var this_ = $(this).find('ul'); $(this_).slideToggle('fast'); if (jQuery.browser.msie) $(this_).get(0).style.removeAttribute('filter'); }
    //,function() { var this_ = $(this).find('ul'); $(this_).slideToggle('fast');}
    );
    $(".menu ul li:has(ul)").hover(
        function () { var this_ = $(this).find('ul'); $(this_).slideDown('slow'); if (jQuery.browser.msie) $($(this_)).get(0).style.removeAttribute('filter'); }
        , function () {
            var this_ = $(this).find('ul'); $(this_).slideUp('fast');
            if (jQuery.browser.msie) $(this_).get(0).style.removeAttribute('filter');
        }
    );

    $("#kurumlar img").animate({ opacity: 0.5 }, 300);
    $("#kurumlar img").hover(
        function () {
            $(this).animate({ opacity: 1 }, 300);
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
        },
        function () {
            $(this).animate({ opacity: 0.5 }, 300);
            if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
        }
    );

    // a effct
    //        $("a:not(:has(img)), .footer-wrap a:has(img), .middle-left a").animate({ opacity: 0.5 }, 300);
    //        $("a:not(:has(img)), .footer-wrap a:has(img), .middle-left a").hover(
    $("a:not(:has(img)), .footer-wrap a:has(img)").animate({ opacity: 1 }, 300);
    $("a:not(:has(img)), .footer-wrap a:has(img)").hover(
            function () {
                $(this).animate({ opacity: 0.7 }, 300);
                if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');

            },
            function () {
                $(this).animate({ opacity: 1 }, 300);
                if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');

            }
    );

    // Kurumsal Logo effct
    $("a:has(img)").animate({ opacity: 1 }, 300);
    $("a:has(img)").hover(
                function () {
                    $(this).animate({ opacity: 0.7 }, 300);
                    if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
                },
                function () {
                    $(this).animate({ opacity: 1 }, 300);
                    if (jQuery.browser.msie) $(this).get(0).style.removeAttribute('filter');
                }
            );
    //    // Kurumsal Logo effct
    //        $(".okul_tanitim a:has(img)").animate({ opacity: 0.7 }, 300);
    //        $(".okul_tanitim a:has(img)").hover(
    //                function() {
    //                    $(this).animate({ opacity: 1 }, 300)
    //                },
    //                function() {
    //                    $(this).animate({ opacity: 0.7 }, 300)
    //                }
    //            );


});                  // Jquery
