var processingJoin=false;function joinOnLoad()
{top.frames.mainFrame.document.submitform.gender.focus();}
function join_submitenter(myfield,e,fName)
{try
{if(fName=="gender")
{if(top.frames.mainFrame.checkGender())
{top.frames.mainFrame.document.submitform.screenName.focus();}
return;}
if(fName=="country")
{if(top.frames.mainFrame.checkCountry())
{top.frames.mainFrame.document.submitform.zip.focus();}
return;}
if(fName=="whoToThank")
{if(top.frames.mainFrame.document.submitform.whoToThank.options[7].selected)
{var stwhoToThankSpecifyTitleDiv=top.frames.mainFrame.document.getElementById('id_whoToThankSpecifyTitleDiv');if(stwhoToThankSpecifyTitleDiv!=null)
{$(stwhoToThankSpecifyTitleDiv).show();}
var stwhoToThankSpecifyDiv=top.frames.mainFrame.document.getElementById('id_whoToThankSpecifyDiv');if(stwhoToThankSpecifyDiv!=null)
{$(stwhoToThankSpecifyDiv).show();top.frames.mainFrame.document.submitform.whoToThankSpecify.focus();}}
else
{var stwhoToThankSpecifyTitleDiv=top.frames.mainFrame.document.getElementById('id_whoToThankSpecifyTitleDiv');if(stwhoToThankSpecifyTitleDiv!=null)
{$(stwhoToThankSpecifyTitleDiv).hide();}
var stwhoToThankSpecifyDiv=top.frames.mainFrame.document.getElementById('id_whoToThankSpecifyDiv');if(stwhoToThankSpecifyDiv!=null)
{$(stwhoToThankSpecifyDiv).hide();}
top.frames.mainFrame.document.submitform.whoToThank.focus();}
return;}
var thiskeycode;if(window.event)
{thiskeycode=window.event.keyCode;}
else if(e)
{thiskeycode=e.which;}
else
{return true;}
if(thiskeycode==13)
{if(fName=="screenName")
{if(top.frames.mainFrame.checkScreenName())
{top.frames.mainFrame.document.submitform.email.focus();}
return;}
if(fName=="email")
{if(top.frames.mainFrame.checkEmailAddress())
{top.frames.mainFrame.document.submitform.country.focus();}
return;}
if(fName=="zip")
{if(top.frames.mainFrame.checkZip())
{top.frames.mainFrame.document.submitform.month.focus();}
return;}}
else
{return true;}}
catch(ee){}
validate();}
function validate()
{if(top.frames.mainFrame.checkGender()&&top.frames.mainFrame.checkScreenName()&&top.frames.mainFrame.checkEmailAddress()&&top.frames.mainFrame.checkCountry()&&top.frames.mainFrame.checkZip()&&top.frames.mainFrame.checkMonth()&&top.frames.mainFrame.checkDay()&&top.frames.mainFrame.checkYear()&&top.frames.mainFrame.checkAgree())
{if(processingJoin)
{return;}
var errorDiv=document.getElementById('id_errorDiv');if(errorDiv!=null)
{errorDiv.innerHTML="";}
var registerDiv=document.getElementById('id_register');if(registerDiv!=null)
{registerDiv.innerHTML="<div align='center' class='slgray'>Give us just a second while we get this going for you...<br><img src='"+fileUrl+"/images/common/loading.gif' border='0'></div>";}
processingJoin=true;var myRequest=new ajaxObject();myRequest.callback=function(responseText,responseStatus,responseXML)
{if(responseStatus=200)
{var status;var message;try{eval(responseText);}catch(e){}
if(status==1)
{var joinDiv=document.getElementById('id_joinDiv');if(joinDiv!=null)
{joinDiv.innerHTML="<br><br><br><br><br><br>\n"+"<table align='center'>\n"+"  <tr>\n"+"    <td>\n"+"      <div class='tip'><font class='bmgray'>Thank you for joining <font color='#CC0033'>Date</font><font color='#FF9900'>Raters</font>!<br>We're hooking you up with a password and then you'll be ready to log in.<br><br>A confirmation email will be sent to you with this info shortly (pretty much now, check your email!)</font></div>\n"+"    </td>\n"+"  </tr>\n"+"</table>\n"+"<br><br><br><br><br><br>";}}
else if(status==-3)
{var errorDiv=document.getElementById('id_screenNameError');if(errorDiv!=null)
{errorDiv.innerHTML="<div class='alert_noimg'>Sorry, but the Screen Name you selected is already being used by another DateRater!<br>Please choose another one.</div>";}}
else if(status==-4)
{var errorDiv=document.getElementById('id_emailError');if(errorDiv!=null)
{errorDiv.innerHTML="<div class='alert_noimg'>Sorry, but the Email Address you selected is already being used!<br>Try to use the <a href='forgotPassword.html' class='sblue'>Forgot Password</a> feature!</div>";}}
else
{var errorDiv=document.getElementById('id_errorDiv');if(errorDiv!=null)
{errorDiv.innerHTML="<div class='alert_noimg'>"+getGenericErrorMessage()+"</div><br>";}}}
else
{var errorDiv=document.getElementById('id_errorDiv');if(errorDiv!=null)
{errorDiv.innerHTML="<div class='alert_noimg'>"+getGenericErrorMessage()+"</div><br>";}}
var registerDiv=document.getElementById('id_register');if(registerDiv!=null)
{registerDiv.innerHTML="<img src='../images/join/register.gif' width='75' height='25' border='0' onClick='validate();' style='cursor:pointer;cursor:hand;'>";}
processingJoin=false;}
var app='app=join';var gender='';if(document.submitform.gender.options[1].selected)
{gender='Gender=Male';}
else if(document.submitform.gender.options[2].selected)
{gender='Gender=Female';}
var screenName='screenName='+encode(document.submitform.screenName.value);var emailAddress='email='+encode(document.submitform.email.value);var country='';var myOptions=top.frames.mainFrame.document.submitform.country.options;for(var cNum=0;cNum<myOptions.length;cNum++)
{if(myOptions[cNum].selected)
{country='Country='+encode(myOptions[cNum].value);break;}}
var zip='Zip='+encode(document.submitform.zip.value);var month=document.submitform.month.value;var day=document.submitform.day.value;var year=document.submitform.year.value;var birthday='Birthday='+encode(year+'-'+month+'-'+day);var whoToThank='';var myOptions=top.frames.mainFrame.document.submitform.whoToThank.options;for(var cNum=0;cNum<myOptions.length;cNum++)
{if(myOptions[cNum].selected)
{whoToThank='WhoToThank='+encode(myOptions[cNum].value);if(myOptions[cNum].value='Other')
{whoToThank+='&WhoToThankSpecify='+encode(document.submitform.whoToThankSpecify.value);}
break;}}
var sendString=app+'&'+gender+'&'+screenName+'&'+emailAddress+'&'+country+'&'+zip+'&'+birthday+'&'+whoToThank;myRequest.update(sendString,'POST');}}
function checkGender()
{if(top.frames.mainFrame.document.submitform.gender.options[0].selected)
{var errorSpan=top.frames.mainFrame.document.getElementById("id_genderError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure gender is selected!</div>";return false;}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_genderError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}
function checkScreenName()
{if(top.frames.mainFrame.document.submitform.screenName.value=="")
{var errorSpan=top.frames.mainFrame.document.getElementById("id_screenNameError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you choose your Screen Name!</div>";return false;}}
else
{var errorSpan=top.frames.mainFrame.document.getElementById("id_screenNameError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}}
function checkEmailAddress()
{var currEmail=top.frames.mainFrame.document.submitform.email.value;if(currEmail!="")
{if(!utilEmailCheck(currEmail))
{var errorSpan=top.frames.mainFrame.document.getElementById("id_emailError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure your Email Address is correct!</div>";return false;}}}
else
{var errorSpan=top.frames.mainFrame.document.getElementById("id_emailError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you enter your Email Address!</div>";return false;}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_emailError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}
function checkCountry()
{if(top.frames.mainFrame.document.submitform.country.options[0].selected)
{var errorSpan=top.frames.mainFrame.document.getElementById("id_countryError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure country is selected!</div>";return false;}}
var requiredDiv=top.frames.mainFrame.document.getElementById("id_zipRequired");if(requiredDiv!=null)
{requiredDiv.innerHTML="";var myOptions=top.frames.mainFrame.document.submitform.country.options;for(var cNum=0;cNum<myOptions.length;cNum++)
{if(myOptions[cNum].selected)
{if((myOptions[cNum].value=="United States of America")||(myOptions[cNum].value=="Canada"))
{requiredDiv.innerHTML="*";}
break;}}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_countryError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}
function checkZip()
{var currZip=top.frames.mainFrame.document.submitform.zip.value;if(currZip=="")
{if(top.frames.mainFrame.document.submitform.country.options[0].selected)
{return true;}
else
{var myOptions=top.frames.mainFrame.document.submitform.country.options;for(var cNum=0;cNum<myOptions.length;cNum++)
{if(myOptions[cNum].selected)
{if(myOptions[cNum].value=="United States of America")
{var errorSpan=top.frames.mainFrame.document.getElementById("id_zipError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you enter your zip!</div>";return false;}}
if(myOptions[cNum].value=="Canada")
{var errorSpan=top.frames.mainFrame.document.getElementById("id_zipError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you enter your postal code!</div>";return false;}}
break;}}}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_zipError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}
function checkMonth()
{if(top.frames.mainFrame.document.submitform.month.options[0].selected)
{var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you select your birthday!</div>";return false;}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}
function checkDay()
{if(top.frames.mainFrame.document.submitform.day.options[0].selected)
{var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you select your birthday!</div>";return false;}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}
function checkYear()
{if(top.frames.mainFrame.document.submitform.year.options[0].selected)
{var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you select your birthday!</div>";return false;}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="";return true;}}
function checkAgree()
{if(top.frames.mainFrame.document.submitform.hidden_agree.value!='true')
{var errorSpan=top.frames.mainFrame.document.getElementById("id_agreeError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Please make sure you confirm that you are at least 18 years old and<br>have read and agreed to DateRaters' Terms of Use and Privacy Policy.</div>";return false;}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_agreeError");if(errorSpan!=null)
{errorSpan.innerHTML="";}
var bday=parseInt(document.submitform.day.value);var bmo=parseInt(document.submitform.month.value);var byr=parseInt(document.submitform.year.value);var byr;var age;var now=new Date();tday=now.getDate();tmo=(now.getMonth());tyr=(now.getFullYear());{if((tmo>bmo)||(tmo==bmo&tday>=bday))
{age=byr}
else
{age=byr+1}}
if((tyr-age)<18)
{var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="<div class='alert_noimg'>Hey, you're just a youngin'!<br>Put us in your faves and check back in when you're 18.</div>";return false;}}
var errorSpan=top.frames.mainFrame.document.getElementById("id_dateOfBirthError");if(errorSpan!=null)
{errorSpan.innerHTML="";}
return true;}
var currGender='';function showSlide(pSlide)
{if(!infoVerified(pSlide))
{updateNav(pSlide,false);return;}
var gender=$('#id_hidden_gender').val();if(currGender!=gender)
{$('.index_slide_text').removeClass('index_slide_text_her').removeClass('index_slide_text_him').addClass('index_slide_text_'+gender);currGender=gender;}
for(var s=1;s<8;s++)
{if(s!=pSlide)
{$('#id_index_slide'+s).hide();}}
$('#id_index_slide'+pSlide).removeClass('index_slide'+pSlide+'_her').removeClass('index_slide'+pSlide+'_him').addClass('index_slide'+pSlide+'_'+gender).show();updateNav(pSlide,true);}
function updateNav(pSlide,pInfoVerified)
{if(!pInfoVerified)
{$('#id_index_slide1_nav').hide();var error_text="C'mon, don't leave us hangin'. Make a selection!";if(pSlide==4)
error_text="Oops, looks like you forgot to make a selection!";else if(pSlide==5)
error_text="What, no selection? You know you want to tell us!";else if(pSlide==6)
error_text="Please don't make us guess! Make a selection!";else if(pSlide==7)
{var emailEntered=$('#id_email').val();if(emailEntered=='')
{error_text="We need your Email Address to send confirmation!";}
else if(!utilEmailCheck(emailEntered))
{error_text="We need your Email Address to send confirmation!";}
else
{error_text="You have to be at least 18 years old to join!";}}
var nav_div=$('#id_index_generic_nav').empty();$(document.createElement("div")).addClass("index_slide_error").append("<div class='index_errorMessage'>"+error_text+"</div>\n").append("<div class='index_nav_continue clickable' onClick='showSlide("+pSlide+");'></div>\n").appendTo(nav_div).show();return;}
if(pSlide==1)
{$('#id_index_generic_nav').hide();$('#id_index_slide1_nav').show();}
else
{$('#id_index_slide1_nav').hide();$('#id_index_generic_nav').addClass('index_nav'+pSlide).show();}
var nav_div=$('#id_index_generic_nav').empty();for(var s=1;s<pSlide;s++)
{if(s<pSlide)
nav_div.append("<div class='index_nav_back"+s+" clickable' onClick='showSlide("+s+");'></div>\n");}
if(pSlide<7)
nav_div.append("<div class='index_nav_continue clickable' onClick='showSlide("+(pSlide+1)+");'></div>\n");else
nav_div.append("<div class='index_nav_continue clickable' onClick='doJoin();'></div>\n");}
function highlightLinks()
{$('#id_index_slide1_her_link').animate({fontSize:"18px"},200).animate({fontSize:"15px"},200);setTimeout("highlightLinks2()",300);}
function highlightLinks2()
{$('#id_index_slide1_him_link').animate({fontSize:"18px"},200).animate({fontSize:"15px"},200);}
function infoVerified(pSlide)
{var retVal=true;if(pSlide==3)
{if($('input:radio[name=loveLife]:checked').val()==undefined)
{$('#id_loveLive_div').addClass('c_darkRed');retVal=false;}
else
{$('#id_loveLive_div').removeClass('c_darkRed');}}
if(pSlide==4)
{if(($('#id_onSite option:selected').text()=='')||($('#id_onSite option:selected').text()=='- Pick One -'))
{$('#id_onSite').addClass('c_darkRed');retVal=false;}
else
{$('#id_onSite').removeClass('c_darkRed');}
if($('#id_screenName').val()=='')
{$('#id_datingSite_div').addClass('c_darkRed');retVal=false;}
else
{$('#id_datingSite_div').removeClass('c_darkRed');}}
if(pSlide==5)
{var monthSelected=$('#id_month option:selected').text();if((monthSelected=='')||(monthSelected=='- Month -'))
{$('#id_month').addClass('c_darkRed');retVal=false;}
else
{$('#id_month').removeClass('c_darkRed');}
var daySelected=$('#id_day option:selected').text();if((daySelected=='')||(daySelected=='- Day -'))
{$('#id_day').addClass('c_darkRed');retVal=false;}
else
{$('#id_day').removeClass('c_darkRed');}
var yearSelected=$('#id_year option:selected').text();if((yearSelected=='')||(yearSelected=='- Year -'))
{$('#id_year').addClass('c_darkRed');retVal=false;}
else
{$('#id_year').removeClass('c_darkRed');}
if(retVal!=false)
{var bday=parseInt(daySelected);var bmo=parseInt(monthSelected);var byr=parseInt(yearSelected);var byr;var age;var now=new Date();tday=now.getDate();tmo=(now.getMonth());tyr=(now.getFullYear());{if((tmo>bmo)||(tmo==bmo&tday>=bday))
{age=byr}
else
{age=byr+1}}
if((tyr-age)<18)
{$('#id_index_slide4').hide();$('#id_index_generic_nav').hide();$('#id_index_tooYoung').removeClass('index_tooYoung_her').removeClass('index_tooYoung_him').addClass('index_tooYoung_'+$('#id_hidden_gender').val()).show();retVal=false;}}}
if(pSlide==6)
{if($('#id_city').val()=='')
{$('#id_city_div').addClass('c_darkRed');retVal=false;}
else
{$('#id_city_div').removeClass('c_darkRed');}
var countrySelected=$('#id_country option:selected').val();if((countrySelected=='')||(countrySelected=='- Country -'))
{$('#id_country').addClass('c_darkRed');$('#id_country_div').addClass('c_darkRed');retVal=false;}
else
{$('#id_country').removeClass('c_darkRed');$('#id_country_div').removeClass('c_darkRed');}
if(((countrySelected=='United States of America')||(countrySelected=='Canada'))&&($('#id_zip').val()==''))
{$('#id_zip_div').addClass('c_darkRed');retVal=false;}
else
{$('#id_zip_div').removeClass('c_darkRed');}}
if(pSlide==7)
{var emailEntered=$('#id_email').val();if(emailEntered=='')
{$('#id_email_div').addClass('c_darkRed');$('#id_email').addClass('c_darkRed');retVal=false;}
else if(!utilEmailCheck(emailEntered))
{$('#id_email_div').addClass('c_darkRed');$('#id_email').addClass('c_darkRed');retVal=false;}
else
{$('#id_email_div').removeClass('c_darkRed');$('#id_email').removeClass('c_darkRed');}
if($('input:checkbox[name=agree]:checked').val()==undefined)
{$('#id_agree_div').addClass('c_darkRed');retVal=false;}
else
{$('#id_agree_div').removeClass('c_darkRed');}}
return retVal;}
function slide3_removeClass()
{$('#id_onSite').removeClass('c_darkRed');updateNav(3,true);}
function slide5_removeClass()
{$('#id_country_div').removeClass('c_darkRed');$('#id_country').removeClass('c_darkRed');updateNav(5,true);}
function slide7_showSpecify()
{var whoToThankSelected=$('#id_whoToThank option:selected').text();if(whoToThankSelected=='Other')
{$('#id_whoToThank_specify_div').show();}
else
{$('#id_whoToThank_specify_div').hide();}}
function doJoin()
{$('#id_index_slide7').hide();$('#id_index_nav').hide();$('#id_index_thankYou').removeClass('index_thankYou_her').removeClass('index_thankYou_him').addClass('index_thankYou_'+$('#id_hidden_gender').val()).show();doJoin_process();}
function doJoin_process()
{if(processingJoin)
{return;}
processingJoin=true;var myRequest=new ajaxObject();myRequest.callback=function(responseText,responseStatus,responseXML)
{if(responseStatus=200)
{var status;var message;try{eval(responseText);}catch(e){}
if(status==1)
{$('#id_index_thankYou_area').empty().append("<div class='index_slide_text index_slide_text_"+$('#id_hidden_gender').val()+"'>Thank you for joining DateRaters!</div>").append("<div class='index_slide_text index_slide_text_smaller index_slide_text_"+$('#id_hidden_gender').val()+"'>We're hooking you up with a password and then you'll be ready to log in.<br><br>A confirmation email will be sent to you with this info shortly (pretty much now, check your email!)</div>");}
else if(status==-3)
{$('#id_index_thankYou').removeClass('index_thankYou_her').removeClass('index_thankYou_him').addClass('index_thankYou_her');$('#id_index_thankYou_area').empty().append("<div class='index_slide_text index_slide_text_her'>Sorry, but the Screen Name you selected is already being used by another DateRater!<br>Please choose another one.</div>");var error_text="Please choose another Screen Name!";var nav_div=$('#id_index_generic_nav').empty();$(document.createElement("div")).addClass("index_slide_error_ok").append("<div class='index_errorMessage'>"+error_text+"</div>\n").append("<div class='index_nav_continue clickable' onClick='showSlide(3);'></div>\n").appendTo(nav_div).show();}
else if(status==-4)
{$('#id_index_thankYou').removeClass('index_thankYou_her').removeClass('index_thankYou_him').addClass('index_thankYou_her');$('#id_index_thankYou_area').empty().append("<div class='index_slide_text index_slide_text_her'>Sorry, but the Email Address you selected is already being used!<br><br>Try to use the <a href='forgotPassword.html' class='c_darkRed'><u>Forgot Password</u></a> feature!</div>");}
else
{$('#id_index_thankYou').removeClass('index_thankYou_her').removeClass('index_thankYou_him').addClass('index_thankYou_her');$('#id_index_thankYou_area').empty().append("<div class='index_slide_text index_slide_text_her'>"+getGenericErrorMessage()+"</div>");}}
else
{$('#id_index_thankYou').removeClass('index_thankYou_her').removeClass('index_thankYou_him').addClass('index_thankYou_her');$('#id_index_thankYou_area').empty().append("<div class='index_slide_text index_slide_text_her'>"+getGenericErrorMessage()+"</div>");}
processingJoin=false;}
var app='app=join';var gender=$('#id_hidden_gender').val();if(gender=='her')
gender='Gender=Female';else
gender='Gender=Male';var loveLife='loveLife='+encode($('input:radio[name=loveLife]:checked').val());var screenName='screenName='+encode($('#id_screenName').val());var onSite='onSite='+encode($('#id_onSite option:selected').text());var emailAddress='email='+encode($('#id_email').val());var city='City='+encode($('#id_city').val());var country='Country='+encode($('#id_country option:selected').val());var zip='Zip='+encode($('#id_zip').val());var month=$('#id_month option:selected').val();var day=$('#id_day option:selected').val();var year=$('#id_year option:selected').val();var birthday='Birthday='+encode(year+'-'+month+'-'+day);var whoToThank='WhoToThank='+encode($('#id_whoToThank option:selected').text())+'&WhoToThankSpecify='+encode($('#id_whoToThank_specify').val());var sendString=app+'&'+gender+'&'+screenName+'&'+onSite+'&'+emailAddress+'&'+city+'&'+country+'&'+zip+'&'+birthday+'&'+whoToThank+'&'+loveLife;myRequest.update(sendString,'POST');}
