﻿$(document).ready(function() {

    $("#ctl00_txtSearch").click(function() {
        if ($(this).attr("value") == "Aranacak kelimeyi giriniz...")
            $(this).attr("value", "");
    });

    $("#ctl00_ContentPlaceHolder1_txtSearch2").click(function() {
        if ($(this).attr("value") == "Aranacak kelimeyi giriniz...")
            $(this).attr("value", "");
    });

    $("#txtSearch").click(function() {
        if ($(this).attr("value") == "Aranacak kelimeyi giriniz...")
            $(this).attr("value", "");
    });

    


    $("#java_in").cycle({

        fx: 'scrollHorz',
        startingSlide: 1,
        timeout: 4000,
        speed: 500,
        prev: '#prev',
        next: '#next',

    });

    $("#pause").click(function() {
    if($(this).attr("src")=="images/pause.png"){
        $(this).attr("src","images/play.png");
        $("#java_in").cycle("pause");  
   }
   else{
   
        $(this).attr("src","images/pause.png");
        $("#java_in").cycle("resume");
   }
    });
    
    
    $("#java_in").hover(function() {
$("#java_in").cycle("pause");
    },function() {
$("#java_in").cycle("resume");
    });
    $(".d").each(function() {
        $(this).hover(function(e) {
            $(this).find(".popSubMenu")
        .css("left", parseFloat($(this).position().left) + 176)
        .css("top", parseFloat($(this).position().top))
        .animate({ width: '136' }, 400);

        }, function() {
            $(this).find(".popSubMenu").stop(true, true).css("width", 0).hide();

        });
    });

    $(".dsd").each(function() {
        $(this).hover(function(e) {
            $(this).find(".popSubMenu")
        .css("left", parseFloat($(this).position().left) + 176)
        .css("top", parseFloat($(this).position().top))
        .animate({ width: '136' }, 400);

        }, function() {
            $(this).find(".popSubMenu").stop(true, true).css("width", 0).hide();

        });
    });


    //    $("#java_in img:hidden:first").show();

    //    function nic() {
    //        if ($("#java_in img:visible:first").next().parent().attr("id") == "java_in") {
    //            $("#java_in img:visible:first").next().delay(200).fadeIn(200);
    //            $("#java_in img:visible:first").fadeOut(200);
    //        }
    //        else {
    //            $("#java_in img:visible:first").fadeOut(200);
    //            $("#java_in img:first").delay(200).fadeIn(200);
    //        }
    //    }

    //    setInterval(nic, 4000);

    //    $(".java_next_prew img:first").click(function() {
    //        if ($("#java_in img:visible:first").prev().parent().attr("id") == "java_in") {
    //            $("#java_in img:visible:first").prev().delay(200).fadeIn(200);
    //            $("#java_in img:visible:first").fadeOut(200);
    //        }
    //        else {
    //            $("#java_in img:visible:first").fadeOut(200);
    //            $("#java_in img:first").delay(200).fadeIn(200);
    //        }
    //    });
//    $(".java_next_prew img:last").click(function() {
//        nic();
//    });

    $(".manual1").each(function() {
        $(this).click(function() {
            $.fancybox({
                //'orig'            : $(this),
                'padding': 0,
                'href': 'Photos/Max/' + $(this).attr("zid") + '.jpg',
                'title': $(this).attr("did")
            });
        });
    });
$("a.grouped_elements").fancybox();
    $("#b2b").click(function() {
        window.open("http://b2b.segment.com.tr/b2bv2/index.cfm?ba=home.welcome");

    })

});
