function PicPopup(theURL,winName,features, myWidth, myHeight, isCenter) 
{
	//v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}
self.focus();

function cleartext() {
	if (document.forms.searchcontrol.txtSearch.value == "  --- Keyword ---   " || 
	    document.forms.searchcontrol.txtSearch.value == "")	
		document.forms.searchcontrol.txtSearch.value = "";
	return true;
}
function settext() {
	var searchVal = document.forms.searchcontrol.elements["txtSearch"].value;
	if (searchVal.length < 3)
		document.forms.searchcontrol.elements["txtSearch"].value = "  --- Keyword ---   ";			
	return true;
}
function searchfor(fromanchor) {
 	var search = document.forms.searchcontrolform.txtSearch.value;
	var searchlena = search.length < 2;
	var searchlenb = document.forms.searchcontrolform.txtSearch.value == "  --- Keyword ---   ";		
	if(searchlena == true) {
		alert('Please enter at least two characters to search');
		if (!fromanchor) return false;
	} else if(searchlenb == true && searchlena == false) {
		alert('You have not entered a search criteria');
		if (!fromanchor) return false;
	} else {		
		document.forms.searchcontrolform.submit();			
	}
	if (!fromanchor) return true;	
}
function setbrand(fromanchor) {
	var brandControl = document.forms.Searchbrandform.brand;
	var dds = brandControl.value == "";
	if (!dds) {
		document.forms.Searchbrandform.submit();			
	} else {
		if (!fromanchor) return false;
	}
	if (!fromanchor) return true;
}
function jumpbrand() {
	var brandControl = document.forms.Searchbrandform.brand;
	var dds = brandControl.value == "";
	if (!dds) {
		window.location.pathname = "/index.php/manufacturer/" + brandControl.value + "/index.html";
		return true;
	} else {
		return false;
	}
}
