var mws={};mws.smsvars={};mws.cssLink="http://mail.yimg.com/us.js.yimg.com/i/us/cl/mob/prtnr/mail/css/mob_mail_sms_1_6.css";mws.btnClose="http://l.yimg.com/us.yimg.com/i/us/cl/mob/prtnr/mail/mail_popup_close_1_1.gif";mws.smsJSON=null;mws.mwsURL="http://webservices."+(window.smsDevServer?window.smsDevServer+".":"")+"mobile.yahoo.com";mws.na_countries=new Array("US","CA","CF","DO","AG","BM","KY","DM","GD","JM","MS","LC","TT","TC");mws.smsCallingApp=null;mws.smsDefaultCountry=null;mws.smsDefaultCountryOrg=null;mws.smsDefaultLanguage=null;mws.smsdiv="mob_sms_box";mws.smsCaptchaPassed=false;mws.smsCaptchaError=false;mws.procSMSForm=function(){var valid_us_num=true;var phone_num="";var phone_num_display="";var selectedIndex=document.getElementById("smsCountryList").selectedIndex;var selectedCC=document.getElementById("smsCountryList").options[selectedIndex].value;var areacode=document.getElementById("areacode").value;var crumb=document.getElementById("_crumb").value;var phonepart1=mws.stripNonNumeric(document.getElementById("phonepart1").value);var phonepart2="";var non_na_number_checked=true;this.resetSMSForm();if(mws.na_countries.in_array(selectedCC)){phonepart2=document.getElementById("phonepart2").value;phone_num=areacode+phonepart1+phonepart2;phone_num_display=areacode+"-"+phonepart1+"-"+phonepart2;if(!areacode.match(/^\d{3}$/)||!phonepart1.match(/^\d{3}$/)||!phonepart2.match(/^\d{4}$/)){valid_us_num=false;}}else{phonepart1=phonepart1.replace(/^0/i,"");phone_num=areacode+phonepart1;phone_num_display="+"+areacode+"-"+phonepart1;non_na_number_checked=mws.nonNANumberCheck(phonepart1);}if(!valid_us_num||isNaN(phone_num)||phone_num==""||!non_na_number_checked){this.showElement("smsError");this.trackBeacon("Error");this.smsResizeWin();}else{if(this.requireCaptcha(this.selectedCountry())&&!this.smsCaptchaPassed){var request=this.mwsURL+"/ni/captcha/captcha.mw?callback=mws.showCaptcha";this.smsJSON=new this.JSONscriptRequest(request);this.smsJSON.buildScriptTag();this.smsJSON.addScriptTag();}else{this.showElement("sms_sending");document.getElementById("smssentnumber").innerHTML=phone_num_display;document.getElementById("smssentnumberv").innerHTML=phone_num_display;var request=this.mwsURL+"/ni/sms/sendSMS.mw?callback=mws.sendSMS&app="+this.smsCallingApp+"&cc="+this.smsDefaultCountry+"&lang="+this.smsDefaultLanguage+"&country="+selectedCC+"&areacode="+areacode+"&phonepart1="+phonepart1+"&phonepart2="+phonepart2+"&crumb="+crumb+"&vz=1";this.smsJSON=new this.JSONscriptRequest(request);this.smsJSON.buildScriptTag();this.smsJSON.addScriptTag();}}};mws.showMailSMSContainer=function(){if(document.getElementById(this.smsdiv)){document.getElementById(this.smsdiv).style.display="block";this.reshowSMSForm();this.resetCountry(this.smsDefaultCountryOrg);document.getElementById("areacode").value="";document.getElementById("phonepart1").value="";if(document.getElementById("phonepart2")){document.getElementById("phonepart2").value="";}if(this.isIE()){this.addIframeShim(document.getElementById(this.smsdiv));}document.getElementById("smsdebug").innerHTML="";this.hideElement("smsdebug");this.trackEVT();this.smsResizeWin();}else{var docHead=document.getElementsByTagName("head")[0];var newLink=document.createElement("link");newLink.setAttribute("rel","stylesheet");newLink.setAttribute("type","text/css");newLink.setAttribute("href",mws.cssLink);docHead.appendChild(newLink);var request=this.mwsURL+"/ni/sms/getSMSParam.mw?callback=mws.mainSMSForm&app="+this.smsCallingApp+"&cc="+this.smsDefaultCountry+"&lang="+this.smsDefaultLanguage;this.smsJSON=new this.JSONscriptRequest(request);this.smsJSON.buildScriptTag();this.smsJSON.addScriptTag();}};mws.showSportSMSContainer=function(){mws.cssLink="http://us.js.yimg.com/i/us/cl/mob/prtnr/sport/css/mob_sport_sms_1_0.css";mws.btnClose="http://us.yimg.com/i/us/cl/mob/prtnr/sport/sport_popup_close_1_1.gif";if(document.getElementById(this.smsdiv)){document.getElementById(this.smsdiv).style.display="block";this.reshowSMSForm();this.resetCountry(this.smsDefaultCountryOrg);document.getElementById("areacode").value="";document.getElementById("phonepart1").value="";if(document.getElementById("phonepart2")){document.getElementById("phonepart2").value="";}if(this.isIE()){this.addIframeShim(document.getElementById(this.smsdiv));}document.getElementById("smsdebug").innerHTML="";this.hideElement("smsdebug");this.trackEVT();this.smsResizeWin();}else{var docHead=document.getElementsByTagName("head")[0];var newLink=document.createElement("link");newLink.setAttribute("rel","stylesheet");newLink.setAttribute("type","text/css");newLink.setAttribute("href",mws.cssLink);docHead.appendChild(newLink);var request=this.mwsURL+"/ni/sms/getSMSParam.mw?callback=mws.mainSMSForm&app="+this.smsCallingApp+"&cc="+this.smsDefaultCountry+"&lang="+this.smsDefaultLanguage;this.smsJSON=new this.JSONscriptRequest(request);this.smsJSON.buildScriptTag();this.smsJSON.addScriptTag();}};mws.showSMSForm=function(App,Country,Language){this.smsCallingApp=App;this.smsDefaultCountry=mws.getValidCountry(Country);this.smsDefaultCountryOrg=Country;this.smsDefaultLanguage=Language;this.smsCaptchaPassed=false;if(this.smsCallingApp=="Mail"){this.showMailSMSContainer();}else{if(this.smsCallingApp=="Sport"){this.showSportSMSContainer();}else{if(this.smsCallingApp=="Fantasy"){this.showSportSMSContainer();}}}this.smsResizeWin();};mws.getValidCountry=function(Country){switch(Country){case"AA":return"SG";break;case"CF":return"CA";break;case"E1":return"US";break;case"HI":return"IN";break;default:return Country;}};mws.trackBeacon=function(smsStatus){var r=Math.random();var img='';document.getElementById("smstrackingbeacon").innerHTML=img;};mws.trackEVT=function(){var img='';document.getElementById("smstrackingevt").innerHTML=img;};mws.mainSMSForm=function(o){smsvars=o.smsvars;var cc=this.smsDefaultCountry?this.smsDefaultCountry:"US";var cc=smsvars.tracking.countrycode?smsvars.tracking.countrycode:this.smsDefaultCountry;if(!cc){cc="US";}this.smsDefaultCountry=mws.getValidCountry(cc);this.smsDefaultCountryOrg=cc;var html="";html+='
";html+='';html+='';html+=' ';html+=' ';html+=' ';var docBody=document.getElementsByTagName("body")[0];var newDiv=document.createElement("div");newDiv.setAttribute("id",this.smsdiv);newDiv.innerHTML=html;docBody.appendChild(newDiv);this.smsJSON.removeScriptTag();this.trackEVT();if(this.isIE()){this.addIframeShim(document.getElementById(this.smsdiv));}};mws.procSMSCaptcha=function(){var secdata=document.getElementById("_secdata").value;var secword=document.getElementById("_secword").value;var request=this.mwsURL+"/ni/captcha/captcha.mw?callback=mws.checkCaptcha&action=CHECK&secdata="+secdata+"&secword="+secword;this.smsJSON=new this.JSONscriptRequest(request);this.smsJSON.buildScriptTag();this.smsJSON.addScriptTag();};mws.sendSMS=function(o){if(o.smsres.debug_msg&&!window.smsNoDebug){document.getElementById("smsdebug").innerHTML+=o.smsres.debug_msg;this.showElement("smsdebug");}if(o.smsres.error){if(o.smsres.error=="US_Verizon"){this.showElement("verizonuser");this.hideElement("noncaptcha");this.hideElement("captcha");this.hideElement("smssuccess");this.trackBeacon("Verizon");}else{this.showElement("smsError");this.hideElement("sms_sending");this.trackBeacon("Error");}}else{this.showElement("smssuccess");this.hideElement("verizonuser");this.hideElement("noncaptcha");this.hideElement("captcha");this.trackBeacon("Success");}this.smsCaptchaPassed=false;this.smsJSON.removeScriptTag();this.smsResizeWin();};mws.stripNonNumeric=function(s){return s.replace(/\D/g,"");};mws.reshowSMSForm=function(){this.showElement("noncaptcha");this.showElement("other-option");this.showElement("privacy");this.hideElement("smssuccess");this.hideElement("verizonuser");this.hideElement("captcha");this.hideElement("sms_sending");this.hideElement("legal");this.smsCaptchaError=false;this.resetSMSForm();this.smsResizeWin();};mws.resetSMSForm=function(){this.hideElement("smsError");this.hideElement("smsdebug");document.getElementById("smsSend").action="javascript:mws.procSMSForm();";};mws.createPhoneEntry=function(isoCode){var code_for_boxes="";var boxsize=18;if(mws.na_countries.in_array(isoCode)){code_for_boxes='';code_for_boxes+=' - ';code_for_boxes+=' - ';}else{code_for_boxes+="+"+smsvars.clist[isoCode][1]+" ";code_for_boxes+='';code_for_boxes+='';}code_for_boxes+='';return code_for_boxes;};mws.writeCountryList=function(selected){var str='";return str;};mws.writeCountry=function(isoCode){if(!isoCode){return false;}var entry=this.createPhoneEntry(isoCode);document.getElementById("phoneentry").innerHTML=entry;};var bAutotab=true;mws.AutoTab=function(input,maxLength,next){var tn=input.value;var currentLength=tn.length;next=document.getElementById(next);if(currentLength==maxLength){if(next.value==""){next.focus();next.select();}}};mws.stopAutoTab=function(){bAutotab=false;};mws.switchcountry=function(countryIndex){this.resetSMSForm();countryCode=document.forms["smsSend"].countrylist[countryIndex].value;this.writeCountry(countryCode);this.smsResizeWin();};mws.toggle_sms_box=function(){if(document.getElementById("sms_box").style.display=="none"){document.getElementById("sms_box").style.display="block";}else{document.getElementById("sms_box").style.display="none";}};mws.close_smsbox=function(){this.hideElement(this.smsdiv);this.hideElement("legal");this.hideElement("smsdebug");this.smsCaptchaError=false;document.getElementById("smstrackingevt").innerHTML="";this.hideElement("smstrackingevt");if(document.getElementById("hiddenFrame")){var hf=document.getElementById("hiddenFrame");hf.parentNode.removeChild(hf);}return false;};mws.toggleElement=function(e){if(document.getElementById(e)){var el=document.getElementById(e);if(el.style.display=="block"){el.style.display="none";}else{el.style.display="block";}this.smsResizeWin();}};mws.showElement=function(e){if(document.getElementById(e)){document.getElementById(e).style.display="block";}};mws.hideElement=function(e){if(document.getElementById(e)){document.getElementById(e).style.display="none";}};mws.nonNANumberCheck=function(num){return num.match(/^\d{6,18}$/);};mws.requireCaptcha=function(cc){return smsvars.form.captcha_required.match(cc);};mws.selectedCountry=function(){var cl=document.getElementById("smsCountryList");return cl[cl.selectedIndex].value;};mws.resetCountry=function(cc){var cl=document.getElementById("smsCountryList");for(var i=0;i