$j(document).ready(function()
{   

    //menu hover
    $j("ul.main_menu li.arrow").hover(      
      function(){
        $j(this).find("ul").show();                  
      },
      function(){
        $j(this).find("ul").hide();
      }      
    );    
    
    $j("div.header div.choose ul li").hover(      
      function(){
        $j(this).find("ul").show();                  
      },
      function(){
        $j(this).find("ul").hide();
      }      
    );
	
	
	$j("div.left_shop_menu ul").hide();
	
	$j("div.left_shop_menu").hover(
		function() {
			$j(this).find("ul").show();		
		},
		function() {
			$j(this).find("ul").hide();		
		
		}
	);
	
	/* Just for firefox, add 700px class to div to prevent cuttoff from choose your store menu */
	if($j.browser.mozilla) {
		$j(".main_menu, .header").hover(function() {
			$j(this).parent().addClass('scale_nav');					
		}, function() {
			$j(this).parent().removeClass('scale_nav');								
		});
	}
	
   /* 
    $j("div.title_block_top a.big_link").hover(      
      function(){
        $j(this).find("ul").show();                  
      },
      function(){
        $j(this).find("ul").hide();
      }      
    );    
    */
    
});


function schedule_onload_action(newfunc)
{
        var already_scheduled = window.onload;
        if(typeof window.onload != 'function')
        {
                window.onload = newfunc;
        }
        else
        {
                window.onload = function()
                {
                        already_scheduled();
                        newfunc();
                }
        }
}

function schedule_scroll_action(newfunc)
{
        var already_scheduled = window.onscroll;
        if(typeof window.onscroll != 'function')
        {
                window.onscroll = newfunc;
        }
        else
        {
                window.onscroll = function()
                {
                        already_scheduled();
                        newfunc();
                }
        }
}

var isIE6 = false;
var isIE7 = false;
var isIE = false;

if(navigator.appName.indexOf("Internet Explorer") != -1){
	var IE_temp = navigator.appVersion.split("MSIE");
	var IE_version = parseFloat(IE_temp[1]);
	
	isIE = true;
	
	if (IE_version == 7){
		isIE7 = true;
	}
	if (IE_version == 6){
		var isIE6 = true;
	}
}

function check_menu(){
	if( top_offset && header_height ){
	
		O_Menu = document.getElementById("left_fixed_part");
		O_Menu1 = document.getElementById("cart_sidebar");
		
		if (document.documentElement.scrollTop) {
			I_ScrollTop = document.documentElement.scrollTop;
		} else {
			I_ScrollTop = document.body.scrollTop;
		}
		
		if (!isIE6) {
			if(I_ScrollTop > header_height){
				O_Menu.style.position = "fixed";
				O_Menu.style.top = top_offset + 'px';
				O_Menu1.style.position = "fixed";
				O_Menu1.style.top = top_offset + 'px';
			}else{
				O_Menu.style.position = "absolute";
				O_Menu.style.top = original_top_offset + 'px';
				O_Menu1.style.position = "absolute";
				O_Menu1.style.top = original_top_offset + 'px';
			}
		/*
			if (I_ScrollTop > I_OrgMenuOffset && O_Menu.style.position != "fixed") {
				O_Menu.style.visibility = "hidden";
				O_Menu.style.position = "fixed";
				O_Menu.style.margin = "-" + I_OrgMenuOffset + "px 0 0 799px";
				O_Menu.style.visibility = "visible";
			} else if (I_ScrollTop < I_OrgMenuOffset && O_Menu.style.position != "absolute") {
				O_Menu.style.position = "absolute";
				O_Menu.style.margin = "0 0 0 799px";
				O_Menu.style.overflow = "hidden";
			}
			*/
		} else {/*
			if (I_ScrollTop > I_OrgMenuOffset) {
				I_TopOffset = -I_OrgMenuOffset;
			} else if (I_ScrollTop < I_OrgMenuOffset) {
				I_TopOffset = - I_ScrollTop;
			}*/
		}
			
	}

}

