function fixBrokenImages()
{ 
	var imglst = document.images; 
	for(var i = 0; i < imglst.length; i++){ 
		imglst[i].onerror = function() { 
		this.src = "images/no_image.gif"; 
		} 
		imglst[i].src = imglst[i].src; 
	} 
} 
function change_css(act,css)
{
	document.getElementById(act).className=css;
}
function change_search(obj,img)
{
	if(obj=='over')
	{
		document.getElementById(img).src='images/products/search_btn_on.gif';
	}
	else
	{
		document.getElementById(img).src='images/products/search_btn_off.gif';
	} 
}
function checkFormhead()
{
	if((document.getElementById('searchpartnohead').value == '')||(document.getElementById('searchpartnohead').value == '  '))
	{
		alert('Please enter Part Number');
		document.getElementById('searchpartnohead').focus();
		return false;
	}
	else{
		if(document.getElementById('searchpartnohead').value.length < 3)
		{
			alert('Please enter atleast 3 characters to search');
			document.getElementById('searchpartnohead').focus();
			return false;
		}
	}
}
function headspace(obj)
{
	if((obj.value.length==1) && (obj.value==' '))
	{
		obj.value=obj.value.substring(0,0)
		alert("Please do not enter the first character as null");
		obj.focus();
		return false;
	}
	return true;
}

function IsCookieSupported(){
	if(!document.cookie){
		document.getElementById('CookieError').style.visibility = 'visible';
	}
	/*else{
		alert(document.cookie);
	}*/
}

window.onload = function(){
	fixBrokenImages();
	IsCookieSupported();
}
function onlynum(obj)
{
	if(isNaN(obj.value))
	{
		alert("Please enter numeric Quantity.");
		obj.value=1;
		return false;
			
	}
	else if(obj.value<1)
	{
		alert("Quantity cannot be less than one.");
		obj.value=1;
		return false;
	}
	else
	{
		var Quantity=obj.value;
		if(Quantity.indexOf(".")>=0)
		{
			alert("Quantity cannot be less than one.");
			obj.value=1;
			return false;
		}
	}
	return true;
}

function onlynums(obj)
{
	if(isNaN(obj.value))
	{
		alert("Please enter numeric Quantity.");
		obj.value=1;
		return false;
			
	}
	else if(obj.value<1)
	{
		alert("Quantity cannot be less than one.");
		obj.value=1;
		return false;
	}
	else
	{
		var Quantity=obj.value;
		if(Quantity.indexOf(".")>=0)
		{
			alert("Quantity cannot be decimal.");
			obj.value=1;
			return false;
		}
	}
	return true;
}
