/*  */ 

<!-- Function validation for templates-->

var eraseErrorsTimer;
function addLoadEvent(f){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=f;}else{window.onload=function(){if(oldonload){oldonload();}f();}}}
 var workingContainer=null;
 function swapColor(e){
  if(workingContainer!=e){
   var el=tag('div');
   for(var i=0;i<el.length;i++){
    var c=el[i].className;
    if(c.indexOf("sub-shell-top")!=-1||c.indexOf("sub-shell-bg")!=-1||c.indexOf("sub-shell-bottom")!=-1){
     if(el[i].getAttribute("rel")==e) el[i].className=(c.indexOf("-active")==-1)?c+" "+c+"-active":c;
     else el[i].className=c.split(" ")[0];
    }
   }workingContainer=e;
  }
 }
 function addEventsToDivs(){
  var el=tag('div');var j=0;var u=0;
  for(var i=0;i<el.length;i++){
   if(el[i].className.indexOf("sub-shell-top")!=-1||el[i].className.indexOf("sub-shell-bg")!=-1||el[i].className.indexOf("sub-shell-bottom")!=-1){el[i].setAttribute("rel",j);el[i].onmouseover=new Function("swapColor("+j+");");j=(u==2)?(j+1):j;u=(u==2)?0:(u+1);}
  }
 }
 function addEventToQuestion(){
  var el=tag('img');
  for(var i=0;i<el.length;i++){
   if((el[i].src).indexOf("qe-questionmark.gif")!=-1 && el[i].getAttribute("help")!=null){
    el[i].style.cursor="pointer";
    el[i].id="help"+i;
    el[i].onclick=new Function("drawHelp("+i+",'"+el[i].getAttribute('help')+"','"+el[i].id+"');");
   }
  }
 }
 function drawHelp(n,c,e){ eraseErrors(); drawError(e,'<h3>About</h3><p>'+c+'</p>',findPos(id(e))); }
 addLoadEvent(addEventsToDivs);
 addLoadEvent(addEventToQuestion);
 
 var spouse=true;
    var child=0;
 var maxChildren=10;
 function addPerson(p){
   if(p.indexOf('child')!=-1){child++;}
  if(p.indexOf('child')!=-1 && child<=maxChildren){ id(p).appendChild(printChild(child)); addEventsToDivs(); hideShowCloseBtn(child); } 
  if(child>=maxChildren){ id(p+"-btn").style.visibility="hidden";child=maxChildren; }
 }
 function removePerson(p){
   if(p.indexOf('child')!=-1){
   id(p).removeChild(id(p+"-"+child)); child--;
   hideShowCloseBtn(child);
   if(child<maxChildren){ id(p+"-btn").style.visibility="visible"; }
  }
 }
 function hideShowCloseBtn(n){
  for(var i=1; i<=n; i++){ 
   if(i==n) id("close-"+i).style.visibility="visible";
   else id("close-"+i).style.visibility="hidden";
  }
 }
           try{ if(document.layers){ document.captureEvents(Event.MOUSEMOVE); }document.onmousemove=getMouseCoords; }catch(e){}
 var mXY=new Array();
 function getMouseCoords(e){try{if(document.all){mXY[0]=window.event.x+document.body.scrollLeft;mXY[1]=window.event.y+document.body.scrollTop+(document.documentElement?document.documentElement.scrollTop:0);mXY[2]=document.body.clientWidth+document.body.scrollLeft;mXY[3]=document.body.clientHeight+document.body.scrollTop;}else{mXY[0]=e.pageX;mXY[1]=e.pageY;mXY[2]=window.innerWidth+window.pageXOffset;mXY[3]=window.innerHeight+window.pageYOffset;}}catch(e){}}
 function show(n){ hide();var d=id('popout-'+n);d.style.visibility="visible";
  d.style.top=(mXY[1]+(navigator.appName=="Microsoft Internet Explorer"?-18:-16))+"px";
  d.style.left=(mXY[0]+(navigator.appName=="Microsoft Internet Explorer"?80:82))+"px";
 }
 function hide(u){
  for(var i=0;i<0;i++){ if(id('popout-'+i)){ id('popout-'+i).style.visibility="hidden";} }
  if(u){window.top.location.href=u;}
 }
 function dollar(a){
  a=parseFloat(a);
  a=(isNaN(a))?0.00:a;
  var n=(a<0)?"-":"";
  a=((int(((Math.abs(a))+.005)*100))/100)+"";
  if(a.indexOf('.')<0){ a+=".00"; }
  if(a.indexOf('.')==(a.length-2)){ a+="0"; }
  return "$"+n+a;
 }
 function clearRiders(){
 id("selected_riders").value=""
 }
 function updatePremium(f,c){
  f=id(f);
  var el=f.elements;
  var t=0;var urlstr="";
  for(var i=0; i<el.length; i++){
   if(el[i].name!='undefined' && el[i].type=="checkbox" && el[i].checked==true){
    t+=parseFloat(el[i].value);
    urlstr+="&"+el[i].name+"="+el[i].value;
   }
  }
  t+=parseFloat(f.premium.value);
  id("total-premium-plan-"+(f.id.split("-")[2])).innerHTML=dollar(t);
  if(c){
   id("premium-h3-"+(f.id.split("-")[2])).innerHTML=dollar(t);
   var l=id("apply-"+(f.id.split("-")[2]));
   if(l.getAttribute("default")==null){ l.setAttribute("default",l.href.replace("')","")); }
   l.href=l.getAttribute("default")+urlstr+"')";
   id("selected_riders").value+=f.name+urlstr+",";
  }
 }
 
 function sort(type){
  var form=id('customizeForm');
  form.sortOrderName.value=type;
  var currentSortType = '';
  var currentSortOrder = '';
  // sort type changed, or was previously descending, sort ascending
  form.order.value = (currentSortType != type || currentSortOrder == 'descending') ? 'ascending' : 'descending';
  form.submit();
 }
 function email(e){ eraseErrors();
  var f=id("mailForm");
  if(f.selected_quotes.value=="")
   drawError('selected_quotes','<h3>Oh no!<br />What happened?</h3><p>Please select at least one plan.</p>',findPos(id(e)));
  else{
   f.submit();
  }
 }
 function compare(e){ eraseErrors();
  var f=id("detailForm");
  if(f.selected_quotes1.value=="")
   drawError('selected_quotes1','<h3>Oh no!<br />What happened?</h3><p>Please select at least one plan.</p>',findPos(id(e)));
  else if(((f.selected_quotes1.value).split(",")).length>4)
   drawError('selected_quotes1','<h3>Oh no!<br />What happened?</h3><p>Please select a <u>maximum</u> of four plans to compare.</p>',findPos(id(e)));
  else {
   f.submit();
  }
 }
 function detail(quoteId){
  var f=id("detailForm");
  f.selected_quotes1.value=quoteId;
  f.submit();
 }
 function printQuotes(){ print(); }
 function selectedPlans(c){ var e=id("selected_quotes");
  if(c.checked==true){ e.value+=((((e.value).length>0)?",":"")+c.value); }
  else{
   var a=(e.value).split(",");
   for(var i=0; i<a.length; i++){
    if(a[i]==c.value){ a.splice(i,1); e.value=a; break; }
   }
  }
  id("selected_quotes1").value=e.value;
 }
 try{ document.execCommand('BackgroundImageCache', false, true); }catch(e){}
 function findPos(o){ 
  var l=t=0;
  if(o.offsetParent){ 
   l=o.offsetLeft;
   t=o.offsetTop;
   while(o=o.offsetParent){ l+=o.offsetLeft;t+=o.offsetTop; } 
  }
  return [l,t];
 }
 function drawError(i,c,p){
   var n='popout_'+i;
   if(!id(n)){
  var e=id('errors');var d=cE('div');
  d.setAttribute('id',n);d.className="popout";
  d.innerHTML='<div class="popout-top"> </div><div class="popout-bg">'+c+'</div><div class="popout-bottom"> </div>';
  e.appendChild(d);
  n=id(n);
  n.style.visibility="visible";
  n.style.top=(p[1]-36)+"px";
  n.style.left=(("Modern Template"=="Classic Template")?(findPos(id('quote-engine'))[0]+543):(findPos(id('quote-engine'))[0])+545)+"px";
  eraseErrorsTimer=setTimeout("eraseErrors()",6000);
   }
 }
 function eraseErrors(){ clearTimeout(eraseErrorsTimer);if(id('errors')){ id('errors').innerHTML=""; } }
 function dateDifference(mm1,dd1,yyyy1, mm2,dd2,yyyy2) {
  return Math.floor(((new Date(yyyy2, mm2-1, dd2)).getTime() - (new Date(yyyy1, mm1-1, dd1)).getTime())/(1000*60*60*24*365));
 }
 function validateStep1(f){ eraseErrors();
  var e=id("zip");
  if(e.value=="" || isNaN(e.value) || e.value.length!=5){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your zip code appears to have been entered incorrectly. Please re-enter your zip code.</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
  e=id("firstName");
  if(specialChar(e.value.replace(/\s+/g,''))){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your first name appears to have been entered incorrectly. Please re-enter your first name.</p>',findPos(e));
   e.focus();
   return false;
  }
  if(e.value==""&& true){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your first name.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("lastName");
  if(specialChar(e.value.replace(/\s+/g,''))){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your last name appears to have been entered incorrectly. Please re-enter your last name.</p>',findPos(e));
   e.focus();
   return false;
  }
  if((e.value=="" || e.value.length<2)&& true){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your last name.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("work_phone");
  var stripped=e.value.replace(/[\(\)\.\-\ ]/g,'');

  if((isNaN(stripped) || stripped.length!=10)&& false){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your phone number appears to have been entered incorrectly. Please re-enter your phone number.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("fax");
  var stripped=e.value.replace(/[\(\)\.\-\ ]/g,'');

  if((isNaN(stripped) || stripped.length!=10)&& false){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your phone number appears to have been entered incorrectly. Please re-enter your phone number.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("email");
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your email address.</p>',findPos(e));
   e.focus();
   return false;
  }
  if (!emailCheck(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your email address appears to have been entered incorrectly. Please re-enter your email address, using the format \"name@domain.com\"</p>',findPos(e));
   e.focus();
   return false;
  }
  if(!validDomain(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your email address appears to have been entered incorrectly. Please re-enter your email address, using the format \"name@domain.com\"</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("city");
  if(e.value.length==0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>The name of your city appears to have been entered incorrectly. Please re-enter the name of your city or town.</p>',findPos(e));
   e.focus();
   return false;
  }
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter the name of your city or town.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("state");
  if(specialChar(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select the state you live in.</p>',findPos(e));
   e.focus();
   return false;
  }
  return true;
 }
 function emailCheck(email){ return /(^[a-z0-9]([a-z0-9_\-\.]*){2,}@([a-z0-9_\-\.]{3,})([.][a-z]{2,6})$)|(^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{3})(\.[a-z]{3})*$)/i.test(email); }
 function validDomain(email){
  var validTLD=new Array("aero","asia","biz","cat","com","coop","edu","gov","info","int","jobs","mil","mobi","museum","name","net","org","pro","tel","travel","ac","ad","ae","af","ag","ai","al","am","an","ao","aq","ar","as","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cc","cd","cf","cg","ch","ci","ck","ch","ci","ck","cl","cm","cn","co","cr","cu","cv","cx","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","io","iq","ir","is","it","je","jm","jo","jp","ke","kg","kh","ki","km","kn","kr","kw","ky","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md", "mg","mh","mk","ml","mm","mn","mo","mp","mq","mr","ms","mt","mu","mv","mw","mx","my","mz","na","nc","ne","nf","ng","ni","nl","no","np","nr","nu","nz","om","pa","pe","pf","pg","ph","pk","pl","pm","pn","pr","ps","pt","pw","py","qa","re","ro","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","st","su","sv","sy","sz","tc","td","tf","tg","th","tj","tk","tl","tm","tn","to","tp","tr","tt","tv","tw","tz","ua","ug","uk","um","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","ye","yt","yu","za","zm","zw");
  for(var i=0; i<validTLD.length; i++){ if(email.substring(email.lastIndexOf(".")+1)==validTLD[i]){ return true; } }
  return false;
 }
 function noNum(s){ return !s.replace(/[^0-9/]/g,"").length>0; }
 function specialChar(s){ return s.replace(/[a-zA-Z/]/g,"").length>0; }
 function maxDays(m,y){return 32-new Date(int(y),int(m)-1,32).getDate();}
 function validateStep2(f){ eraseErrors();
  var e=id("applicantgender");
  var effDate=id("selEffDate").value;
  var currYear=effDate.split("/")[2];
  var currDay=effDate.split("/")[1];
  var currMonth=effDate.split("/")[0];
  var applicantName=id("applicant_name");
  var upperAgeLimit = 65;
  var today = new Date();
  if(applicantName!=null && applicantName.value=="Child"){
   upperAgeLimit = 18;
   spouse = false;
  }
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your gender.</p>',findPos(e));
   e.focus();
   return false;
  }
  var month=id("applicantdobMM");
  if(month.value.length<1 || isNaN(month.value) || int(month.value)<1 || int(month.value)>12){
   drawError(month.name,'<h3>Oh no!<br />What happened?</h3><p>Your date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(month));
   month.value="";
   month.focus();
   return false;
  }
  var day=id("applicantdobDD");
  if(day.value.length<1 || isNaN(day.value) || int(day.value)<1 || int(day.value)>maxDays(id("applicantdobMM").value,id("applicantdobYYYY").value)){
   drawError(day.name,'<h3>Oh no!<br />What happened?</h3><p>Your date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(day));
   day.value="";
   day.focus();
   return false;
  }
  e=id("applicantdobYYYY");
  if(e.value.length<4 || isNaN(e.value) || int(e.value)<(int(currYear)-100) || int(e.value)>int(currYear)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
  if(dateDifference(month.value,day.value,e.value,currMonth,currDay,currYear)>=upperAgeLimit){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Individual products are only available to those under the age of '+upperAgeLimit+'.</p>',findPos(e));
   return false;
  }

  if(dateDifference(month.value,day.value,e.value,today.getMonth()+1,today.getDate(),today.getFullYear())<0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>You have entered a birthdate that is in the future.   Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 08/20/1970</p>',findPos(e));
   return false;
  }

  e=id("applicantheight_ft");
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your height in feet and inches.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("applicantheight_in");
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your height in feet and inches.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("applicantweight");
  if(e.value=="" || isNaN(e.value) || int(e.value)<1 || e.value.indexOf(".") > 0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your weight in pounds.\nExample: 200</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
  e=id("applicantweight");
  if(isNaN(e.value) || int(e.value)<1 || e.value.indexOf(".") > 0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your weight in pounds.\nExample: 200</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
  if(spouse){
   e=id("spousegender");
  if(specialChar(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your spouse\'s gender.</p>',findPos(e));
   e.focus();
   return false;
  }
  month=id("spousedobMM");
  if(month.value.length<1 || isNaN(month.value) || int(month.value)<1 || int(month.value)>12){
   drawError(month.name,'<h3>Oh no!<br />What happened?</h3><p>Your spouse\'s date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(month));
   month.value="";
   month.focus();
   return false;
  }
  day=id("spousedobDD");
  if(day.value.length<1 || isNaN(day.value) || int(day.value)<1 || int(day.value)>maxDays(id("spousedobMM").value,id("spousedobYYYY").value)){
   drawError(day.name,'<h3>Oh no!<br />What happened?</h3><p>Your spouse\'s date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(day));
   day.value="";
   day.focus();
   return false;
  }
  e=id("spousedobYYYY");
  if(e.value.length<4 || isNaN(e.value) || int(e.value)<(int(currYear)-100) || int(e.value)>int(currYear)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your spouse\'s date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
   if(dateDifference(month.value,day.value,e.value,currMonth,currDay,currYear)>=upperAgeLimit){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Individual products are only available to those under the age of '+upperAgeLimit+'.</p>',findPos(e));
   return false;
  }
    if(dateDifference(month.value,day.value,e.value,today.getMonth()+1,today.getDate(),today.getFullYear())<0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>You have entered a birthdate that is in the future.   Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 08/20/1970</p>',findPos(e));
   return false;
  }
    e=id("spouseheight_ft");
  if(e.value=="") {
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your spouse\'s height in feet and inches.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("spouseheight_in");
  if(e.value=="") {
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your spouse\'s height in feet and inches.</p>',findPos(e));
   e.focus();
   return false;
  }
    e=id("spouseweight");
  if(e.value=="" || isNaN(e.value) || int(e.value)<1 || e.value.indexOf(".") > 0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your spouse\'s weight in pounds.\nExample: 200</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
    e=id("spouseweight");
  if(isNaN(e.value) || int(e.value)<1 || e.value.indexOf(".") > 0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your spouse\'s weight in pounds.\nExample: 200</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
   }
  for(var i=1; i<=child; i++){
   var e=id(eval("'dependent"+i+"gender'"));
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your dependent\'s gender.</p>',findPos(e));
   e.focus();
   return false;
  }
  month=id(eval("'dependent"+i+"dobMM'"));
  if(month.value.length<1 || isNaN(month.value) || int(month.value)<1 || int(month.value)>12){
   drawError(month.name,'<h3>Oh no!<br />What happened?</h3><p>Your dependent\'s date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(month));
   month.value="";
   month.focus();
   return false;
  }
  day=id(eval("'dependent"+i+"dobDD'"));
  if(day.value.length<1 || isNaN(day.value) || int(day.value)<1 || int(day.value)>maxDays(id(eval("'dependent"+i+"dobMM'")).value,id(eval("'dependent"+i+"dobYYYY'")).value)){
   drawError(day.name,'<h3>Oh no!<br />What happened?</h3><p>Your dependent\'s date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(day));
   day.value="";
   day.focus();
   return false;
  }
  e=id(eval("'dependent"+i+"dobYYYY'"));
  if(e.value.length<4 || isNaN(e.value) || int(e.value)<(int(currYear)-100) || int(e.value)>int(currYear)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your dependent\'s date of birth appears to have been entered incorrectly. Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 8/20/1970</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
  
   if(dateDifference(month.value,day.value,e.value,today.getMonth()+1,today.getDate(),today.getFullYear())<0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>You have entered a birthdate that is in the future.   Please re-enter your date of birth, using the format "Month, Day, Year."\nExample: 08/20/1970</p>',findPos(e));
   return false;
  }
    e=id(eval("'dependent"+i+"height_ft'"));
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your dependent\'s height in feet and inches.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id(eval("'dependent"+i+"height_in'"));
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please select your dependent\'s height in feet and inches.</p>',findPos(e));
   e.focus();
   return false;
  }
    e=id(eval("'dependent"+i+"weight'"));
  if(e.value=="" || isNaN(e.value) || int(e.value)<1 || e.value.indexOf(".") > 0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your dependent\'s weight in pounds.\nExample: 200</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
    e=id(eval("'dependent"+i+"weight'"));
  if(isNaN(e.value) || int(e.value)<1 || e.value.indexOf(".") > 0){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your dependent\'s weight in pounds.\nExample: 200</p>',findPos(e));
   e.value="";
   e.focus();
   return false;
  }
   }
  showGenQuotes();
  setTimeout('id("progressbar").src=id("progressbar").src',200);
 return true;
 }
 function validateEmailQuote(f){ eraseErrors();
  var e=id("name");
  if(!noNum(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your first name appears to have been entered incorrectly. Please re-enter your name.</p>',findPos(e));
   e.focus();
   return false;
  }
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your name.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("email");
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter your email address.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("email");
  if(!emailCheck(e.value) || !validDomain(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your email address appears to have been entered incorrectly. Please re-enter your email address, using the format \"name@domain.com\"</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("to_name");
  if(!noNum(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Your first name appears to have been entered incorrectly. Please re-enter your name.</p>',findPos(e));
   e.focus();
   return false;
  }
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter the recipient\'s name.</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("to_email");
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter the recipient\'s email address.</p>',findPos(e));
   e.focus();
   return false;
  }
  if(!emailCheck(e.value) || !validDomain(e.value)){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>The recipient\'s email address appears to have been entered incorrectly. Please re-enter it, using the format \"name@domain.com\"</p>',findPos(e));
   e.focus();
   return false;
  }
  e=id("subject");
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter the email subject.</p>',findPos(e));
   e.focus();
   return false;
  }
  /*e=id("text");
  if(e.value==""){
   drawError(e.name,'<h3>Oh no!<br />What happened?</h3><p>Please enter an email message.</p>',findPos(e));
              e.focus();
              return false;
  }*/
   return formSubmissionCheck();
 }
 function showGenQuotes(v){
  var bg=id("quote-engine");
  var d=id("loadingDiv");
  d.innerHTML='<img id="progressbar" src="https://www.brokeroffice.com/quote/interface/images/progress-bar.gif" alt="" /><h3>Finding Plans</h3>';
  setOpacity(bg,33);
  d.style.left=(findPos(bg)[0]+122)+"px";
  var h = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
  d.style.top= (screen.height/4 + h) + 'px';
  d.style.display="block";
 }
 function setOpacity(e,o){
  o=(o==100 && (navigator.userAgent.indexOf('Gecko')!=-1 && navigator.userAgent.indexOf('Safari')==-1))?99.99:o;
  e.style.opacity=e.style.MozOpacity=e.style.KhtmlOpacity=o/100;
  e.style.filter='alpha(opacity='+o+')';
 }
 function id(e){ return document.getElementById(e); }
 function tag(e){ return document.getElementsByTagName(e); }
 function int(v){ return parseInt(v,10); }
 function cE(e){ return document.createElement(e); }
 function applyNow(url) { 
  var form = id("applyForm"); 
  form.formAction.value=url;
    form.submit();
 }
 function modifyPerson(person,gender,dobMM,dobDD,dobYYYY,height_ft,height_in,weight,smoker,student){
  var f=new Array("gender","dobMM","dobDD","dobYYYY","height_ft","height_in","weight","smoker","student");
  var v=new Array(gender,dobMM,dobDD,dobYYYY,height_ft,height_in,weight,smoker,student);
  person+=(person=='dependent')?child:"";
  for(var i=0; i<f.length; i++){ if(v[i]!=null || v[i]!=""){ prefill(person+f[i],v[i]); } }
 }
 function prefill(e,v){
  if(id(e)!=null && id(e).type!=null){ e=id(e);
   switch(e.type){
    case "select-one":for(var j=0; j<e.options.length; j++){ if(e.options[j].text==v){ e.options[j].selected=true;break; }}break;
    default:e.value=v;break;
   }
  }
 }
 if(window.location.href.indexOf("/quote/detailInformation")>0){
 addLoadEvent(function(){ 
    });}
var _unloadPage = true;
window.onbeforeunload = function () {
 if(_unloadPage){
  return "Please use the navigation links on the page."
 }
}

function disableOnBeforeUnload(){
 _unloadPage = false;
}

function formSubmissionCheck(){
 disableOnBeforeUnload();
 return true;
}

function formSubmit(formId){
 var form = id(formId);
 if(formSubmissionCheck()){
  form.submit();
 }
}

addLoadEvent(function(){
 var el=tag('a');
 for(var i=0;i<el.length;i++){
  el[i].onclick=new Function("disableOnBeforeUnload();");
 }
});
 addLoadEvent(function(){ if(id("poweredByNorvaxDiv")!=null){var e=id("poweredByNorvaxLinks"); if(e!=null){ e.style.display="none"; } } });
/* ]]&amp; */

function writeHTML() {
	var str = '<div id="norvaxEmbeddedContainer"><link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" href="https://www.brokeroffice.com/quote/interface/styles-scripts/qe-style.css" type="text/css"></link><div xmlns="http://www.w3.org/1999/xhtml" align="center" style="width:100%;"> <form name="step1" method="POST" action="http://www.brokeroffice.com/quoteengine?embedded=true" style="margin:0; padding:0;" onsubmit="return formSubmissionCheck()"> <input name="formAction" id="formAction" type="hidden" value="/quote/detailInformation"></input>  <div id="quote-engine">  <div id="qe-breadcrumbs">   <ul>    <li class="qe-bc-1-on"> </li>     <li class="qe-bc-on selected">1. Basic Information</li>     <li class="qe-bc-on-off"> </li>     <li class="qe-bc">2. Personal Profile</li>     <li class="qe-bc-off-off"> </li>     <li class="qe-bc">3. View Plans</li>     <li class="qe-bc-off-off"> </li>     <li class="qe-bc">4. Apply Today</li>     <li class="qe-bc-off"> </li>    </ul>   </div>   <div class="qe-shell-top"> </div>   <div class="qe-shell-bg">   <div class="basic-info">    <h3>Basic Information</h3>     <p>Please enter your basic information for your free health quote.</p>    </div>    <div id="errors" class="errors">  </div>   <div class="plans-by-zip">    <p class="left"><strong><em>*</em> Zip Code:</strong>   <input name="zip" id="zip" value="" maxlength="5" align="bottom" style="width:70px;"></input> </p>    </div>    <div class="gap"> </div>    <div class="sub-shell-top"> </div>    <div class="sub-shell-bg">   <div class="insurance-type">    <h3>Insurance Type</h3>        <p><input name="insuranceType" id="insuranceType_1" type="radio" value="INDIVIDUAL" checked="checked"></input>  Individual and Family Insurance     <img src="https://www.brokeroffice.com/quote/interface/images/qe-questionmark.gif" border="0" alt="" help="Select this option for Individual and Family Insurance; this typically includes a primary applicant between the ages of 18-64. With this option you can add a spouse and children to your quote as well."></img> </p>     <p><input name="insuranceType" id="insuranceType_2" type="radio" value="CHILD"></input>  Child Only Insurance     <img src="https://www.brokeroffice.com/quote/interface/images/qe-questionmark.gif" border="0" alt="" help="Select this option for Child only Insurance; this typically includes a primary applicant under the age of 18. With this option you can add additional children to your quote as well."></img> </p>          </div>   </div>   <div class="sub-shell-bottom"> </div>   <div class="gap"> </div>   <div class="sub-shell-top"> </div>    <div class="sub-shell-bg">    <div class="applicant">     <h3>Applicant</h3>                                                                                                                                                                                                                                                                                                                                                             <table align="center" width="488" cellpadding="2" cellspacing="2" border="0"><tbody><tr><td align="right" nowrap="nowrap" width="84">                 <em>*</em>                  First Name:</td> <td width="160"><input style="width:120px;" name="firstName" id="firstName" value=""></input> </td> <td align="right" nowrap="nowrap" width="108">                 <em>*</em>                  Last Name:</td> <td width="140"><input style="width:120px;" name="lastName" id="lastName" value=""></input> </td> </tr> <tr><td align="right" nowrap="nowrap" width="84">                 <em> </em>                  Phone:</td> <td width="160"><input style="width:120px;" name="work_phone" id="work_phone" value=""></input> </td> <td align="right" nowrap="nowrap" width="108">                 <em> </em>                  Fax:</td> <td width="140"><input style="width:120px;" name="fax" id="fax" value=""></input> </td> </tr> <tr><td align="right" nowrap="nowrap" width="84">                 <em>*</em>                  Email:</td> <td width="160"><input style="width:120px;" name="email" id="email" value=""></input> </td> <td align="right" nowrap="nowrap" width="108">                 <em> </em>                  Referred By:</td> <td width="140"><select name="how_hear" id="how_hear" style="width:120px;"><option value=""> </option> <option value="Search Engine">Search Engine</option> <option value="Link within an e-mail">Link within an e-mail</option> <option value="Banner ad from another site">Banner ad from another site</option> <option value="Text Link from another site">Text Link from another site</option> <option value="Direct mail">Direct mail</option> <option value="Print Ad">Print Ad</option> <option value="Newspaper Ad">Newspaper Ad</option> <option value="Radio Ad">Radio Ad</option> <option value="Broker">Broker</option> <option value="Employer">Employer</option> <option value="Word of Mouth">Word of Mouth</option> <option value="Yellow Pages">Yellow Pages</option> <option value="Other">Other</option> <option value="" selected="selected"></option> </select>         </td> </tr> <tr></tr> <tr><td align="right" nowrap="nowrap" width="84">                 <em> </em>                  Address 1:</td> <td width="160"><input style="width:120px;" name="address1" id="address1" value=""></input> </td> <td align="right" nowrap="nowrap" width="108"><em> </em>  Address 2:</td> <td width="140"><input style="width:120px;" name="address2" id="address2" value=""></input> </td> </tr> <tr><td align="right" nowrap="nowrap" width="84">                 <em>*</em>                  City:</td> <td width="160"><input style="width:120px;" name="city" id="city" value=""></input> </td> <td align="right" nowrap="nowrap" width="108">                 <em>*</em>                  State:</td> <td width="140"><select name="state" id="state" style="width:51px;"><option value=""> </option> <option value="AL">AL</option> <option value="AK">AK</option> <option value="AZ">AZ</option> <option value="AR">AR</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DE">DE</option> <option value="DC">DC</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option> <option value="ID">ID</option> <option value="IL">IL</option> <option value="IN">IN</option> <option value="IA">IA</option> <option value="KS">KS</option> <option value="KY">KY</option> <option value="LA">LA</option> <option value="ME">ME</option> <option value="MD">MD</option> <option value="MA">MA</option> <option value="MI">MI</option> <option value="MN">MN</option> <option value="MS">MS</option> <option value="MO">MO</option> <option value="MT">MT</option> <option value="NE">NE</option> <option value="NV">NV</option> <option value="NH">NH</option> <option value="NJ">NJ</option> <option value="NM">NM</option> <option value="NY">NY</option> <option value="NC">NC</option> <option value="ND">ND</option> <option value="OH">OH</option> <option value="OK">OK</option> <option value="OR">OR</option> <option value="PA">PA</option> <option value="RI">RI</option> <option value="SC">SC</option> <option value="SD">SD</option> <option value="TN">TN</option> <option value="TX">TX</option> <option value="UT">UT</option> <option value="VT">VT</option> <option value="VA">VA</option> <option value="WA">WA</option> <option value="WV">WV</option> <option value="WI">WI</option> <option value="WY">WY</option> </select>         </td> </tr> </tbody> </table>      <p class="right-message"><em>*</em>  - Required Field</p>     </div>    </div>    <div class="sub-shell-bottom"> </div>    <div class="gap"> </div>    <div class="gap"> </div>   </div>   <div class="qe-shell-bottom"> </div>   <div class="qe-button"><input align="middle" type="image" src="https://www.brokeroffice.com/quote/interface/images/qe-btn-next-step.gif" onclick="return validateStep1(this.form);"></input> </div>  </div>   </form>  <div class="poweredByNorvax">  <p>Norvax form #Q-1a</p>   <p id="poweredByNorvaxLinks"><a target="_blank" href="http://www.norvax.com/products/quote_engine.html">Insurance Quote Engine by Norvax</a> </p>  </div>  <div id="errors"></div>  </div> </div>';
	document.write(str);
}
writeHTML();
