﻿function twitterShare() {
    var title = "Ülker’de herkese uygun bir tat mutlaka vardır! " + "" + "http://www.ulker.com.tr";
    window.open('http://twitter.com?status=' + encodeURIComponent(title));
}
function facebookShare() {
var title = "Ülker’de herkese uygun bir tat mutlaka vardır! "	
    u = "http://www.ulker.com.tr";
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u)+'&t='+ encodeURIComponent(title), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}
//var sliderinited = false;
$(document).ready(function () {
    $(".overwebsites-wrapper a.ourwebsites").toggle(
        function () {
            $(this).parent().find(".ourbox").show();
            $(this).parent().find("a.ourwebsites").addClass("active");
        },
        function () {
            $(this).parent().find(".ourbox").hide();
            $(this).parent().find("a.ourwebsites").removeClass("active");
        }
    );
    $('.global-nav li.subnavlink a').click(function () {
        $this = $(this);
        if ($this.next().is(':hidden')) {
            $(".global-nav li.subnavlink a").children(".ico-min").removeClass("closed");
            $this.children(".ico-min").addClass("closed");
            $('.global-nav li.subnavlink a').removeClass('active').next().hide();
            $this.toggleClass('active').next().show();
        }
        else if (!$this.next().is(':hidden')) {
            $(".global-nav li.subnavlink a").children(".ico-min").removeClass("closed");
            $this.toggleClass('active').next().hide();
        }
        //return false;
    });

//    $('.sublist a').hover(
//        function () {
//            $this = $(this);
//            $this.parent().prepend('<span class="ico-min"></span>');
//        },
//        function () {
//            $this.parent().find(".ico-min").remove();
//        }
//    );

//    $(".site-nav li").mouseover(function () {
//        $this = $(this);
//        //$(".site-nav li.subnavlink a").children(".ico-min").removeClass("closed");
//        $this.children("a.homelink").addClass("hover");
//        $this.css("z-index", "999999");
//        $(".site-nav li.subnavlink .sub-nav").hide();
//        $this.find(".sub-nav").show();
//        
//        if (!sliderinited && $("#header .bottom-container .slidelist").is(':visible')) {
//            $("#header .bottom-container .slidelist").jCarouselLite({ btnNext: ".next.nexth", btnPrev: ".prev.prevh", visible: 1, start: 0 });
//           sliderinited = true;
//       }
//    });

//    $(".site-nav li").mouseout(function () {
//        $this = $(this);
//        $('.site-nav li a.homelink').removeClass('hover').next(".sub-nav").hide();
//        $this.find(".sub-nav").hide();
//        $(".site-nav li").css("z-index", "");
//    });
});
