

function phnFld(a) {
	with($(a)) {
		onfocus = function() {value = value.replace(/\D/g,'');}
		onblur = function() {value = ((value.length==7)?'979':'')+value.replace(/\D/g,'');if(value.length==10)value = '('+value.substring(0,3)+') '+value.substring(3,6)+'-'+value.substring(6);}
	}
}

function $(a,b) {return(((b)?document.getElementById(a).value:document.getElementById(a)));}


function iReqFrmWiz(a) {
	$("iReqFrm1").style.display=$("iReqFrm2").style.display=$("iReqFrm3").style.display=$("iReqFrm4").style.display=$("iReqFrm5").style.display="none";
	if(a!=0)
		$("iReqFrm"+a).style.display="block";
	if(a==0) setTimeout("$('corFrmBtn').focus()",333);
	if(a==2) setTimeout("$('firstName').focus()",333);
	if(a==4) setTimeout("$('iDate').focus()",333);
	return(false);
}



function iReqForm() {
	var l=[],o="",a=b=c=1;
	for(var fld2Check=['lastName','organization','phone','email','address','city','state','zip','iContactPersonName','iDate','iStartTimeHour','iStartTimeMinute','iStartTimeAmPm','iDurationHrs','address2','city2','zip2'],fldCorNames=["Customer Last Name","Organization Name","Customer Phone Number","Customer Email Address","Customer Billing Address","City (Billing Address)","State (Billing Address)","Zip Code (Billing Address)","Contact Person Name","Assignment Date","Assignment Starting Time (Hour)","Assignment Starting Time (Minute)","Assignment Starting Time (AM/PM)","Assignment Duration","Assignment Location (Address)","Assignment Location (City)","Assignment Location (Zip)"],i=0;i<fld2Check.length;++i)
		if(!/\S+/.test($(fld2Check[i],1)))
			l[l.length] = fldCorNames[i];
	if($('lastName',1)==''&&$('organization',1)!=''||$('organization',1)==''&&$('lastName',1)!='')
		{ l.shift(); l.shift(); }
	if(l.length) o+="<br>&bull; The following field(s) cannot be blank: "+l.join(", ")+".";
	while(a<9) if($('iAmtTyp'+a++).checked) a=10;
	if(a<10) o+="<br>&bull; At least one Assignment Type must be chosen.";
	while(b<7) if($('iAmtDsc'+b++).checked) b=10;
	if(b<10) o+="<br>&bull; At least one Language Mode must be chosen.";
	if(!$('agreed').checked) o+="<br>&bull; You must agree to the S.L.I.S. Terms before your request can be processed.";
	if(o.length) {
		$('erContainer').innerHTML = "<table cellspacing=0 cellpadding=3 align=center style='width:574px;background:#F9F9F9 url(i/excl.gif) no-repeat left center;margin-bottom:15px;border:1px #CCC solid;'><tr><td class=frmSct><b style='width:484px;font-size:12px;margin-left:72px'>Your request could not be submitted for the following reason(s)</b><tr><td><div style='font-size:11px;color:#000;margin:1px 0 3px 78px'>"+o+"</div><div style='text-align:right'><button class=wizBtn style='width:120px' onClick='this.style.display=\"none\";return(iReqFrmWiz(2))' id=corFrmBtn>Correct the Form</button></div></table>";
		iReqFrmWiz(0);
	}
	if(navigator.cookieEnabled) {
		if($('memento').checked)
			setCk('sgnFrm',escape($('firstName',1)+'###'+$('lastName',1)+'###'+$('phone',1)+'###'+$('email',1)+'###'+$('address',1)+'###'+$('city',1)+'###'+$('state',1)+'###'+$('zip',1)+'###'+$('iContactPersonName',1)+'###'+$('iContactPersonPhone',1)+'###'+$('organization',1)),(new Date(2020,1,1,1,1,1,1)).toGMTString())
		else
			setCk('sgnFrm','','Thu, 01-Jan-70 00:00:01 GMT');
	}
	return(o=="");
}



function getCk(iArg) {
	var i=j=0,arg=iArg+'=';
	while(i<document.cookie.length) {
		j = i+arg.length;
		if(document.cookie.substring(i,j)==arg)
			return(unescape(document.cookie.substring(j,((document.cookie.indexOf(";",j)==-1)?document.cookie.length:document.cookie.indexOf(";",j)))));
		i=document.cookie.indexOf("",i)+1;
		if(!i) break;
	}
	return(null);
}

function setCk(a,b,c) {document.cookie = a+"="+escape(b)+"; expires="+c;}



function getCkVal() {
	var a = unescape(getCk('sgnFrm')).split('###');
	if(a==null||/null/i.test(a)||!a.length) return;
	for(var i=0,l=['firstName','lastName','phone','email','address','city','state','zip','iContactPersonName','iContactPersonPhone','organization'];i<a.length;++i)
		$(l[i]).value=a[i];
	$('memento').checked = true;
}

function _(a) {$(a).style.display='none';}
function ckCForm() {$('ickCForm1').style.visibility=(/\S+/.test($('iNam',1)))?'hidden':'visible';$('ickCForm2').style.visibility=(/\S+/.test($('iMsg',1)))?'hidden':'visible';if(!/\S+/.test($('iNam',1))){$('iNam').focus();}else{$('iMsg').focus();}return(/\S+/.test($('iNam',1))&&/\S+/.test($('iMsg',1)));}
function rembeds() {n=navigator.userAgent;w=n.indexOf("MSIE");if((w>0)&&(parseInt(n.charAt(w+5))>5)){T=["object","embed","applet"];for(j=0;j<3;j++){E=document.getElementsByTagName(T[j]);for(i=0;i<E.length;i++){P=E[i].parentNode;H=P.innerHTML;P.removeChild(E[i]);P.innerHTML=H;}}}}
