function getScreenWidth(){var result=2000;if(window.innerWidth){result=parseInt(window.innerWidth);}else{if(document.documentElement&&document.documentElement.clientWidth){result=parseInt(document.documentElement.clientWidth);}else{if(document.body){result=parseInt(document.body.clientWidth);}}}if(isNaN(result)){result=2000;}return result;}function getScreenHeight(){var result=2000;if(window.innerHeight){result=parseInt(window.innerHeight);}else{if(document.documentElement&&document.documentElement.clientHeight){result=parseInt(document.documentElement.clientHeight);}else{if(document.body){result=parseInt(document.body.clientHeight);}}}if(isNaN(result)){result=2000;}return result;}function getScreenOffsetX(){var result=2000;if(window.pageXOffset){result=parseInt(window.pageXOffset);}else{if(document.documentElement&&document.documentElement.scrollLeft){result=parseInt(document.documentElement.scrollLeft);}else{if(document.body){result=parseInt(document.body.scrollLeft);}}}if(isNaN(result)){result=2000;}return result;}function getScreenOffsetY(){var result=2000;if(window.innerHeight){result=parseInt(window.pageYOffset);}else{if(document.documentElement&&document.documentElement.scrollTop){result=parseInt(document.documentElement.scrollTop);}else{if(document.body){result=parseInt(document.body.scrollTop);}}}if(isNaN(result)){result=2000;}return result;}function TogglePreloader(fl){var x,y;x=getScreenWidth();y=getScreenHeight();var iframe=document.getElementById("preloader_iframe");var table=document.getElementById("preloader_table");var td=document.getElementById("preloader_td");var el=document.getElementById("div_desktop");if(null!=el){el.style.visibility=(fl==1)?"visible":"hidden";el.style.display=(fl==1)?"block":"none";el.style.width=x+"px";el.style.height=y+"px";el.style.zIndex=1;}var el=document.getElementById("loader");if(null!=el){var top=(y/2)-50;var left=(x/2)-200;if(left<=0){left=10;}td.style.width=(getScreenWidth()+getScreenOffsetX())+"px";td.style.height=(getScreenHeight()+getScreenOffsetY())+"px";top+=getScreenOffsetY();left+=getScreenOffsetX();table.style.display=(fl==1)?"block":"none";iframe.style.left=left+"px";iframe.style.top=top+"px";iframe.style.display=(fl==1)?"block":"none";el.style.visibility=(fl==1)?"visible":"hidden";el.style.display=(fl==1)?"block":"none";el.style.left=left+"px";el.style.top=top+"px";}}function disable_field(field,disable){if(typeof(field)!="object"){return;}if(disable){field.disabled=true;if(field.style){if(field.type=="text"||field.type=="select-one"||field.type=="password"){field.style.backgroundColor="#F0F0F0";field.style.borderColor="#B7B7C6";field.style.color="#555555";}}}else{field.disabled=false;if(field.style){if(field.type=="text"||field.type=="select-one"||field.type=="password"){field.style.backgroundColor="#FFFFFF";field.style.borderColor="#B7B7C6";field.style.color="#000000";}}}}function click_hostname(object,field,type){if(typeof(object)!="object"){return;}if(typeof(field)!="object"){return;}if(typeof(field[type])=="object"){field[type].checked=true;}if(type==-1){disable_field(object.domain_hostname,1);disable_field(object.subdomain,1);disable_field(object.subdomain_hostname,1);}else{disable_field(object.domain_hostname,type?field.checked:!field.checked);disable_field(object.subdomain,type?!field.checked:field.checked);disable_field(object.subdomain_hostname,type?!field.checked:field.checked);}}function multi_domain(){document.getElementById("single_domain").style.display="none";document.getElementById("multi_domain").style.display="";document.getElementById("domain_selection_type").value="multi";document.getElementById("domain_name").disabled=true;document.getElementById("tld").disabled=true;}function single_domain(){document.getElementById("single_domain").style.display="";document.getElementById("multi_domain").style.display="none";document.getElementById("domain_selection_type").value="single";document.getElementById("domain_name").disabled=false;document.getElementById("tld").disabled=false;}function skip_domains(){document.getElementById("action").value="skip_domains";document.domain_selection_form.submit();}function check_domains(form){var error="";if(typeof(form.dm_action)!="object"){document.getElementById("action").value="check_domains";form.submit();}var dm_action;if(form.dm_action.length==undefined){dm_action=document.getElementById("dm_action").value;}else{for(i=0;i<form.dm_action.length;i++){if(form.dm_action[i].checked==true){dm_action=form.dm_action[i].value;break;}}}if(dm_action=="register_new"||dm_action=="reg_transfer"||dm_action=="domain_pointer"){var www_re=new RegExp("^www\\.","i");if((document.getElementById("domain_selection_type").value=="single")&&(!document.getElementById("domain_name").value.length)){error=error+string_STR_PLEASE_SPECIFY_DOMAIN_NAME+"\n";}if((document.getElementById("domain_selection_type").value=="single")&&www_re.test(document.getElementById("domain_name").value)){error=error+string_STR_WWW_EXISTS_IN_DOMAIN_NAME+"\n";}if((document.getElementById("domain_selection_type").value=="multi")&&(!document.getElementById("domain_names").value.length)){error=error+string_STR_PLEASE_SPECIFY_DOMAIN_NAMES+"\n";}if(document.getElementById("domain_selection_type").value=="multi"){var pattern=/\s+/;var str=document.getElementById("domain_names").value;result=str.split(pattern);for(i=0;i<result.length;i++){if(www_re.test(result[i])){error=error+string_STR_WWW_EXISTS_IN_DOMAIN_NAME+"\n";break;}}}}else{if(dm_action=="use_subdomain"){var www_re=new RegExp("^www\\.","i");var www_re2=new RegExp("^www$","i");if(typeof(document.getElementById("subdomain"))=="object"&&!document.getElementById("subdomain").value){error=error+string_STR_PLEASE_SPECIFY_SUBDOMAIN_NAME+"\n";}if(typeof(document.getElementById("subdomain"))=="object"&&www_re.test(document.getElementById("subdomain").value)){error=error+string_STR_WWW_EXISTS_IN_DOMAIN_NAME+"\n";}if(typeof(document.getElementById("subdomain"))=="object"&&www_re2.test(document.getElementById("subdomain").value)){error=error+string_STR_WWW_EXISTS_IN_DOMAIN_NAME+"\n";}if(typeof(document.getElementById("subdomain"))=="object"&&!document.getElementById("subdomain_hostname").value){error=error+string_STR_PLEASE_SPECIFY_SUBDOMAIN_HOSTNAME+"\n";}}else{if(dm_action=="use_domain"){if(typeof(document.getElementById("domain_hostname"))=="object"&&!document.getElementById("domain_hostname").value){error=error+string_STR_PLEASE_SPECIFY_DOMAIN_NAME+"\n";}}}}if(error){alert(error);return false;}else{document.getElementById("action").value="check_domains";form.submit();}}function order_domains(){var error="";if(error){alert(error);return false;}else{document.getElementById("action").value="order_domains";document.domain_selection_form.submit();}}function change_dm_action(dm_action){if(dm_action=="register_new"){document.getElementById("tld").style.display="";document.getElementById("dot").style.display="";document.getElementById("multi_domain_link").style.display="";document.getElementById("nsset").style.display="none";}if(dm_action=="reg_transfer"){single_domain();document.getElementById("tld").style.display="none";document.getElementById("dot").style.display="none";document.getElementById("multi_domain_link").style.display="";document.getElementById("nsset").style.display="none";}if(dm_action=="domain_pointer"){single_domain();document.getElementById("tld").style.display="none";document.getElementById("dot").style.display="none";document.getElementById("multi_domain_link").style.display="none";document.getElementById("nsset").style.display="";}disable_field(document.getElementById("domain_selection_form").subdomain,true);disable_field(document.getElementById("domain_selection_form").subdomain_hostname,true);disable_field(document.getElementById("domain_selection_form").domain_hostname,true);}function add_suggested_domains(){var error="";if(error){alert(error);return false;}else{document.getElementById("action").value="add_suggested_domains";document.domain_selection_form.submit();}}function downstairs(element,org_value,step){var field=document.getElementById(element);if(typeof(field)!="object"){return false;}cur_value=parseInt(field.value);if(isNaN(cur_value)){cur_value=org_value;}if(step>1&&(org_value-cur_value)%step){cur_value=org_value+cur_value-(cur_value%step);}field.value=parseInt(cur_value-step);if(field.value<org_value){field.value=org_value;}}function upstairs(element,org_value,step){var field=document.getElementById(element);if(typeof(field)!="object"){return false;}cur_value=parseInt(field.value);if(isNaN(cur_value)){cur_value=org_value;}if(step>1&&(org_value-cur_value)%step){cur_value=org_value+cur_value-(cur_value%step);}if(cur_value<org_value){field.value=org_value;}field.value=parseInt(cur_value+step);}function xreplace(checkMe,toberep,repwith){var temp=checkMe;var i=temp.indexOf(toberep);while(i>-1){temp=temp.replace(toberep,repwith);i=temp.indexOf(toberep,i+repwith.length+1);}return temp;}function domain_contacts(_domain,_contact_type,_contact_id){getOrCreateInput=function(_input_id,_form,_input_name){el=document.getElementById(_input_id);if(!el){el=document.createElement("input");el.setAttribute("id",_input_id);el.setAttribute("type","hidden");el.setAttribute("name",_input_name);_form.appendChild(el);}return el;};var form_configure=document.getElementById("form_configure");input_action=getOrCreateInput("input_action",form_configure,"action");input_contact_type=getOrCreateInput("input_contact_type",form_configure,"contact_type");input_contact_domain=getOrCreateInput("input_contact_domain",form_configure,"contact_domain");input_contact_id=getOrCreateInput("input_contact_id",form_configure,"contact_id");input_action.value="contact_edit";input_contact_type.value=_contact_type;input_contact_domain.value=_domain;input_contact_id.value=_contact_id;form_configure.submit();}function check_domain_data(){if(typeof(document.getElementById("form_configure").hostname_type)!="object"){return true;}if(typeof(document.getElementById("form_configure").subdomain)!="object"){return true;}var hostname_type=false;if(document.getElementById("form_configure").hostname_type.length==undefined){hostname_type=document.getElementById("form_configure").hostname_type.value;}else{hostname_type=document.getElementById("form_configure").hostname_type[0].checked?document.getElementById("form_configure").hostname_type[0].value:(document.getElementById("form_configure").hostname_type[1].checked?document.getElementById("form_configure").hostname_type[1].value:document.getElementById("form_configure").hostname_type[2].value);}if(hostname_type=="use_subdomain"&&typeof(document.getElementById("subdomain"))=="object"&&!document.getElementById("form_configure").subdomain.value){alert(string_STR_PLEASE_SPECIFY_SUBDOMAIN_NAME);return false;}if(hostname_type=="use_subdomain"&&typeof(document.getElementById("subdomain_hostname"))=="object"&&!document.getElementById("subdomain_hostname").value){alert(string_STR_PLEASE_SPECIFY_SUBDOMAIN_HOSTNAME);return false;}if(hostname_type=="use_domain"&&typeof(document.getElementById("domain_hostname"))=="object"&&!document.getElementById("domain_hostname").value){alert(string_STR_PLEASE_SPECIFY_DOMAIN_NAME);return false;}return true;}function click_contacts_prefilling_type(obj,reset){if(obj.value=="use_account"){apply_to_all_contacts(0);display_prefilling_contact_selector(0);}else{if(obj.value=="use_contact"){apply_to_all_contacts(document.getElementById("contacts_prefilling_contact_id")?document.getElementById("contacts_prefilling_contact_id").selectedIndex+1:0);display_prefilling_contact_selector(1);}else{if(reset){apply_to_all_contacts(0);}display_contacts(1);display_prefilling_contact_selector(0);}}}function change_contacts_prefilling_contact_id(obj){document.getElementById("form_configure").contacts_prefilling_type[1].checked=true;apply_to_all_contacts(document.getElementById("contacts_prefilling_contact_id").selectedIndex+1);}function change_hosting_destination(domain_source,hosting_type){if(hosting_type=="0"){document.getElementById("hosting_destination_"+domain_source).style.display="none";}else{if(hosting_type=="1"){document.getElementById("hosting_destination_"+domain_source).style.display="";}}}function display_prefilling_contact_selector(state){var display=state?"":"none";if(document.getElementById("contacts_prefilling_contact_select_td")){document.getElementById("contacts_prefilling_contact_select_td").style.display=display;}if(document.getElementById("contacts_prefilling_contact_edit_link_td")){document.getElementById("contacts_prefilling_contact_edit_link_td").style.display=display;}}