

//Function for number checking.
function check(s){
	if (s.value.charCodeAt(0)==32)
		s.value=s.value.substring(0,s.value.length-1);
}
//Function for search activity.
function serchIt(){
	if (document.form2.Search.value==""){
		alert("The 'ENTER' key is only valid for the \n search field in the right upper corner. \n Please use the mouse.");
		document.form2.Search.focus();
		return;
	}
	document.form2.SearchValue.value=document.form2.Search.value;
	document.form2.submit();
}

function showView(ID){
	document.form1.ShowView.value=ID;
	document.form1.submit();
	return;
	}


function orderUp(Num){
	document.paging.ShowView.value="1";
	document.paging.OrderBy.value=Num;
	document.paging.OrderHow.value="Asc";
	document.paging.submit();
}

function orderDown(Num){
	document.paging.ShowView.value="1";
	document.paging.OrderBy.value=Num;
	document.paging.OrderHow.value="Desc";
	document.paging.submit();
}
function showItems(subCategoryID){
	document.form1.BySupplier.value="";
	document.form1.SubCategory.value=subCategoryID;
	document.form1.submit();
}

function makeDemand(type){
document.DemandForm.Item.value=type;
document.DemandForm.submit();
}
function showItem(ID){
	document.form1.BySupplier.value="";
	document.form1.Byfirm.value="";
	document.form1.showview="1";
	document.form1.SubCategory.value=ID;
	document.form1.action=site+"/Content/products/showItems.asp";
	document.form1.submit();
}	
function MouseOver(obj){
	oldbgcolor = obj.bgColor	 
	obj.style.color='#000000'
	obj.bgColor='#FFFCEA' 
	}
function MouseOut(obj){
	obj.style.color='black' 
	obj.bgColor= oldbgcolor
	}
	function goToReg(){
	document.Checkform.action="RegistrationForm.asp"
	document.Checkform.submit();
	}
function delDetails(){
document.form1.DeliveryCity.value=""
document.form1.DeliveryStreetNum.value=""
document.form1.DeliveryStreet.value=""
document.form1.DeliveryPhone2.value=""
document.form1.DeliveryPhone.value=""
document.form1.DeliveryZipCode.value=""
}

function findsupPr(val){
	document.form1.BySupplier.value=val
	document.form1.Byfirm.value=""
	document.form1.action=site+'/Content/products/showItems.asp?bysupplier='+val;
	document.form1.submit();
}
function findfirmPr(val,txt){
	//alert(txt);
	try{document.form1.Byfirm.value=val;    }catch(er1){}
	try{document.form1.byfirmtxt.value=txt; }catch(er2){}
	//document.form1.BySupplier.value="";
	document.form1.action=site+'/Content/products/showItems.asp?byfirm='+val+'&byfirmtxt='+txt;
	document.form1.submit();
}
function SearchProductPage(){
document.SearchForm.action=site+'/SearchByNum.asp';
document.SearchForm.submit();
}

function SearchProduct(){
document.SearchForm.action=site+'/SearchByProduct.asp';
document.SearchForm.submit();
}	