function OpenSubscribe(){
	window.open("../Subscribe/Subscribe.asp","Subscribe","top=150, left=100, width=580, height=375, toolbars=no, titleBar=no, scrollBars=no");
	}
	
function FastBasket(){
	window.location.href=("http://www.scobiesdirect.com/FastBasketOrdNo.aspp");
	}	

function OpenBinEnd(){
	window.location.href=("http://www.scobiesdirect.com/products.asp?sMethod=BinEnds");
	}	

function OpenNew(){
	window.location.href=("http://www.scobiesdirect.com/products.asp?sMethod=NewItems");
	}
	
function OpenPromo(){
	window.location.href=("http://www.scobiesdirect.com/OfferFlyer.asp");
	}
function OpenPromo1(){
	window.location.href=("http://www.scobiesdirect.com/OfferFlyer2.asp");
	}
function OpenPromo3(){
	window.location.href=("http://www.scobiesdirect.com/OfferFlyer3.asp");
	}	
function OpenSpecials(){
	window.location.href=("http://www.scobiesdirect.com/SpecialOffers.asp");
	}
	
function OpenIng(){
	window.location.href=("http://www.scobiesdirect.com/ShopHomePages/Ingredients/Ingredients.asp");
	}	
function OpenPack(){
	window.location.href=("http://www.scobiesdirect.com/ShopHomePages/Pouches/pouches.asp");
	}		
function OpenSund(){
	window.location.href=("http://www.scobiesdirect.com/ShopHomePages/Sundries/Sundries.asp");
	}	
function OpenCase(){
	window.location.href=("http://www.scobiesdirect.com/ShopHomePages/Casings/Casings.asp");
	}		
function OpenMach(){
	window.location.href=("http://www.scobiesdirect.com/ShopHomePages/Machinery/machinery.asp");
	}
function OpenSNet(){
	window.location.href=("http://www.scobiesdirect.com/Scotnet.asp");
	}


function SetPageSize(PS){
	var strUrl = "/SetPageSize.asp?PageSize=" + PS + ""
	var xmlhttp=null
	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest()
	  }
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	
	if (xmlhttp!=null)
		{			
			xmlhttp.open("GET", strUrl , false)
			xmlhttp.setRequestHeader("Content-Type", "text/html")
			xmlhttp.send(null)		
			//alert(xmlhttp.responseText)
			if(xmlhttp.responseText == "OK"){
				window.location.reload();
			}
		}
	
}

function SetProdView(PV){
	var strUrl = "/SetProdView.asp?ProdView=" + PV + ""
	var xmlhttp=null
	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest()
	  }
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	
	if (xmlhttp!=null)
		{			
			xmlhttp.open("GET", strUrl , false)
			xmlhttp.setRequestHeader("Content-Type", "text/html")
			xmlhttp.send(null)		
			//alert(xmlhttp.responseText)
			if(xmlhttp.responseText == "OK"){
				window.location.reload();
			}
		}
	
}

function SetCustomer(CustNo, CustWebID, CustTermsCod, CustShipViaCod, SlsMan){
	var strUrl = "SetCustomer.asp?AltCustNo=" + CustNo + "&CustWebID=" + CustWebID + "&CustShipViaCod=" + CustShipViaCod + "&SlsMan=" + SlsMan
	//alert(strUrl)
	var xmlhttp=null
	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest()
	  }
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	
	if (xmlhttp!=null)
		{			
			xmlhttp.open("GET", strUrl , false)
			xmlhttp.setRequestHeader("Content-Type", "text/html")
			xmlhttp.send(null)		
			//alert(xmlhttp.responseText)
			if(xmlhttp.responseText == "OK"){
				window.location.reload();
			}
		}

	
}

function SetCurrency(sCurr){
	//window.open("http://www.scobiesdirect.com/SetCurrency.asp?Currency=" + sCurr + "","Currency","top=20, left=20, width=20, height=20, toolbars=no, titleBar=no, scrollBars=no");
	var strUrl = "/SetCurrency.asp?Currency=" + sCurr + ""
	var xmlhttp=null
	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest()
	  }
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	
	if (xmlhttp!=null)
		{			
			xmlhttp.open("GET", strUrl , false)
			xmlhttp.setRequestHeader("Content-Type", "text/html")
			xmlhttp.send(null)		
			//alert(xmlhttp.responseText)
			if(xmlhttp.responseText == "OK"){
				window.location.reload();
			}
		}
}


function SetCustType(selectEL){
	var strUrl = "/SetCustType.asp?CustType=" + selectEL.value + ""
	var xmlhttp=null
	if (window.XMLHttpRequest)
	  {
	  xmlhttp=new XMLHttpRequest()
	  }
	else if (window.ActiveXObject)
	  {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	  }
	
	if (xmlhttp!=null)
		{			
			xmlhttp.open("GET", strUrl , false)
			xmlhttp.setRequestHeader("Content-Type", "text/html")
			xmlhttp.send(null)		
			//alert(xmlhttp.responseText)
			if(xmlhttp.responseText == "OK"){
				window.location.reload();
			}
		}
}

function OpenRegister(){
	//window.open("../Subscribe/RegisterOffer.asp","Register","top=20, left=20, width=680, height=775, toolbars=no, titleBar=no, scrollBars=no");
	window.parent.frames("main").location.href="../Subscribe/RegisterOffercasings.asp"
}
function OpenEaster(){
	//window.open("../Subscribe/RegisterOffer.asp","Register","top=20, left=20, width=680, height=775, toolbars=no, titleBar=no, scrollBars=no");
	window.parent.frames("main").location.href="../Easter04.htm"
	window.location.href=("sidenav.asp?URLType=Header&MainCat=0");
}
function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
/* Functions that swaps images. */
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

var wait = 500
var hideTimer
var menuToHide
function Hide(mnuToHide){
	menuToHide = mnuToHide
	if(menuToHide=="mnuCustProdCat")
		{hideTimer = setTimeout("HideCustProdCat()", wait)}	
	else
		{hideTimer = setTimeout("HideAll()", wait)}	
}

function HideAll(){
	
	if(menuToHide == "mnuIng"){document.getElementById("mnuIng").style.display="none"}
	if(menuToHide == "mnuSnet"){document.getElementById("mnuSnet").style.display="none"}
	if(menuToHide == "mnuCase"){document.getElementById("mnuCase").style.display="none"}
	if(menuToHide == "mnuPack"){document.getElementById("mnuPack").style.display="none"}
	if(menuToHide == "mnuSund"){document.getElementById("mnuSund").style.display="none"}
	if(menuToHide == "mnuMach"){document.getElementById("mnuMach").style.display="none"}
	if(menuToHide == "mnuCloth"){document.getElementById("mnuCloth").style.display="none"}
}

function HideCustProdCat(){
	if(menuToHide == "mnuCustProdCat"){document.getElementById("mnuCustProdCat").style.display="none"}
}

function ShowMenu(mnuToOpen, obj){
	if (hideTimer != null)	
		clearTimeout(hideTimer);

	var e = document.getElementById(mnuToOpen)
		e.style.display="inline"
		e.style.position="absolute"
		
		var resX = screen.availWidth

		if(resX <=800){
			e.style.top=114
			e.style.left=125}
		else
		{		
			if(mnuToOpen == "mnuCustProdCat")
			{
				e.style.left = obj.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft+125	
			}
			else		
			{
				if(window.getComputedStyle){
					e.style.top=obj.parentNode.offsetTop+108+9}
				else{	
					e.style.top=obj.parentElement.offsetTop+108+9}
				
				//e.style.left=125
				//this selects the absolute outer table of the element...
				e.style.left = obj.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetParent.offsetLeft+125
				
			}
		}
}

function keepOpen()
{
	if (hideTimer != null)
		clearTimeout(hideTimer);
}