function showLayer(strLayer)
{
	var f = document.getElementById(strLayer);
	if (undefined == f)
		return false;
	f.style.className = 'visible';
	return true;	
}



function hideLayer(strLayer)
{
	var f = document.getElementById(strLayer);
	if (undefined == f)
		return false;
	f.style.className = 'hidden';
	return true;	
}



function clearValue(obj, strDefaultText)
{
	if (obj.value == strDefaultText)
	{
		obj.value='';	
	} else {
		obj.select();
	}
	return;
}



function setValue(obj, strText)
{
	if (undefined == obj){
		return;
	}
	var value = obj.value;
	var trimmed = value.replace(/^\s+|\s+$/g, '') ;
	if ('' == trimmed)
	{
		obj.value = strText;
	}
	return;
}



function nav(strURL)
{
	window.location=strURL;
}



function confirm_msg(msg,url) 
{
	input_box=confirm(msg);
	if (input_box==true){
		document.location=url;
	}
}


function goToBrand(intID)
{
	if (undefined != intID || '' != intID)
	{
		window.location = '/products/?sub=brands&id=' + intID;
		return true;
	}
	return false;
}


function goToCountry(intID)
{
	if (undefined != intID || '' != intID)
	{
		window.location = '/products/?sub=brands&country_id=' + intID;
		return true;
	}
	return false;
}



function addToBasket(intID){
	var f = document.getElementById('salesForm');
	f.product_id.value = intID;
	f.submit();
}

