var CART_ONLOAD = "document.forms['add_to_cart'].elements['requestedQuantity'].focus();";

	function add_to_cart(itemGroupOid, baseItemOid, numberSku){
	        
		var cart_box=new dynRegion('/ajaxView', 'cart-box');

		show_cart_box();
		cart_box.onloadevent = CART_ONLOAD;
		cart_box.update('view=productCart&itemGroupOID=' + itemGroupOid + '&baseItemOID=' + baseItemOid + '&numberSKU=' + numberSku);
	}
	
	function add_to_cart_form(itemGroupOid, baseItemOid, numberSku, attributeHash){
	        
		var cart_box=new dynRegion('/ajaxView', 'cart-box');

		show_cart_box();
		cart_box.onloadevent = CART_ONLOAD;
		cart_box.update('view=productCart&itemGroupOID=' + itemGroupOid + '&baseItemOID=' + baseItemOid + '&numberSKU=' + numberSku + '&attrib=' + attributeHash);
	}
	
	function add_to_cart_with_attrib(itemGroupOid, baseItemOid, numberSku, attributeHash, pickListSelectedValue){
	        
		var cart_box=new dynRegion('/ajaxView', 'cart-box');

		show_cart_box();
		cart_box.onloadevent = CART_ONLOAD;
		cart_box.update('view=productCart&itemGroupOID=' + itemGroupOid + '&baseItemOID=' + baseItemOid + '&numberSKU=' + numberSku + '&attrib=' + attributeHash  + '&pickListSelectedValue=' + pickListSelectedValue);
	}
	
	function displayPhoneOnly(){	        
		var cart_box=new dynRegion('/ajaxView', 'cart-box');

		show_cart_box();
		cart_box.update('view=productPhoneOnly');
	}
	
	function show_cart_box(){
		var pop_box=document.getElementById('cart-box-wrapper');
		var screen_mask=document.getElementById('screen-mask');
		if(document.body && document.body.scrollTop)
			scrollTop = document.body.scrollTop;  
		else if(document.documentElement && document.documentElement.scrollTop)
			scrollTop = document.documentElement.scrollTop; 
		else if(window.pageYOffset)
			scrollTop = window.pageYOffset;  
		else
			scrollTop =0;

		screen_mask.style.height=Math.max(document.body.scrollHeight,document.body.offsetHeight)+"px";
		set_opacity(screen_mask,50);
		screen_mask.style.visibility='visible';
		screen_mask.style.display='block';
		pop_box.style.top=(80+scrollTop)+"px";
		pop_box.style.visibility='visible';
	}

	function hide_cart_box(){
		var pop_box=document.getElementById('cart-box-wrapper');
		var screen_mask=document.getElementById('screen-mask');
		screen_mask.style.visibility='hidden';
		pop_box.style.visibility='hidden';
		screen_mask.style.display = "none";
	}

	
	
	function displayProductInfo()
	{
    	if (document.getElementById("attrRadio") != null) 
    	{
    		if (document.getElementById("attrRadio").checked==true)
    		{
				displayChart();    			
    		}
    		else
    		{
    			displaySkus();
    		}    	
    	}
 		if (document.getElementById("tab-accessories-active") != null)
		{
			document.getElementById("tab-accessories-active").style.display="none";
		}
		if (document.getElementById("tab-productInfo-active") != null)
		{
			document.getElementById("tab-productInfo-active").style.display="block";
		}
	}
	function displaySkus()
	{
    	if (document.getElementById("chartSection") != null) 
    	{
    		document.getElementById("chartSection").style.display="none";
    	}
    	if (document.getElementById("skuViewSection") != null) 
    	{
    		document.getElementById("skuViewSection").style.display="block";
    	}
    	if (document.getElementById("accessoriesSection") != null) 
    	{
    		document.getElementById("accessoriesSection").style.display="none";
    	}
    	if (document.getElementById("infoViewMethod") != null) 
    	{
    		document.getElementById("infoViewMethod").style.display="block";
    	}
	}
	
    function displayChart() 
    {
    	if (document.getElementById("chartSection") != null) 
    	{
    		document.getElementById("chartSection").style.display="block";
    	}
    	if (document.getElementById("skuViewSection") != null) 
    	{
    		document.getElementById("skuViewSection").style.display="none";
    	}
    	if (document.getElementById("accessoriesSection") != null) 
    	{
    		document.getElementById("accessoriesSection").style.display="none";
    	}
    	if (document.getElementById("infoViewMethod") != null) 
    	{
    		document.getElementById("infoViewMethod").style.display="block";
    	}
    }

    function displayAccessories() 
    {
    	if (document.getElementById("chartSection") != null) 
    	{
	    	document.getElementById("chartSection").style.display="none";
    	}
    	if (document.getElementById("skuViewSection") != null) 
    	{
    		document.getElementById("skuViewSection").style.display="none";
    	}
    	if (document.getElementById("accessoriesSection") != null) 
    	{
    		document.getElementById("accessoriesSection").style.display="block";
    	}
    	if (document.getElementById("infoViewMethod") != null) 
    	{
    		document.getElementById("infoViewMethod").style.display="none";
    	}
		if (document.getElementById("tab-accessories-active") != null)
		{
			document.getElementById("tab-accessories-active").style.display="block";
		}
		if (document.getElementById("tab-productInfo-active") != null)
		{
			document.getElementById("tab-productInfo-active").style.display="none";
		}
    }
    
    function add_to_cart_tracking(qty,sku)
	{
		s=s_gi(s_account); 
		s.linkTrackVars='events'; 
		s.linkTrackEvents='scAdd'; 
		s.products=';'+sku; 
		s.events='scAdd'; 
		if (qty == 0)
		{
			s.linkTrackEvents=s.linkTrackEvents+',scOpen'; 
			s.events=s.events+',scOpen';
			s.tl(this,'o','Open Cart');
		}
		else
		{
			s.tl(this,'o','Add To Cart');
		} 		 
	}
    