String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}

function isCUG(control)
{
        if((document.location.host!='emitra.gov.in')&&(document.location.host!='www.emitra.gov.in'))
            {
                return true;
            }
	 var rege = new RegExp('^[dD][0-9]{2}[kK][0-9]{4}[a-zA-Z]*[0-9]{2}$');
	  var rege1 = new RegExp('^[dD][0-9]{2}[kK][0-9]{4}[cC][aA][0-9]{2}$');
	  if (control.value.length > 0) {
		//alert(control.value.match(rege));
		//alert(control.value.match(rege1));
		if (control.value.trim().match(rege1)) {
        }
        else if (control.value.trim().match(rege)) {
            alert('You are not Autorized to login from Here \nplease use DOIT TOOL for LOGIN to emitra');
            control.focus();
			control.value="";
            return false;
            //wsh.SendKeys("{ctrl+end}");
        }
    }
    return true;
}
