// JavaScript Document

$(document).ready(function() {
	$('#content_div').animate({opacity:'1',easing: 'easeOutBounce'},600);		
	$('.brand_submenu').hide();
	$('.shop_submenu').hide();
	/*$('#menu_inner_company_div').hover(
  function () {
   	  $('.shop_submenu').stop().animate({opacity:'1',height:'80',  easing: 'easeOutBounce'});
  }, 
  function () {
	 // $('#test_img').attr('src','images/menu_company.png');
	  $('.shop_submenu').stop().animate({opacity:'0',height:'0',  easing: 'easeOutBounce'  }, 500, function() {
   $('.shop_submenu').hide();
  });

  }
);
	
	*/ 						   

 /*$('#menu_inner_brands_div').hover(
  function () {
	   if ($(".brand_submenu").is(":hidden")) {
		$('#test_img').attr('src','images/menu_company_ro.png');
   	  $('.brand_submenu').stop().animate({opacity:'1',height:'220',  easing: 'easeOutBounce'});
	  }
  }, 
  function () {
	  $('#test_img').attr('src','images/menu_company.png');
	  $('.brand_submenu').stop().animate({opacity:'0',height:'0',  easing: 'easeOutBounce'  }, 500, function() {
   $('.brand_submenu').hide();
  });

  }
);*/
/////////////////////////////////////////////////////////////////////////////////////////////////////////		
var roBrands = false;
//rollover brands link will show submenu
//ie7 rollover flash fixed
$('#menu_inner_brands_div_where, #menu_inner_brands_div').hover(
	function () {
		roBrands = true;
		$('.brand_submenu').stop().animate({opacity:'1',height:'220px',  easing: 'easeOutBounce'});
		$('#menu_inner_brands_div img, #menu_inner_brands_div_where img').attr("src", "images/menu_brand_ro.png");
	}, 
	function () {
		roBrands = false;
		$(this).stop().animate({padding:0}, {duration: 200, complete: checkBrandRollOut});
	}
);
//rollout 
$('#submenu_where').hover(
	function () {
		roBrands = true;
	}, 
	function () {
		roBrands = false;
		$('#menu_inner_brands_div_where').stop().animate({padding:0}, {duration: 200, complete: checkBrandRollOut});
		//$(this).stop().animate({'padding':0}, {duration: 200, complete: checkBrandRollOut});
	}
);
function checkBrandRollOut(){
	if(roBrands==false){
		$('.brand_submenu').stop().animate({opacity:0 ,height:'0',  easing: 'easeOutBounce'  }, 500, function() {
		$('.brand_submenu').hide();
		});
		if(document.brand!=true){
			$('#menu_inner_brands_div_where img, #menu_inner_brands_div img').attr("src", "images/menu_brand.png");
		}
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////	
var roCoy = false;
//rollover coy link will show submenu
$('#menu_inner_company_div_where, #menu_inner_company_div').hover(
	function () {
		roCoy = true;
		$('.shop_submenu').stop().animate({opacity:1, height:87,  easing:'easeOutBounce'});
		$('#menu_inner_company_div_where img, #menu_inner_company_div img').attr("src", "images/menu_company_ro.png");
	}, 
	function () {
		roCoy = false;
		$(this).stop().animate({padding:0}, {duration: 200, complete: checkCoyRollOut});
	}
);
//rollout 
$('#submenu_shop_where').hover(
	function () {
		roCoy = true;
	}, 
	function () {
		roCoy = false;
		$(this).stop().animate({padding:0}, {duration: 50, complete: checkCoyRollOut});
	}
);	
function checkCoyRollOut(){
	if(roCoy==false){
		$('.shop_submenu').animate({opacity:0, height:0,  easing:'easeOutBounce' }, 500, function() {
		$('.shop_submenu').hide();
		});
		if(document.company!=true){
			$('#menu_inner_company_div_where img, #menu_inner_company_div img').attr("src", "images/menu_company.png");
		}
	}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////	
		//$('.mail_message').animate({opacity:'0',"top":"580px"},1);
		$('.mail_message').css({opacity:'0',"margin-top":"20px"});
		$("#mc-embedded-subscribe").click(function () { 
		$('.mail_message').animate({opacity:'1',"margin-top":"5px"},"slow");
		setInterval(function(){
			$('.mail_message').animate({opacity:'0',"margin-top":"20px"});				 
			},9000);	
		});
			$('.drop_down').selectbox();
	});
/////////////////////////////////////////////////////////////////////////////////////////////////////////	
function trigger_fancybox(){ 
			   $.fancybox("#various4", { 
				'autoDimensions':	false,
				'width':620,
				'height': 380,
				'scrolling': 'no',
				'padding':10,
				'easingIn':			'swing',
				'autoScale'			: false,
				'transitionIn'		: 'fade',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'href'				: 'map_popup.php'
			});		   
}
