<!--

function GoSearch()	{

	if (document.getElementById("txtStartCount") != null)	{
		document.getElementById("txtStartCount").value = 0;
	}
	
	document.getElementById("frmDetails").action = "Products.asp";
	document.getElementById("frmDetails").submit();	
		
	//document.frmDetails.submit();
}


function handleEnterSubmission (field, evt) {
  var keyCode = evt.which ? evt.which : evt.keyCode;
  if (keyCode == 13) {
    window.location = 'products.asp?txtSearch=' + document.getElementById("txtSearch").value;
  }
}



function PlaceOrder()	{
	var lngIndex = document.frmDetails.cboPaymentMethod.selectedIndex;
	var lngPaymentMethod = document.frmDetails.cboPaymentMethod.options[lngIndex].value;
	
	if (lngPaymentMethod == 1)	{
		document.frmDetails.action = "Protx.asp";
		document.frmDetails.submit();
	}
	else	{
		document.frmDetails.action = "Thanks.asp";
		document.frmDetails.submit();	
	}
}

function AddToBasket()		{
	
	var lngProductID = document.frmDetails.txtProductID;
	var strMessage = "";
	var strErrors = "";
	var lngIndex;
			
	if (document.frmDetails.cboColour != null)	{
		lngIndex = document.frmDetails.cboColour.selectedIndex;
		var lngColourID = document.frmDetails.cboColour.options[lngIndex].value;
		if (lngColourID == 0)	{
			strErrors = strErrors + "Please select a colour.\n";
		}
	}
	
/********************	Check sizes if present		********************/	
	if (document.frmDetails.cboSizeChestSize != null)	{
		lngIndex = document.frmDetails.cboSizeChestSize.selectedIndex;
		var lngSizeID = document.frmDetails.cboSizeChestSize.options[lngIndex].value;
		if (lngSizeID == 0)	{
			strErrors = strErrors + "Please select a chest size.\n";
		}
	}	

	if (document.frmDetails.cboSizeCollarSize != null)	{
		lngIndex = document.frmDetails.cboSizeCollarSize.selectedIndex;
		var lngSizeID = document.frmDetails.cboSizeCollarSize.options[lngIndex].value;
		if (lngSizeID == 0)	{
			strErrors = strErrors + "Please select a collar size.\n";
		}
	}

	if (document.frmDetails.cboSizeInsideLeg != null)	{
		lngIndex = document.frmDetails.cboSizeInsideLeg.selectedIndex;
		var lngSizeID = document.frmDetails.cboSizeInsideLeg.options[lngIndex].value;
		if (lngSizeID == 0)	{
			strErrors = strErrors + "Please select an inside leg measurement.\n";
		}
	}

	if (document.frmDetails.cboSizeLength != null)	{
		lngIndex = document.frmDetails.cboSizeLength.selectedIndex;
		var lngSizeID = document.frmDetails.cboSizeLength.options[lngIndex].value;
		if (lngSizeID == 0)	{
			strErrors = strErrors + "Please select a length size.\n";
		}
	}
	
	if (document.frmDetails.cboSizeSize != null)	{
		lngIndex = document.frmDetails.cboSizeSize.selectedIndex;
		var lngSizeID = document.frmDetails.cboSizeSize.options[lngIndex].value;
		if (lngSizeID == 0)	{
			strErrors = strErrors + "Please select a size.\n";
		}
	}
	
	if (document.frmDetails.cboSizeWaistSize != null)	{
		lngIndex = document.frmDetails.cboSizeWaistSize.selectedIndex;
		var lngSizeID = document.frmDetails.cboSizeWaistSize.options[lngIndex].value;
		if (lngSizeID == 0)	{
			strErrors = strErrors + "Please select a waist size.\n";
		}
	}

/********************	Finally check if there have been errors		********************/	
	if (strErrors=="") {
		if (document.frmDetails.txtPage.value == "detailpopup")	{
			document.frmDetails.submit();
			top.opener.location.href = "detail.asp?id=" + document.frmDetails.txtOrgProdID.value;
			window.close();
		}
		else	{
			document.frmDetails.submit();
		}
	}
	else {
		strMessage = "We cannot proceed with your order for the following reason(s).\n\n"
		alert(strMessage + strErrors);
	}
}
function sendmail (address) {
  address = address.split("*spamprotection*");
  address = address.join("@");
  window.open ('mailto:'+address,'_blank');
}
function opencopywindow(url) {
popupWin = window.open(url,'Name', 'top=50,left=50,resizable=no,width=475,height=500,scrollbars=yes,menubar=no')
}

//Unsure what this is (demian)
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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];}}
}

function Previous(lngStartCount)	{
	document.frmDetails.txtStartCount.value = lngStartCount;
	document.frmDetails.submit();
}

function Next(lngStartCount)	{

	document.frmDetails.txtStartCount.value = lngStartCount;
	document.frmDetails.submit();

}
//-->