var mxStateShort = new Array("AL","AK","AS","AZ","AR","CA","CZ","CO","CT","DE","DC","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MP","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY");
var mxStateFull = new Array("Alabama","Alaska","American Samoa","Arizona","Arkansas","California","Canal Zone","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Guam","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Mariana Islands","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virgin Islands","Virginia","Washington","West Virginia","Wisconsin","Wyoming");
var mxDate = new Date();var mxYear = 000 + mxDate.getFullYear();
var mxDayName = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var mxMonthName = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
function mxEmpty (mxObj, mxParam){
	var mxTmpA = mxObj.value;
	if (mxTmpA=="" || mxTmpA==" " || mxTmpA=="  " || mxTmpA==" "){ 
		window.alert("Sorry, "+ mxParam +" cannot be left empty.\nPlease provide data in it.");
		mxObj.focus();
		return true;
	}
}
function NotAlphaNumeric(mxObj, mxParam){
	var numaric = mxObj.value;
	for(var j=0; j<numaric.length; j++){
		var alphaa = numaric.charAt(j);
		var hh = alphaa.charCodeAt(0);
		if((hh > 47 && hh<59) || (hh > 64 && hh<91) || (hh > 96 && hh<123)){
		}else{
			window.alert("Sorry, "+ mxParam +" has invalid characters.\nOnly ALPH-NUMERIC values are allowed.");
			mxObj.focus();
			return true;
		}
	}
	return false;
}
function lcase(mxObj){
	if(mxObj.value!=""){
		mxObj.value=mxObj.value.toLowerCase();
	}
}
function mxNaLen(mxObj, mxLen, mxParam){
	var mxObjValue = new String(mxObj.value);
	if( mxObjValue.length < mxLen ){
		window.alert("Minimum "+mxLen+" Characters are required for "+mxParam+".");
		mxObj.focus();
		return true;
	}
}
function mxNaEmail(mxObj,mxParam){
	var mxObjInavlidChars = new Array(" ","~","`","!","#","$","%","^","&","*","(",")","/","\\","'",":",";",">","<",",","[","]","{","}","\"","?","+","=","®","©","™"," ");
	var mxObj_isStr = (typeof mxObj) == "string";
	var mxObjValue = (mxObj_isStr) ? mxObj : mxObj.value;
	var mxObjChk_1 = mxObjValue.indexOf(" ");
	var mxObjChk_2 = mxObjValue.indexOf("@");
	var mxObjChk_3 = mxObjValue.lastIndexOf("@");
	var mxObjChk_4 = mxObjValue.lastIndexOf(".");
	var mxObjChk_5 = mxObjValue.slice(0,mxObjChk_2);
	var mxObjChk_6 = mxObjValue.slice(mxObjChk_2+1,mxObjChk_4);
	var mxObjChk_7 = mxObjValue.slice(mxObjChk_2,mxObjValue.length);
	var mxObjChk_8 = mxObjValue.indexOf("..");
	var mxObjChk_9 = mxObjValue.slice(mxObjChk_2,mxObjChk_3);
	var mxObjChk_10 = mxObjValue.lastIndexOf("_");
	var mxObjChk_11 = mxObjValue.slice(mxObjChk_4+1,mxObjValue.length+4);
	if (mxObjValue==""){
		window.alert("Sorry, "+ mxParam +" cannot be left empty.\nPlease provide data in it.");
		if(!mxObj_isStr){
			mxObj.focus();
		}
		return true;
	}
	if (mxObjChk_5=="" || mxObjChk_2<0 || mxObjChk_9.length!=0 || mxObjChk_6=="" || mxObjChk_4<0 || mxObjChk_8>=0 || mxObjChk_10-mxObjChk_2>=0 || mxObjChk_11.length < 2){
		//window.alert ("Sorry, "+ mxParam +" is Not Valid. \nExamples For Valid E-mail Address Are : \n\n personname@anydomain.com\t \n personname@anydomain.net \n personname@anydomain.org \n personname@anydomain.usa \n personname@anydomain.info ");
		window.alert ("Sorry, "+ mxParam +" is not a valid email address. \nPlease provide it again.");
		if(!mxObj_isStr){
			mxObj.focus();
		}
		return true;
	}
	if (mxObjChk_1>=0){ 
		window.alert ("Sorry, "+ mxParam +" Has Spaces."); 
		if(!mxObj_isStr){
			mxObj.focus();
		} 
		return true;
	}
	for(i=0;i<=mxObjInavlidChars.length-1;i++){ 
		if (mxObjValue.indexOf(mxObjInavlidChars[i]) >= 0){ 
			window.alert ("Sorry, "+ mxParam +" Has Invalid Characters."); 
			if(!mxObj_isStr){
				mxObj.focus();
			} 
			return true;
		} 
	}
}

function mxGetDate(){
	return mxDayName[mxDate.getDay()] + ", " + mxMonthName[mxDate.getMonth()] + " " + mxDate.getDate() + ", " + mxYear;
}

var mxWinObj = null;
var mxAppObjVer = navigator.appVersion;mxAppObjVer = mxAppObjVer.toLowerCase();
function mxWinObjCloser() {
	if( mxWinObj && mxWinObj.open && !mxWinObj.closed ){
		mxWinObj.close();
	}
}
function mxWinObjOpener(mxWinObjUrl,mxWinObjWidth,mxWinObjHeight,mxObjYn){
	var mxWinObjL = (screen.width - mxWinObjWidth) / 2;
	var mxWinObjT = (screen.height - mxWinObjHeight) / 2;
	var mxWinObjPage = mxWinObjUrl;
	var mxWinObjName;
	mxWinObjprops = 'height='+mxWinObjHeight+',width='+mxWinObjWidth+',top='+mxWinObjT+',left='+mxWinObjL+',scrollbars='+mxObjYn+',resizable='+mxObjYn+',status=no,toolbar=no';
	if(mxAppObjVer.indexOf("mac") == -1) mxWinObjCloser();
	mxWinObj = window.open(mxWinObjPage, mxWinObjName, mxWinObjprops);
	if (parseInt(navigator.appVersion) >= 4){
		mxWinObj.window.focus();
	}
}
function privacyPolicy(){
	mxWinObjOpener("privacy.htm",671,450,'yes');
}
function changDefVal(mxField){
	mxDefValue = mxField.defaultValue;
	mxValue = mxField.value;
	if(mxValue == mxDefValue && mxField.className=="TextfieldsDis"){
		mxField.value="";
		mxField.className="Textfields";
	}else if(mxValue == ""){
		mxField.className="TextfieldsDis";
		mxField.value=mxDefValue;
	}
}
function showAjaxProcessBar(){
	document.getElementById('Processing').style.display='inline';
}
function hideAjaxProcessBar(){
	document.getElementById('Processing').style.display='none'
}
function loadXMLHttp() {
	var page_request = false;
	var _ms_XMLHttpRequest_ActiveX="";
	if (window.XMLHttpRequest) {
		page_request = new XMLHttpRequest();
		if (page_request.overrideMimeType) {
			page_request.overrideMimeType('text/html');
		}
	} else if (window.ActiveXObject) {
		var versions = ["Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
		for (var i = 0; i < versions.length ; i++) {
			try {
				page_request = new ActiveXObject(versions[i]);
				if (page_request) {
					_ms_XMLHttpRequest_ActiveX = versions[i];
					break;
				}
			} catch (objException) {} ;
		}
	}
	if (!page_request) {
		window.alert('Giving up :( Cannot create an XMLHTTP instance');
		return false;
	}
	return page_request;
}