function onload(){try{privateOnLoad()}catch(error){}}function selectRow(el){if(el.tagName&&el.tagName!="TR"){return }var tbl=el.parentNode;while(tbl&&(tbl.tagName!="TABLE")){tbl=tbl.parentNode}if(tbl&&tbl.selectedRow!=el){var topRow=null;var bottomRow=null;var animEl=null;var contentEl=null;topRow=tbl.selectedRow;if(topRow){bottomRow=tbl.selectedRow.nextSibling.nodeType!=3?tbl.selectedRow.nextSibling:tbl.selectedRow.nextSibling.nextSibling;topRow.className="row-top";bottomRow.className="row-bottom"}tbl.selectedRow=el;topRow=el;bottomRow=el.nextSibling.nodeType!=3?el.nextSibling:el.nextSibling.nextSibling;topRow.className="selected-row-top";bottomRow.className="selected-row-bottom"}}function showJaxtrId(inObj,out){var testString=inObj.value;var badChars=/<|>/gi;var finalString=testString.replace(badChars,"");var outObj=document.getElementById(out);outObj.innerHTML=finalString}function updateJaxtrId(){var idF=document.getElementById("jaxtrId");var linkF=document.getElementById("phonelink");if(idF.value!=""){linkF.innerHTML=idF.value}}function checkSignUpFields(){var idF=document.getElementById("jaxtrId");if(idF.value.length<6){alert("Jaxtr ID must the 6 or more characters");return false}var passF=document.getElementById("password");var pass2F=document.getElementById("confirmPassword");if(passF.value==pass2F.value){if(passF.value.length<6){alert("Passwords must have 6 or more characters");return false}}else{alert("Passwords do not match");return false}var emailF=document.getElementById("email");var emailRegxp=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;if(emailRegxp.test(emailF.value)!=true){alert("Please enter valid email address");return false}var ageF=document.getElementById("age");if(ageF.selectedIndex==0){alert("Please select an age");return false}var acceptF=document.getElementById("isAccepted");if(!acceptF.checked){alert("You must accept the terms and conditions");return false}return true}function ClipBoard(item){var holdtext=document.getElementById("holdtext");var copytext=document.getElementById(item);holdtext.innerText=copytext.innerText;Copied=holdtext.createTextRange();Copied.execCommand("Copy")}function minmaxgreybox(clickLink){var box=clickLink.parentNode.parentNode.parentNode;var clearDiv=clickLink.parentNode.nextSibling.nextSibling;var tblwrapper=box.getElementsByTagName("DIV").item(2);if(clickLink.minimized){clickLink.minimized=false;clickLink.innerHTML=clickLink.innerHTML.replace("Maximize","Minimize");clickLink.getElementsByTagName("INPUT").item(0).src=cdnURL+"/user/img/icons/minimize.gif";tblwrapper.style.display="";tblwrapper.style.height="10px";clearDiv.style.display="";animate({element:tblwrapper,height:{to:tblwrapper.getElementsByTagName("TABLE").item(0).offsetHeight+3,step:8}})}else{clickLink.minimized=true;clickLink.innerHTML=clickLink.innerHTML.replace("Minimize","Maximize");clickLink.getElementsByTagName("INPUT").item(0).src=cdnURL+"/user/img/icons/maximize.gif";tblwrapper.style.height=(tblwrapper.getElementsByTagName("TABLE").item(0).offsetHeight+3)+"px";animate({element:tblwrapper,height:{to:0,step:15},afteranimation:function(){tblwrapper.style.display="none";clearDiv.style.display="none"}})}}function animate(animationInfo){animationInfo.element.animationData={};if(animationInfo.height){animationInfo.element.animationData.height=animationInfo.height}if(animationInfo.afteranimation){animationInfo.element.animationData.afteranimation=animationInfo.afteranimation}animationStep(animationInfo.element.id)}function animationStep(elementId){var element=document.getElementById(elementId);var nextStep=false;if(!element.animationData){return }if(element.animationData.height){var toHeight=element.animationData.height.to;if(typeof (toHeight)=="number"){var step=element.animationData.height.step;var elementHeight=parseInt(element.style.height);if(Math.abs(elementHeight-toHeight)>step){if(toHeight<elementHeight&&step>0){step=-step}element.style.height=(elementHeight+step)+"px";nextStep=true}else{element.style.height=toHeight+"px"}}}if(nextStep){setTimeout("animationStep('"+elementId+"')",40)}else{if(element.animationData.afteranimation){element.animationData.afteranimation()}}}var lastRequest="";function AJAXswitch(jaxtrId,act,value1,value2,elementId,elementValue,elementErrorId,elementErrorValue){var requestURL="/user/regctl";if(act=="tep"&&value1==-1){window.location="settings.jsp?pane=phones";return }try{AjaxRequest.post({url:requestURL,onSuccess:function(req){try{var resp=null;var XMLDoc=null;if(!window.ActiveXObject){var parser=new DOMParser();var doc=parser.parseFromString(req.responseText,"text/xml");XMLDoc=doc.documentElement}else{resp=new ActiveXObject("Microsoft.XMLDOM");resp.async="false";resp.loadXML(req.responseText)}lastRequest=XMLDoc;if(XMLDoc.getElementsByTagName("result").item(0).firstChild.nodeValue=="success"){if(elementId.length>0){document.getElementById(elementId).value=elementValue}}else{if(elementErrorId.length>0){document.getElementById(elementErrorId).value=elementErrorValue}}}catch(e){}},onError:function(req){},parameters:{jid:jaxtrId,act:act,val01:value1,val02:value2}});if(act=="tep"){home_update_remaining_balance(value1)}}catch(e){}}function noCaching(url){var nocache=(url.indexOf("?")!=-1)?"&"+new Date().getTime():"?"+new Date().getTime();return(url+nocache)}function trim(str){return str.replace(/^\s*|\s*$/g,"")}function clearName(val){var mikExp=/[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|\!\{\}\:\;\"]/;var strPass=val.value;var strLength=strPass.length;var lchar=val.value.charAt((strLength)-1);if(lchar.search(mikExp)!=-1){var tst=val.value.substring(0,(strLength)-1);val.value=tst}}function jaxtr_inviteField_onFocus(field){try{if(field!=null){if(field.value.indexOf("friend")>=0){field.value=""}field.className="email_field_black"}}catch(e){alert(e.message)}}function jaxtr_inviteField_setStyle(){var announces=document.getElementsByTagName("input");for(var i=0;i<announces.length;i++){if(announces[i].type=="text"&&(announces[i].value!="friend@email.com "&&announces[i].value!="")){if(announces[i].id!=null&&announces[i].id=="announce1"){}announces[i].className="email_field_black"}else{if(announces[i].type=="text"&&(announces[i].value=="friend@email.com "||announces[i].value=="")){if(announces[i].id!=null&&announces[i].id=="announce1"){}announces[i].className="email_field_grey";announces[i].value="friend@email.com "}}}}function do_email_submit(){var allfields=document.getElementsByTagName("input");try{for(var i=0;i<allfields.length;i++){if(allfields[i].type=="text"&&(allfields[i].getAttribute("changed")==undefined||allfields[i].getAttribute("changed")==null||allfields[i].getAttribute("changed")!="true")&&allfields[i].value=="friend@email.com "){allfields[i].value=""}}}catch(e){}}function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=="string"){element=document.getElementById(element)}if(arguments.length==1){return element}elements.push(element)}return elements};