function checkNoOfChildren(value){if(value<0){return"-Number of Children cannot be less then 0\n";
}else{return"";}}var msg=new Array();var msgIndex=0;
var mandatory=false;function pop(url,name){return window.open(url,name,"top=20,left=20,width=600,height=600,scrollbars=1");
}function popupWin(file,width,height){if(navigator.appName=="Microsoft Internet Explorer"){width=width+20;
height=height+20;}if(parseInt(navigator.appVersion)<4){width=width+20;
height=height+20;}newWindow=window.open(file,"PopupWindow","target=_blank,alwaysRaised=yes,dependent=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,width="+width+",height="+height);
if(navigator.appName=="Netscape"&&parseInt(navigator.appVersion)<3){newWindow=window.open(windowLoc,"PopupWindow","status=no,alwaysRaised=yes,scrollbars=yes,resizable=no,width="+width+",height="+height);
}if(parseInt(navigator.appVersion)>=3&&navigator.appName=="Netscape"){newWindow.focus();
}}var DEBUG=false;var defaultEmptyOK=false;function isEmpty(s){return((s==null)||(s.length==0));
}function prompt(s){window.status=s;}function trim(strText){while(strText.substring(0,1)==" "){strText=strText.substring(1,strText.length);
}while(strText.substring(strText.length-1,strText.length)==" "){strText=strText.substring(0,strText.length-1);
}return strText;}function showStatus(str){window.status=str;
return true;}function isEligible(){var argv=isEligible.arguments;
var argc=argv.length;var i=0;var applicantCountry;var spouseCountry;
switch(argc){case 1:break;case 2:applicantCountry=document.getElementById(argv[1]);
applicantCountry=applicantCountry.options[applicantCountry.selectedIndex].value;
if(isEligibleCountry(applicantCountry)){ShowContent(argv[0]);
}break;case 3:applicantCountry=document.getElementById(argv[1]);
applicantCountry=applicantCountry.options[applicantCountry.selectedIndex].value;
spouseCountry=document.getElementById(argv[2]);spouseCountry=spouseCountry.options[spouseCountry.selectedIndex].value;
if(isEligibleCountry(applicantCountry)&&isEligibleCountry(spouseCountry)){ShowContent(argv[0]);
}else{HideContent(argv[0]);}break;case 4:applicantCountry=document.getElementById(argv[2]);
applicantCountry=applicantCountry.options[applicantCountry.selectedIndex].value;
if(argv[3]=="countdown"){if(isEligibleCountry(applicantCountry)){ShowContent(argv[0]);
ShowContent(argv[1]);}}else{spouseCountry=document.getElementById(argv[3]);
spouseCountry=spouseCountry.options[spouseCountry.selectedIndex].value;
if(isEligibleCountry(applicantCountry)&&isEligibleCountry(spouseCountry)){ShowContent(argv[0]);
ShowContent(argv[1]);}else{HideContent(argv[0]);HideContent(argv[1]);
}}break;case 5:applicantCountry=document.getElementById(argv[0]);
applicantCountry=applicantCountry.options[applicantCountry.selectedIndex].value;
if(!isEligibleCountry(applicantCountry)){HideContent(argv[3]);
HideContent(argv[4]);}else{if(document.getElementById(argv[1]).checked){HideContent(argv[4]);
ShowContent(argv[3]);}if(document.getElementById(argv[2]).checked){HideContent(argv[3]);
ShowContent(argv[4]);}}break;case 6:applicantCountry=document.getElementById(argv[0]);
applicantCountry=applicantCountry.options[applicantCountry.selectedIndex].value;
if(!isEligibleCountry(applicantCountry)){HideContent(argv[3]);
HideContent(argv[4]);HideContent(argv[5]);}else{if(document.getElementById(argv[1]).checked){HideContent(argv[5]);
HideContent(argv[4]);ShowContent(argv[3]);}if(document.getElementById(argv[2]).checked){HideContent(argv[3]);
ShowContent(argv[4]);ShowContent(argv[5]);}}break;}}function isEligibleCountry(value){var eligibleCountries="-61-65-81-86-82-91-266-223-95-102-175-104-106-112-120-140-146-156-163-221-190-177-181-183-187-261-262-189-194-56-182-185-1000-0-";
var country="-"+value+"-";if(eligibleCountries.indexOf(country)>=0){return true;
}else{return false;}}function HideContent(){var argv=HideContent.arguments;
var argc=argv.length;var i;if(argc<1){return;}for(i=0;
i<argc;i++){document.getElementById(argv[i]).style.display="none";
}}function ShowContent(){var argv=ShowContent.arguments;
var argc=argv.length;if(argc<1){return;}for(i=0;i<argc;
i++){document.getElementById(argv[i]).style.display="";
}}var plan1;var plan2;var plan3;var plan4;var plan5;
var plan6;var plan7;var amount1="$69";var amount2="$119";
var amount3="$79";var amount4="$99";var amount5="$199";
var amount6="$499";var amount7="$499";var extamount1="$79";
var extamount2="$129";var extamount3="$89";var extamount4="$109";
var extamount5="$209";var extamount6="$509";var extamount7="$509";
function displayPlan(){var argv=displayPlan.arguments;
var argc=argv.length;var id=argv[0];document.getElementById(argv[1]).innerHTML=plan1;
if(id=="applicationType.1"&&document.getElementById(id).checked){document.getElementById(argv[2]).innerHTML=plan1;
document.getElementById(argv[1]).innerHTML=plan1;document.getElementById(argv[3]).innerHTML=amount1;
document.getElementById(argv[4]).innerHTML=amount1;
if(document.getElementById(argv[5])!=null&&document.getElementById(argv[5])!=undefined){document.getElementById(argv[5]).innerHTML=extamount1;
}}if(id=="applicationType.2"&&document.getElementById(id).checked){document.getElementById(argv[2]).innerHTML=plan2;
document.getElementById(argv[1]).innerHTML=plan2;document.getElementById(argv[3]).innerHTML=amount2;
document.getElementById(argv[4]).innerHTML=amount2;
if(document.getElementById(argv[5])!=null&&document.getElementById(argv[5])!=undefined){document.getElementById(argv[5]).innerHTML=extamount2;
}}if(id=="applicationType.3"&&document.getElementById(id).checked){document.getElementById(argv[2]).innerHTML=plan3;
document.getElementById(argv[1]).innerHTML=plan3;document.getElementById(argv[3]).innerHTML=amount3;
document.getElementById(argv[4]).innerHTML=amount3;
if(document.getElementById(argv[5])!=null&&document.getElementById(argv[5])!=undefined){document.getElementById(argv[5]).innerHTML=extamount3;
}}if(id=="applicationType.4"&&document.getElementById(id).checked){document.getElementById(argv[2]).innerHTML=plan4;
document.getElementById(argv[1]).innerHTML=plan4;document.getElementById(argv[3]).innerHTML=amount4;
document.getElementById(argv[4]).innerHTML=amount4;
if(document.getElementById(argv[5])!=null&&document.getElementById(argv[5])!=undefined){document.getElementById(argv[5]).innerHTML=extamount4;
}}if(id=="applicationType.5"&&document.getElementById(id).checked){document.getElementById(argv[2]).innerHTML=plan5;
document.getElementById(argv[1]).innerHTML=plan5;document.getElementById(argv[3]).innerHTML=amount5;
document.getElementById(argv[4]).innerHTML=amount5;
if(document.getElementById(argv[5])!=null&&document.getElementById(argv[5])!=undefined){document.getElementById(argv[5]).innerHTML=extamount5;
}}if(id=="applicationType.6"&&document.getElementById(id).checked){document.getElementById(argv[2]).innerHTML=plan6;
document.getElementById(argv[1]).innerHTML=plan6;document.getElementById(argv[3]).innerHTML=amount6;
document.getElementById(argv[4]).innerHTML=amount6;
if(document.getElementById(argv[5])!=null&&document.getElementById(argv[5])!=undefined){document.getElementById(argv[5]).innerHTML=extamount6;
}}if(id=="applicationType.7"&&document.getElementById(id).checked){document.getElementById(argv[2]).innerHTML=plan7;
document.getElementById(argv[1]).innerHTML=plan7;document.getElementById(argv[3]).innerHTML=amount7;
document.getElementById(argv[4]).innerHTML=amount7;
if(document.getElementById(argv[5])!=null&&document.getElementById(argv[5])!=undefined){document.getElementById(argv[5]).innerHTML=extamount7;
}}}function displayInstruction(){var argv=displayInstruction.arguments;
var originalContent=document.getElementById(argv[1]).innerHTML;
var dynamicContent=document.getElementById(argv[2]).innerHTML;
document.getElementById(argv[1]).innerHTML=dynamicContent;
var content=document.getElementById(argv[0]).innerHTML;
document.getElementById(argv[1]).innerHTML=originalContent;
popupWin=window.open("","","toolbars=no,scrollbars=yes,noresize,resizable=yes,width=600,height=1300");
popupWin.document.write('<html><head><title>USAGS</title> <link rel="stylesheet" type="text/css" href="/css/styles.css" /><link rel="stylesheet" type="text/css" href="/css/photos.css" /></head><body><div id="offlineInstructions">');
popupWin.document.write(content);popupWin.document.write('<div class="formButtons border-top"><div class="formButtonsLeft"><input type="button" id="print" value="');
popupWin.document.write(argv[3]);popupWin.document.write('" onclick="javascript:self.print();" /></div><div class="formButtonsRight"><input type="button" value="');
popupWin.document.write(argv[4]);popupWin.document.write('" onclick="window.close()" /></div>    </div></div></body></html>');
popupWin.document.close();popupWin.focus();}function setPlanContent(){var argv=setPlanContent.arguments;
var argc=argv.length;plan1=argv[0];plan2=argv[1];plan3=argv[2];
plan4=argv[3];plan5=argv[4];plan6=argv[5];plan7=argv[6];
if(argv[7]!=null){amount1+=" "+argv[7];amount2+=" "+argv[7];
amount3+=" "+argv[7];amount4+=" "+argv[7];amount5+=" "+argv[7];
amount6+=" "+argv[7];amount7+=" "+argv[7];}}function eligibilityDisable(id,secid){document.getElementById(id).disabled=true;
document.getElementById(secid).className="none";}function eligibilityEnable(id,secid){document.getElementById(id).disabled=false;
document.getElementById(secid).className="";}function checkBoxContentCheck(){var argv=checkBoxContentCheck.arguments;
var argc=argv.length;var id1;var id2;var id3;var id4;
var id5;var id6;var id7;if(document.getElementById(argv[0]).checked){id1=argv[1]+"-1";
id2=argv[2]+"-1";id3=argv[3]+"-1";id4=argv[4]+"-1";
id5=argv[5]+"-1";id6=argv[6]+"-1";HideContent(id1,id2,id3,id4,id5,id6);
id1=argv[1]+"-2";id2=argv[2]+"-2";id3=argv[3]+"-2";
id4=argv[4]+"-2";id5=argv[5]+"-2";id6=argv[6]+"-2";
ShowContent(id1,id2,id3,id4,id5,id6,argv[4]);}else{id1=argv[1]+"-2";
id2=argv[2]+"-2";id3=argv[3]+"-2";id4=argv[4]+"-2";
id5=argv[5]+"-2";id6=argv[6]+"-2";HideContent(id1,id2,id3,id4,id5,id6);
id1=argv[1]+"-1";id2=argv[2]+"-1";id3=argv[3]+"-1";
id4=argv[4]+"-1";id5=argv[5]+"-1";id6=argv[6]+"-1";
ShowContent(id1,id2,id3,id4,id5,id6,argv[4]);}}function onStateSelect(){var argv=onStateSelect.arguments;
var argc=argv.length;var selectCountry;var canadaStates="-AB-BC-MB-NB-NL-NT-NS-NU-ON-PE-QC-SK-YT-";
var selectedState=document.getElementById(argv[0]);
selectedState="-"+selectedState.options[selectedState.selectedIndex].value+"-";
if(canadaStates.indexOf(selectedState)>=0){selectCountry=document.getElementById(argv[1]);
selectCountry.value="221";}else{selectCountry=document.getElementById(argv[1]);
selectCountry.value="223";}}function onPaymentStateSelect(){var argv=onPaymentStateSelect.arguments;
var argc=argv.length;var selectCountry;var canadaStates="-AB-BC-MB-NB-NL-NT-NS-NU-ON-PE-QC-SK-YT-";
var selectedState=document.getElementById(argv[0]);
selectedState="-"+selectedState.options[selectedState.selectedIndex].value+"-";
if(canadaStates.indexOf(selectedState)>=0){selectCountry=document.getElementById(argv[1]);
selectCountry.value="CA";if(document.getElementById(argv[2]).value=="NA"){document.getElementById(argv[2]).value="";
}if(document.getElementById(argv[3]).value=="NA"){document.getElementById(argv[3]).value="";
}if(document.getElementById(argv[4]).value=="NA"){document.getElementById(argv[4]).value="";
}if(document.getElementById(argv[5]).value=="NA"){document.getElementById(argv[5]).value="";
}}else{selectCountry=document.getElementById(argv[1]);
selectCountry.value="US";if(document.getElementById(argv[2]).value=="NA"){document.getElementById(argv[2]).value="";
}if(document.getElementById(argv[3]).value=="NA"){document.getElementById(argv[3]).value="";
}if(document.getElementById(argv[4]).value=="NA"){document.getElementById(argv[4]).value="";
}if(document.getElementById(argv[5]).value=="NA"){document.getElementById(argv[5]).value="";
}}}function onCountrySelect(){var argv=onCountrySelect.arguments;
var argc=argv.length;var selectedCountry=document.getElementById(argv[0]);
selectedCountry=selectedCountry.options[selectedCountry.selectedIndex].value;
if(selectedCountry!="221"&&selectedCountry!="223"){HideContent(argv[1]);
HideContent(argv[2]);}else{ShowContent(argv[2]);ShowContent(argv[1]);
}}function onPaymentCountrySelect(){var argv=onPaymentCountrySelect.arguments;
var argc=argv.length;var selectedCountry=document.getElementById(argv[0]);
selectedCountry=selectedCountry.options[selectedCountry.selectedIndex].value;
if(selectedCountry!="CA"&&selectedCountry!="US"){HideContent(argv[1]);
HideContent(argv[2]);HideContent(argv[3]);HideContent(argv[4]);
HideContent(argv[5]);HideContent(argv[6]);HideContent(argv[7]);
HideContent(argv[8]);HideContent(argv[9]);HideContent(argv[10]);
document.getElementById(argv[11]).value="NA";document.getElementById(argv[12]).value="NA";
document.getElementById(argv[13]).value="NA";document.getElementById(argv[14]).value="NA";
document.getElementById(argv[15]).value="NA";}else{if(selectedCountry=="CA"||selectedCountry=="US"){document.getElementsByName("billTo_state")[0].value="";
}ShowContent(argv[2]);ShowContent(argv[1]);ShowContent(argv[3]);
ShowContent(argv[4]);ShowContent(argv[5]);ShowContent(argv[6]);
ShowContent(argv[7]);ShowContent(argv[8]);ShowContent(argv[9]);
ShowContent(argv[10]);if(document.getElementById(argv[11]).value=="NA"){document.getElementById(argv[11]).value="";
}if(document.getElementById(argv[12]).value=="NA"){document.getElementById(argv[12]).value="";
}if(document.getElementById(argv[13]).value=="NA"){document.getElementById(argv[13]).value="";
}if(document.getElementById(argv[14]).value=="NA"){document.getElementById(argv[14]).value="";
}if(document.getElementById(argv[15]).value=="NA"){document.getElementById(argv[15]).value="";
}}}function savecontinue(actn){if(actn=="savecontinue"){document.forms[0].opr.value="scon";
}}function resetnextpage(){document.forms[0].opr.value="nextPage";
}function planValue(){var user_input;for(var i=0;i<document.forms[0].applicationType.length;
i++){if(document.forms[0].applicationType[i].checked){}}if(user_input==1){document.forms[0].amount.value="49.00";
}if(user_input==2){document.forms[0].amount.value="69.00";
}if(user_input==3){document.forms[0].amount.value="119.00";
}if(user_input==4){document.forms[0].amount.value="79.00";
}if(user_input==5){document.forms[0].amount.value="99.00";
}if(user_input==6){document.forms[0].amount.value="199.00";
}if(user_input==7){document.forms[0].amount.value="299.00";
}}function setCheckBoxValue(id){if(document.getElementById(id).checked){document.getElementById(id).value=true;
}else{document.getElementById(id).value=false;}}function planSubmit(){var action=document.forms[0].action;
if(action.indexOf("?")!=-1){action+="&planselect=success";
}else{action+="?planselect=success";}document.forms[0].action=action;
document.forms[0].submit();}
