	function checkOrderForm()	{
		var sFN = document.orderf.first_name.value;
		var sSN = document.orderf.surname.value;
		var sTl	= document.orderf.telephone.value;
		var sEm = document.orderf.email.value;
		isvalid = 1;
		if (sFN.length < 2)	{
			alert("Please enter first name!");
			isvalid = -1;
		}
		if (sSN.length < 2)	{
			alert("Please enter surname!");
			isvalid = -1;				
		}			
		if (sTl.length < 10)	{
			alert("Please enter telephone number!");
			isvalid = -1;				
		}
		if (sEm.length <5 || !sEm.match(/@/))	{
			alert("Please enter email address!");
			isvalid = -1;
		}
		if (isvalid != -1) {
			document.orderf.submit();
		}
	}
	
  function openwindow(image, xsize, ysize, sCaption) {
		if (typeof(bigger) != "undefined") bigger.close();
	  bigger = window.open("http://217.68.23.140/image.php?image="+image+"&sCaption="+sCaption, "Bigger","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+xsize+",height="+ysize)
  }

 	function change(page, searchstring, cat, template, def) {
		if (def)	{
	  	newloc = template+"?p="+page+"&pno="+parseInt(p.pno.selectedIndex);	
		} else {
	  	newloc = "info.php?p="+page+"&pno="+parseInt(p.pno.selectedIndex);		
		}
		if (searchstring.length) newloc = newloc+"&search="+searchstring;
		window.location = newloc+"&cat="+cat;
  }
	
	function addToCart(prodid, page, pno, cat, squery, href, sought)	{
		op1 = document.getElementById(prodid+"_op1").value;
		op2 = document.getElementById(prodid+"_op2").value;
		op3 = document.getElementById(prodid+"_op3").value;						
		sLocation = "";
		if (href.length > 0) {
			sLocation = href;
		}
		window.location = sLocation+"info.php?p="+page+"&id="+prodid+"&cat="+cat+"&quan=1&ack=1&pno="+pno+squery+"&op1="+op1+"&op2="+op2+"&op3="+op3+"&sought="+sought;
	}
	
	function changeQuantity(cartitem, modifier, page, pno, squery, cat, sought)	{
		window.location = "info.php?ack=10&p="+page+"&pno="+pno+squery+"&item="+cartitem+"&modifier="+modifier+"&cat="+cat+"&sought="+sought;
	}
	
	function changeProductSoughtOrder(page, pno, cat, search, template, def)	{
		var f = document.soughtf;
		sought = f.sought.value;
		if (def)	{
			window.location = template+"?p="+page+"&pno="+pno+"&cat="+cat+"&search="+search+"&sought="+sought;
		} else {
			window.location = "info.php?p="+page+"&pno="+pno+"&cat="+cat+"&search="+search+"&sought="+sought;
		}
	}
	
	function openManualWindow()	{
		if (typeof(bigger) != "undefined") bigger.close();
		bigger = window.open("http://217.68.23.140/scp_resell/scp.php", "Bigger","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=600,height=250")
	}
	
	function changePageCategory(page)	{
		var f = document.catf;
		cat = f.cat.value;
		window.location = "info.php?p="+page+"&cat="+cat;
	}
	
	function changePostalZone(qs)	{
		var f = document.orderf;
		zone = f.zone.value;
		window.location = "info.php?"+qs+"&zone="+zone;
	}
	
	function openInfo(url, page)	{
		if (typeof(viewit) != "undefined") viewit.close();
		viewit = window.open("http://"+url+"/"+page, "viewit","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=600,height=250")
	}
