

function search2(ids) {
	if(ids == "1"){
		var mcat=  window.document.products.maincatsName.value;
		var scat=  window.document.products.subcatsName.value;
		var size= window.document.products.sozesSize.value;
		location.href = "products.php?subcat=" + scat + "&size=" + size + "&maincat=" + mcat + "&tread=" + '0' + "&tubecat=" + '0' + "&subtubes=" + '0' + "&limit=" + '0' + "&current=" + '1' ;
	
	}
	else if(ids == "2"){
		var tre=  window.document.products.id.value;
		location.href = "products.php?subcat=" + '0' + "&size=" + '0' + "&maincat=" + '0' + "&tread=" + tre + "&tubecat=" + '0' + "&subtubes=" + '0' + "&limit=" + '0' + "&current=" + '1' ;
	
	}
	else if(ids == "3") {
		var sub1=  window.document.products.tubecatsName.value;
		var sub2=  window.document.products.valesName.value;
		var sub3=  window.document.products.tsizesSize.value;
		location.href = "tubes.php?tubecat=" + sub1 + "&size=" + sub3 + "&valve=" + sub2 + "&maincat=" + '0' + "&subcat=" + '0' + "&tread=" + '0' + "&limit=" + '0' + "&current=" + '1';
		
	
	}
	
}

function go_inquiry(id1) {
	if(id1 == "1") {
		
		var mcat=  window.document.products.maincat.value;
		var scat=  window.document.products.subcat.value;
		var size= window.document.products.size.value;
		var limit= window.document.products.limit.value;
		var current= window.document.products.current.value;
		location.href = "inquiry.php?maincat=" + mcat + "&subcat=" + scat + "&size=" + size + "&tread=" + '0' + "&limit=" + limit + "&current=" + current + "&tubecat=" + '0';
	}
	else if (id1 == "0") {
		
		var tre=  window.document.products.tread1.value;
		var limit= window.document.products.limit.value;
		var current= window.document.products.current.value;
		location.href = "inquiry.php?maincat=" + '0' + "&subcat=" + '0' + "&size=" + '0' + "&tread=" + tre + "&limit=" + limit + "&current=" + current + "&tubecat=" + '0';
	}
	else if (id1 == "2") {
		tr= "all";
		tube= "all";
		location.href = "inquiry.php?tread=" + tr + "&tubecat=" + tube;
	}
}

function go_search(id1) {
	if(id1 == "1") {
		var mcat=  window.document.products.maincat.value;
		var scat=  window.document.products.subcat.value;
		var size= window.document.products.size.value;
		var limit= window.document.products.limit.value;
		var current= window.document.products.current.value;
		location.href = "products.php?maincat=" + mcat + "&subcat=" + scat + "&size=" + size + "&tread=" + '0' + "&limit=" + limit + "&current=" + current + "&tubecat=" + '0';
	}
	else if(id1 == "0")  {
		var tre=  window.document.products.tread1.value;
		var limit= window.document.products.limit.value;
		var current= window.document.products.current.value;
		location.href = "products.php?maincat=" + '0' + "&subcat=" + '0' + "&size=" + '0' + "&tread=" + tre + "&limit=" + limit + "&current=" + current + "&tubecat=" + '0';
	}
	else if(id1 == "3")  {
		location.href = "allproducts.php?";
	}
	else {
		var tubecat=  window.document.products.tubecat1.value;
		var valve=  window.document.products.valve.value;
		var size= window.document.products.size.value;
		var limit= window.document.products.limit.value;
		var current= window.document.products.current.value;
		location.href = "tubes.php?tubecat=" + tubecat + "&valve=" + valve + "&size=" + size + "&limit=" + limit + "&current=" + current + "&tread=" + '0';
	}
	

}

function go_Tubeinquiry() {
	var tubecat=  window.document.products.tubecat.value;
	var size=  window.document.products.size.value;
	var valve=  window.document.products.valve.value;
	var limit= window.document.products.limit.value;
	var current= window.document.products.current.value;
	location.href = "inquiry.php?tubecat=" + tubecat + "&valve=" + valve + "&size=" + size + "&limit=" + limit + "&current=" + current + "&tread=" + '0';

}


function go_userDetails() {
	var tre=  window.document.products.tread.value;
	location.href = "userDetails.php?tread=" + tre;
}

function validChars(e, goods) {
	var key, keychar;
	key = (window.event) ? window.event.keyCode : ((e) ? e.which : null);
	if (key == null) return true;
 
	keychar = String.fromCharCode(key);
	keychar = keychar.toLowerCase();
	goods = goods.toLowerCase();
 
	if (goods.indexOf(keychar) != -1)
		return true;
 
	if (key==null || key==0 || key==8 || key==9 || key==13 || key==27)
		return true;
 
	return false;
}
