// JavaScript Document
function isEmpty(name)
{
	var invalid = " "; 
	if((name.value=="")||(name.value==invalid))
	{
		//err = "Please provide "+str;
		//alert(err);
		
		//name.focus();
		return true;
	}
	//else if(name.value.indexOf(invalid) == 1)
	//return false;
	else 
	return false;
}

function emailCheck(email)
{
	//alert(email);
	var tmp = "" + email + "", s = tmp.replace(/^\s*|\s*$/g, "");
	var re = /^(\w|[^_]\.|[\-])+((\@){1}([^_]))(([a-z]|[\d]|[\-]|\.)+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i
	if (!re.test(s)) 
	{
		//alert("Please provide a valid email id"); 
		return false;
	}
	re =	 /\.(a[c-gil-oq-uwz]|b[a-bd-jm-or-tvwyz]|c[acdf-ik-orsuvx-z]|d[ejkmoz]|e[ceghr-u]|f[i-kmorx]|g[abd-ilmnp-uwy]|h[kmnrtu]|i[delm-oq-t]|j[emop]|k[eg-imnprwyz]|l[a-cikr-vy]|m[acdghk-z]|n[ace-giloprtuz]|om|p[ae-hk-nrtwy]|qa|r[eouw]|s[a-eg-ort-vyz]|t[cdf-hjkm-prtvwz]|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[admrw]|com|edu|net|org|mil|gov|biz)$/i
	if (!re.test(s)) 
	{
		//alert("Please provide a valid email id"); 
		return false;
	}
	re = /\@\@/
	return(!re.test(s));
}

function WindowPopup(url, width_in, height_in) 
{
   	new_window = window.open(url,'window','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,top=50,left=100,scrollbars=yes,width=' + width_in + ',height=' + height_in);
	new_window.focus();
}
function PhoneDigits()
{
	if (!(window.event.keyCode>=48 && window.event.keyCode <=57) && !(window.event.keyCode==32)&& !(window.event.keyCode==45)) 
	{
		window.event.keyCode = 8
	} 
}

function TimeDigits()
{
	if (!(window.event.keyCode>=48 && window.event.keyCode <=57) && !(window.event.keyCode==58)) 
	{
		window.event.keyCode = 8
	} 
}

function check_url(address) 
{
	/*
		if((document.frmAddEditNews.txturl.value!="") && check_url(document.frmAddEditNews.txturl.value)==false)
		{
			alert("Please provide valid URL http://domainname.com");
			document.frmAddEditNews.txturl.focus();
			return false;
		}
	*/
	
  	if (((address.indexOf ('http://') == -1) && (address.indexOf ('https://') == -1)) || (address.indexOf('.') == -1))
 		return false; 
	else
  		return true;
}

/*
function check_url(address)
{
lengthValue = Trim(address);
lengthValue = lengthValue.length;
if(lengthValue != 0)
{
var j = new RegExp();
j.compile("^[A-Za-z]+://[A-Za-z0-9-]+\.[A-Za-z0-9]+"); 
lengthValue = Trim(document.getElementById('txtWeb').value);
if (!j.test(lengthValue))
{ 
alert(Please enter valid URL.");
return false;
}
}*/