<!--
//==============================================================================================
xDomainPFX="www.";
//==============================================================================================
function clearme(FormField) {
	if (FormField.defaultValue==FormField.value) {
		FormField.value="";
	}//end if (FormField.defaultValue==FormField.value)
	if (FormField.className=="error") {
		FormField.className="";
	}//end if (FormField.className=="error")
}//end function
//==============================================================================================
function pause(millis) {
var date = new Date();
var curDate = null;
do { curDate = new Date(); } 
while(curDate-date < millis);
}//end function
//==============================================================================================
function resetme(FormField) {
//	pause(1000);
//	FormField.value=FormField.defaultValue;
}//end function
//==============================================================================================
function jump(jumpMenu){ //v3.0
  eval("parent.location='"+jumpMenu.options[jumpMenu.selectedIndex].value+"'");
}//end function
//==============================================================================================
var xmlhttp;
var xmlResponse;
var strPredictions;
var xs;
//==============================================================================================
function LoadFile(url) {
	xmlhttp=null;
	if (window.XMLHttpRequest) {// Firefox, Opera, IE7
		xmlhttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {// IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}//end if (window.XMLHttpRequest)
	if (xmlhttp!=null) {
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}//end if (xmlhttp!=null)
	return xmlResponse;
}//end function
//==============================================================================================
function Predict(FormField) {
	xs=FormField.value;
	if (xs!="") {
		xs=xs.replace("&", "[and]")
		LoadFile("http://"+xDomainPFX+"toolguru.co.uk/components/ajaxsearch.asp?xs="+xs);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {// 4 = "loaded"
				if (xmlhttp.status==200) {// 200 = "OK"
					xmlResponse=xmlhttp.responseText;
					if (xmlResponse!="no results") {
						document.getElementById("ajaxresults").innerHTML=xmlResponse;
						document.getElementById("ajaxresults").style.display="";
					} else {
						document.getElementById("ajaxresults").innerHTML="";
						document.getElementById("ajaxresults").style.display="none";
					} //end if (xmlResponse!="")
				}//end if (xmlhttp.status==200)
			}//end if (xmlhttp.readyState==4)
		}//end function
	} else {
		document.getElementById("ajaxresults").innerHTML="";
		document.getElementById("ajaxresults").style.display="none";
	}//end if (xs!="")
}//end function
//==============================================================================================
function zoom(MyImage) { 
	window.open("zoom.asp?"+MyImage, "", "resizable=1,HEIGHT=550,WIDTH=550,scrollbars=1");
}//end function
//==============================================================================================
function bookmark(xPAGEurl, xPAGEtitle) {
	if (window.sidebar) //for firefox
		window.sidebar.addPanel(xPAGEtitle, xPAGEurl, "");
	 else if (window.opera && window.print) { // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',xPAGEurl);
		elem.setAttribute('title',xPAGEtitle);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} else if (document.all) // ie
		window.external.AddFavorite(xPAGEurl, xPAGEtitle);
}//end function
//==============================================================================================
function checkStock(xLIVEstock) {
	xPRODUCTqty=document.getElementById("xPRODUCTqty").value;
	if (xPRODUCTqty>xLIVEstock) {
		alert("There are only "+xLIVEstock+" of these items in stock\n\nYou can not order "+xPRODUCTqty);
		return false;
	} else {
		return true;
	}//end if (xPRODUCTqty>xLIVEstock)
}//end function
//==============================================================================================
function toggleVis(TheDiv) {
	Subject=document.getElementById(TheDiv);
	SubjectLink=document.getElementById("Link"+TheDiv);
	Attribute=Subject.style.display;
	if (Attribute=="none") {
		Subject.style.display="block";
		Subject.style.clear="both";
		SubjectLink.innerHTML="Hide the full specification &uarr;";
	} else {
		Subject.style.display="none"
		SubjectLink.innerHTML="View the full specification &darr;";
	}//end if (Attribute=="none")
}//end function
//==============================================================================================
function ShowDetail(xDetail) {
	xDivDesc=document.getElementById("divdesc");
	xDivSpec=document.getElementById("divspec");
	xDivFeat=document.getElementById("divfeat");
	
	xLnkDesc=document.getElementById("adesc");
	xLnkSpec=document.getElementById("aspec");
	xLnkFeat=document.getElementById("afeat");
	
	if (xDetail=="desc") {
		if (xDivDesc) {xDivDesc.style.display="block"};
		if (xLnkDesc) {xLnkDesc.style.backgroundImage="url(../images/css/h1yellowbg.gif)"};
		if (xLnkDesc) {xLnkDesc.style.color="#014DA2"};
		
		if (xDivSpec) {xDivSpec.style.display="none"};
		if (xLnkSpec) {xLnkSpec.style.backgroundImage="url(../images/css/h1bg.gif)"};
		if (xLnkSpec) {xLnkSpec.style.color="#ffffff"};
		
		if (xDivFeat) {xDivFeat.style.display="none"};
		if (xLnkFeat) {xLnkFeat.style.backgroundImage="url(../images/css/h1bg.gif)"};
		if (xLnkFeat) {xLnkFeat.style.color="#ffffff"};
	}//end if (xDetail="desc")
	
	if (xDetail=="spec") {
		if (xDivDesc) {xDivDesc.style.display="none"};
		if (xLnkDesc) {xLnkDesc.style.backgroundImage="url(../images/css/h1bg.gif)"};
		if (xLnkDesc) {xLnkDesc.style.color="#ffffff"};
		
		if (xDivSpec) {xDivSpec.style.display="block"};
		if (xLnkSpec) {xLnkSpec.style.backgroundImage="url(../images/css/h1yellowbg.gif)"};
		if (xLnkSpec) {xLnkSpec.style.color="#014DA2"};
		
		if (xDivFeat) {xDivFeat.style.display="none"};
		if (xLnkFeat) {xLnkFeat.style.backgroundImage="url(../images/css/h1bg.gif)"};
		if (xLnkFeat) {xLnkFeat.style.color="#ffffff"};
	}//end if (xDetail="spec")
	
	if (xDetail=="feat") {
		if (xDivDesc) {xDivDesc.style.display="none"};
		if (xLnkDesc) {xLnkDesc.style.backgroundImage="url(../images/css/h1bg.gif)"};
		if (xLnkDesc) {xLnkDesc.style.color="#ffffff"};
		
		if (xDivSpec) {xDivSpec.style.display="none"};
		if (xLnkSpec) {xLnkSpec.style.backgroundImage="url(../images/css/h1bg.gif)"};
		if (xLnkSpec) {xLnkSpec.style.color="#ffffff"};
		
		if (xDivFeat) {xDivFeat.style.display="block"};
		if (xLnkFeat) {xLnkFeat.style.backgroundImage="url(../images/css/h1yellowbg.gif)"};
		if (xLnkFeat) {xLnkFeat.style.color="#014DA2"};
	}//end if (xDetail="feat")
}//end function
//==============================================================================================
var xmlhttp;
var xmlResponse;
var strPredictions;
var xs;
//==============================================================================================
function LoadFile(url) {
	xmlhttp=null;
	if (window.XMLHttpRequest) {// Firefox, Opera, IE7
		xmlhttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {// IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}//end if (window.XMLHttpRequest)
	if (xmlhttp!=null) {
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}//end if (xmlhttp!=null)
	return xmlResponse;
}//end function
//==============================================================================================
function ShowNavDrops(xd, tc, mc, sc, mr) {
	xNAVdrops=document.getElementById("navdrops");
	if (xNAVdrops) {
		LoadFile("http://"+xDomainPFX+"toolguru.co.uk/shop/dropdowns.asp?xd="+xd+"&tc="+tc+"&mc="+mc+"&sc="+sc+"&mr="+mr+"");
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {// 4 = "loaded"
				if (xmlhttp.status==200) {// 200 = "OK"
					xmlResponse=xmlhttp.responseText;
					if (xmlResponse!="no results") {
						xNAVdrops.innerHTML=xmlResponse;
					} //end if (xmlResponse!="")
				}//end if (xmlhttp.status==200)
			}//end if (xmlhttp.readyState==4)
		}//end function
	}//end if (xNAVdrops)
}//end function
//==============================================================================================
//-->