



function MM_preloadImages() { //v3.0



  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();



    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)



    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}



}







function MM_swapImgRestore() { //v3.0



  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;



}







var win = null;



function NewWindow(mypage,myname,w,h,scroll){



LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;



TopPosition = (screen.height) ? (screen.height-h)/2 : 0;



settings =



'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'



win = window.open(mypage,myname,settings)



}







function MM_findObj(n, d) { //v4.01



  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {



    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}



  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];



  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);



  if(!x && d.getElementById) x=d.getElementById(n); return x;



}







function MM_swapImage() { //v3.0



  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)



   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}



}







var time = null



function move() {



window.location = '/index.php'



}







function popitup(url, name, h, w)



{



	newwindow=window.open(url,name,height=h,width=w);



	if (window.focus) {newwindow.focus()}



	return false;



}







function ClearError() {



return true;



}



window.onerror = ClearError;







function OnClickHandler()



{ 



  var el=null;



  var flag=true;



  el = event.srcElement;



  // Do the While loop to find out if any of the parent elements 



  // are an A HREF.



  // This is necessary because in Internet Explorer 4.x, you can 



  // receive events of any element including the <B> tag.   



  while (flag && el)   



  {



    if (el.tagName == "A")



    { 



      flag=false;



      if (el.protocol == "javascript:")



      {



        execScript(el.href, "javascript");



        // A window.event.returnValue=false is performed so that the 



        // default action does not happen - which in case of an HREF



        // will be navigating to a link. 



        window.event.returnValue = false; 



      }



      if (el.protocol == "vbscript:")



      { 



        execScript(el.pathname, "vbscript");



        window.event.returnValue = false; 



      }



    } 



    else 



      el = el.parentElement; 



  } 



} // end OnClickHandler()







 document.onclick = OnClickHandler; // set the On click handler for the document 







function disableIt(obj, obj2, obj3)



{



	obj.disabled = !(obj.disabled);



	var z = (obj.disabled) ? 'disabled' : 'enabled';



	



	obj2.disabled = !(obj2.disabled);



	var y = (obj2.disabled) ? 'disabled' : 'enabled';



	



	obj3.disabled = !(obj3.disabled);



	var y = (obj3.disabled) ? 'disabled' : 'enabled';







	



}







function extracheck(obj)



{



	return !obj.disabled;



}







function disableIt2(obj, obj2)



{



        obj.disabled = !(obj.disabled);



        var z = (obj.disabled) ? 'disabled' : 'enabled';







        obj2.disabled = !(obj2.disabled);



        var y = (obj2.disabled) ? 'disabled' : 'enabled';



}







function go() {



	box = document.forms[0].url;



	destination = box.options[box.selectedIndex].value;



	if (destination) location.href = destination;



}







function jah(url,target) {



	// native XMLHttpRequest object



	document.getElementById(target).innerHTML = "<p><strong>Loading</strong></p>";



	if (window.XMLHttpRequest) {



		req = new XMLHttpRequest();



		req.onreadystatechange = function() {jahDone(target);};



		req.open("GET", url, true);



		req.send(null);



	// IE/Windows ActiveX version



	} else if (window.ActiveXObject) {



		req = new ActiveXObject("Microsoft.XMLHTTP");



		if (req) {



			req.onreadystatechange = function() {jahDone(target);};



			req.open("GET", url, true);



			req.send();



		}



	}



}







function jahDone(target) {



	// only if req is "loaded"



	if (req.readyState == 4) {



		// only if "OK"



		if (req.status == 200) {



			results = req.responseText;



			document.getElementById(target).innerHTML = results;



		} else {



			document.getElementById(target).innerHTML="jah error:\n" +



				req.statusText;



		}



	}



}	







function togglePerspective() {



	var d = document; {



		document.getElementById('perspective').style.display = "block";



		document.getElementById('perspectiveTab').style.backgroundPosition = "0 0";



		document.getElementById('welcome').style.display = "none";



		document.getElementById('welcomeTab').style.backgroundPosition = "0 -24px";



	} 



}



function toggleWelcome() {



	var d = document; {



		document.getElementById('welcome').style.display = "block";



		document.getElementById('welcomeTab').style.backgroundPosition = "0 0";



		document.getElementById('perspective').style.display = "none";



		document.getElementById('perspectiveTab').style.backgroundPosition = "0 -24px";



	} 



}
		
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

function checkField(fieldName) {
        if(eval("document.rf." + fieldName).value=="") {
                alert("Please enter \"" + fieldName.replace(/_/gi," ") + "\".");
                eval("document.rf." + fieldName).focus();
                return false;
        } else return true;
        }
        function echeck(str) { 
        var at="@";
        var dot=".";
        var lat=str.indexOf(at); 
        var lstr=str.length;
        var ldot=str.indexOf(dot);
        if (str.indexOf(at)==-1) return false;
        if(str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false;
        if(str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false;
        if(str.indexOf(at,(lat+1))!=-1) return false;
        if(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false;
        if(str.indexOf(dot,(lat+2))==-1) return false;
        if(str.indexOf(" ")!=-1) return false;
        return true;            
        }
        function checkSelect(selectName) {
        if(eval("document.rf."+selectName + ".options[document.rf."+selectName+".selectedIndex]").value=="") {
                alert("Please select a response for \"" + selectName.replace(/_/gi," ") + "\".");
                eval("document.rf." + selectName).focus();
                return false;
        } else return true;
        }
        function checkRadio(radiobuttonName) {
        var radioChoice=false;
        var radioLength=eval("document.rf." + radiobuttonName).length;
        for(var counter=0;counter<radioLength;counter++) {
                if(eval("document.rf." + radiobuttonName + "[" + counter + "]").checked)
                        radioChoice=true; // found a value for the radio button
        }
        if(!radioChoice) {
                alert("Please select a choice for \"" + radiobuttonName.replace(/_/gi," ") + "\".");
                eval("document.rf." + radiobuttonName + "[0]").focus();
                return false;
        } else return true;
        }
        function checkForm() {
        if(!checkField("First_Name")) return false;
        if(!checkField("Last_Name")) return false;
        if(!checkField("Residence_Address")) return false;
        if(!checkField("City")) return false;
        if(!checkField("State_Or_Province")) return false;
        if(!checkField("Zip_Or_Postal_Code")) return false;
        if(!checkSelect("Country")) return false;
        if(!checkField("Home_Telephone")) return false;
        if(!echeck(document.rf.Email_Address.value)) { alert("Please enter a valid e-mail address."); document.rf.Email_Address.focus(); return false; } 
        if(!checkRadio("Are_You_Of_Legal_Age")) return false;
        if(!checkRadio("Ever_Convicted_Of_Felony")) return false;
        if(!checkRadio("Ever_Associated_With_Terrorist_Activities")) return false;
        if(!checkRadio("Been_Involved_In_Litigation")) return false;

        if(!checkSelect("Highest_Education")) return false;
        if(!checkField("School_1_Attended")) return false;
        if(!checkField("School_1_Years")) return false;
        if(!checkField("School_1_Grade_Or_Degree")) return false;
        if(!checkRadio("Employment")) return false; 
        if(!checkField("Number_Of_Years")) return false;
        if(!checkField("Nature_Of_Business")) return false;
        if(!checkSelect("Business_Experience_Level")) return false;
        if(!checkRadio("May_Contact_At_Work")) return false; 

        if(!checkField("Reference_1_Name")) return false;
        if(!checkField("Reference_1_Address")) return false;
        if(!checkField("Reference_1_Telephone")) return false;
        if(!checkRadio("Will_Have_Partners")) return false;
        if(!checkSelect("When_Will_You_Invest_In_Franchise")) return false;
        if(!checkSelect("How_Involved_In_Operations")) return false;

        if(!checkSelect("Est_Training_Date_Month")) return false;

        if(!checkSelect("Est_Training_Date_Year")) return false;
        if(!checkRadio("Has_Read_Disclaimer")) return false;
        if(document.rf.Has_Read_Disclaimer[1].checked) { 
                alert("Please read the disclaimer before submitting this form. Afterwards, please select YES to indicate that you have read it.");
                document.rf.Has_Read_Disclaimer[0].focus();
                return false;
        }
        if(!checkField("Applicates_Typed_Name")) return false;
        if(!checkField("Applicates_Name_Date")) return false;
        return true;
        }