var obj = null;

function checkHover() {
	if (obj) {
		obj.removeClass("hovered");
		if(jQuery.browser.msie){
			obj.find('div').hide();
		}
		else{
			obj.find('div').fadeOut('fast');
		}
	}
}


$(document).ready(function() {

	/* Ana Menü */
	
	$('li.main_nav_item').hover(function() {
		if (obj) {
			obj.removeClass("hovered");
			if(jQuery.browser.msie){
				obj.find('div').hide();
			}
			else{
				obj.find('div').fadeOut('fast');
			}
			obj = null;
		}

		$(this).addClass("hovered");
		if(jQuery.browser.msie){
			$(this).find('div').show();
		}
		else{
			$(this).find('div').fadeIn('fast');
		}

	}, function() {
		obj = $(this);
		setTimeout("checkHover()", 1000);
	});

	/* Anasayfada Splash Geçişleri */

	$('#homepage #splash div.last').cycle({ 
		fx:    'fade', 
		speed:  2500,
		delay:  -3000,
		timeout:  6000,
		next:   '#splash_next_button', 
		prev:   '#splash_previous_button',
		pause:  true,
		fastOnEvent: true
	 });
	 
	 /* show hide */
	 
	  $('.showhide').next("div").hide();
	 /* $('.showhide').attr("title", "Click to see details.");*/
	
	 $('.showhide').click(function(){
		$(this).toggleClass("open");
		$(this).next("div").toggle();
	});
	
	 
	 /* İletişim Sayfası Sekmeleri */
	 $('#tabs').tabs();
	 
	 $.fn.colorbox.settings.bgOpacity = "0.9";
	 $("a.box").colorbox();
	 $("a.kroki").colorbox({fixedWidth:"970px",fixedHeight:"590px",iframe:true});
	 $("a.google_map").colorbox({fixedWidth:"775px", fixedHeight:"495px", iframe:true});
	 $("a.live_cam").colorbox({fixedWidth:"400px", fixedHeight:"410px", iframe:true});
	 $("a.video").colorbox({fixedWidth:"480px", fixedHeight:"410px", iframe:true});
	 $("a.ipix").colorbox({fixedWidth:"490px", fixedHeight:"390px", iframe:true});
	 $("a.hr_popup").colorbox({fixedWidth:"840px", fixedHeight:"600px", iframe:true});

});

$(document).ready(function() {
try {
		$("#lang_list_box").msDropDown({useSprite:'sprite'})
		last_langvalue = $("#lang_list_box").val();
	} catch(e) {
	}
})

function LangSelect(langvalue){
	if(langvalue != last_langvalue){
		document.location.href='http://www.memorial.com.tr/'+langvalue;
	}
	last_langvalue = langvalue; 
}
