function CheckFocus(inp) 
{
	document.getElementById(inp).value = "";
}
function ChangeFocus(frm,val) 
{ 
	if(frm.value == val)
		frm.value = "";
}
function ChangeBlur(frm,val) 
{
	if(frm.value == "")
		frm.value = val;
}
function getHTTPObject() 
{
	var xmlhttp;
	if(window.XMLHttpRequest) { 
		xmlhttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject){
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if (!xmlhttp){
			xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	}
	return xmlhttp;  
}
var http = getHTTPObject(); // We create the HTTP Object

function trim(s)
{
	return s.replace(/^\s+|\s+$/, '');
}

function isNumberKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {    	
    	return false;
    }
    return true;
}

function IsPhone(no)
{
	phone = /^([0-9]{10})$/i
	if (!phone.test(no)) {
		return false;
	}
	else {
		return true;
	}
}
function image_validate(evt,divid){
	if(!/(\.gif|\.jpg|\.jpeg|\.png)$/i.test(evt.value))
	{
		alert('Upload a picture with an extension of one of the following .gif,.jpg,.jpeg,.png');
		document.getElementById(divid).innerHTML="<div id=\"" + divid + "\"><input type=\"file\" name=\"file\" onchange=\"image_validate(this,'image_validate')\" /></div>";
		return false;
	}
}
function ChangeCurrencyMethod() 
{
	document.fsetcurr.submit();
}
