﻿//Slide
$(function() {
    $('#slides').slides({
        preload: true,
        preloadImage: 'images/loading.gif',
        play: 5000,
        pause: 2500,
        hoverPause: true,
        animationStart: function(current) {
            $('.caption').animate({
                bottom: -35
            }, 100);
            if (window.console && console.log) {
                // example return of current slide number
                console.log('animationStart on slide: ', current);
            };
        },
        animationComplete: function(current) {
            $('.caption').animate({
                bottom: 0
            }, 200);
            if (window.console && console.log) {
                // example return of current slide number
                console.log('animationComplete on slide: ', current);
            };
        },
        slidesLoaded: function() {
            $('.caption').animate({
                bottom: 0
            }, 200);
        }
    });
});


//alt menü

//$(document).ready(function() {
//  
//    $(".btn-slide").mouseover(function() {
//        $("#panel").slideToggle("slow");
//        $(this).toggleClass("active"); return false;

//    });


//    $(".btn-slide2").mouseover(function() {
//        $("#panel2").slideToggle("slow");
//        $(this).toggleClass("active2"); return false;
//    });

//    $(".btn-slide3").mouseover(function() {
//        $("#panel3").slideToggle("slow");
//        $(this).toggleClass("active3"); return false;
//    });
//    $(".btn-slide4").mouseover(function() {
//        $("#panel4").slideToggle("slow");
//        $(this).toggleClass("active4"); return false;
//    });
//    $(".btn-slide5").mouseover(function() {
//        $("#panel5").slideToggle("slow");
//        $(this).toggleClass("active5"); return false;
//    });
//});

//iç sayfa slider

//Slide
$(function() {
    $('#innerslides').slides({
        preload: true,
        preloadImage: '/images/loading.gif',
        play: 5000,
        pause: 2500,
        hoverPause: true,
        animationStart: function(current) {
            $('.innercaption').animate({
                bottom: -35
            }, 100);
            if (window.console && console.log) {
                // example return of current slide number
                console.log('animationStart on slide: ', current);
            };
        },
        animationComplete: function(current) {
            $('.innercaption').animate({
                bottom: 0
            }, 200);
            if (window.console && console.log) {
                // example return of current slide number
                console.log('animationComplete on slide: ', current);
            };
        },
        slidesLoaded: function() {
            $('.innercaption').animate({
                bottom: 0
            }, 200);
        }
    });
});

//left menu
//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked
$(document).ready(function() {
    //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
    //    $("#firstpane p.menu_head").click(function() {
    //    $(this).css({ backgroundImage: "url(/images/menuup.jpg)" }).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
    //    $(this).siblings().css({ backgroundImage: "url(/images/menudown.jpg)" });
    //    });
    //slides the element with class "menu_body" when mouse is over the paragraph
    //    $("#secondpane p.menu_head").mouseover(function() {
    //    $(this).css({ backgroundImage: "url(/images/inbgdown.png)" }).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
    //        $(this).siblings().css({ backgroundImage: "url(/images/left.png)" });
    //    });
    $("#secondpane p.menu_headin").click(function() {
        $(this).css({ backgroundImage: "url(/images/left.png)" }).next("div.menu_bodyin").slideToggle(300).siblings("div.menu_bodyin").slideUp("slow");
        $(this).siblings().css({ backgroundImage: "url(/images/down.png)" });
    });
});

//popup
function openWindow(url, w, h) {
    var windowprops = "width=" + w + ",height=" + h + ",scrollbars=1";
    popup = window.open(url, 'remote', windowprops);
}

//popup window
function wopen(url, name, w, h) {
    w += 32;
    h += 96;
    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;
    if (wleft < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=no');
    win.resizeTo(w, h);
    win.moveTo(wleft, wtop);
    win.focus();
}
