var cursor={x:0,y:0};var last_pos={x:0,y:0};var onload_queue=new Array();var move_list=new Array();function redir(a){window.location.href=a}function page_load(){document.onmousemove=getXY;for(key in onload_queue){var a=onload_queue[key];if(!a){continue}if(a.onload){a.onload()}else{if(a.eventOnLoad){a.eventOnLoad()}}}document.onmouseup=function(){move_list=new Array()}}function addOnLoadQueue(a){onload_queue[onload_queue.length]=a}var change_x=0;var change_y=0;function getXY(c){c=c||window.event;last_pos.x=cursor.x;last_pos.y=cursor.y;if(window.Event){cursor.x=c.pageX;cursor.y=c.pageY}else{var d=document.documentElement;var a=document.body;cursor.x=c.clientX+(d.scrollLeft||a.scrollLeft)-(d.clientLeft||0);cursor.y=c.clientY+(d.scrollTop||a.scrollTop)-(d.clientTop||0)}change_x+=cursor.x-last_pos.x;change_y+=cursor.y-last_pos.y}function move_windows(){if(move_list.length>0){for(key in move_list){move_list[key].move(change_x,change_y)}}change_x=0;change_y=0;if(move_list.length<1){return}setTimeout("move_windows()",75)}function addMoveQueue(b){change_x=0;change_y=0;move_list[move_list.length]=b;setTimeout("move_windows()",75)}function CheckAll(){this.box_dom_ids=new Array();this.checked=false}CheckAll.prototype.add=function(a){this.box_dom_ids.push(a)};CheckAll.prototype.onclick=function(){for(key in this.box_dom_ids){var a=document.getElementById(this.box_dom_ids[key]);if(a){a.checked=!this.checked}}this.checked=!this.checked};function CheckAllForm(c,b){for(var a=0;a<c.elements.length;a++){var d=c.elements[a];if(d!=this&&d.type=="checkbox"){d.checked=b.checked}}return true}function CheckAllFormByInputName(d,b,c,g){for(var a=0;a<d.elements.length;a++){var f=d.elements[a];if(f!=this&&f.type=="checkbox"&&f.name==c){f.checked=b.checked;if(g){f.checked=!f.checked}}}return true}function AjaxConnection(){this.http_request=null;this.processer=function(b,a){};this.base_tag="bts";this.not_ready_callback=function(a,b){};this.errorHandler=function(a,b){};this.errorTag="Error";this.request_type="get";this.post_vars=new Array()}AjaxConnection.prototype.addPostVar=function(a,b){this.post_vars[this.post_vars.length]=encodeURIComponent(a)+"="+encodeURIComponent(b);this.request_type="post"};AjaxConnection.prototype.clearPost=function(){this.post_vars=new Array();this.request_type="get"};AjaxConnection.prototype.CreateAjax=function(){
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
    try {
        this.http_request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            this.http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E) {
            this.http_request = null;
        }
    }
    @end @*/
if(!this.http_request&&typeof XMLHttpRequest!="undefined"){this.http_request=new XMLHttpRequest()}if(!this.http_request){this.errorHandler("Fatal Error: couldn't create AJAX request, old browser?, IE with ActiveX disabled?",this);return}return this.http_request};AjaxConnection.prototype.Connect=function(a){this.CreateAjax();if(this.http_request){var b=this;this.http_request.onreadystatechange=function(){b.readyChange()};this.http_request.open(this.request_type.toUpperCase(),a,true);if(this.request_type.toLowerCase()=="post"){this.http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");this.http_request.send(this.post_vars.join("&"))}else{this.http_request.send(null)}}};AjaxConnection.prototype.readyChange=function(){if(!this.http_request){alert("request is still false");return}if(this.http_request.readyState==4){if(this.http_request.status==200||(this.http_request.status>=500&&this.http_request.status<=599)){var a=this.http_request.responseXML;var b;if(!a||!a.firstChild){if(this.http_request.status!=200){this.errorHandler("Error connecting to Ajax, Reason: HTTP/"+this.http_request.status,this)}else{this.errorHandler("Failed parsing XML Document",this)}return}b=a.firstChild;if(b.nodeName=="parsererror"){this.errorHandler(b.nodeName+"\n\n"+this.http_request.responseText,this);return}b=a.documentElement;this.root_node=b;if(!this.checkBtsAjaxError(b)){return}this.processer(b,this)}else{this.errorHandler("Error connecting to Ajax, Reason: HTTP/"+this.http_request.status,this)}}else{this.not_ready_callback(this.http_request.readyState,this)}};AjaxConnection.prototype.checkBtsAjaxError=function(c){if(!c){this.errorHandler("Root Node Is Not Defined",this);return false}var a=c.getElementsByTagName(this.errorTag).item(0);if(a&&a.nodeName==this.errorTag){if(a.firstChild){this.errorHandler(a.firstChild.nodeValue,this)}else{this.errorHandler("error was sent by the ajax processor, but had no content",this)}return false}var b=c.getElementsByTagName("nologin").item(0);if(b){window.location.href="index.xml";return false}return true};function AjaxPlainHTML(b,a){this.box_id=b;var d=new AjaxConnection();this.a=d.CreateAjax();var c=this;this.a.onreadystatechange=function(){c.AjaxPlainHTMLDone()};this.url=a;this.display=function(f){var e=document.getElementById(c.box_id);if(e){e.innerHTML=f}}}AjaxPlainHTML.prototype.Send=function(){this.a.open("GET",this.url,true);this.a.send(null)};AjaxPlainHTML.prototype.AjaxPlainHTMLDone=function(){if(this.a.readyState==4){this.display(this.a.responseText)}};function murderChildren(a){while(a.childNodes[0]){a.removeChild(a.childNodes[0])}}function BlindAjax(a){this.ajax=new AjaxConnection;this.ajax.base_tag="DomainAdmin";this.url=a;var b=this;this.done=function(){};this.ajax.processer=function(c,d){b.done()}}BlindAjax.prototype.Connect=function(){this.ajax.Connect(this.url)};function IDNTable(a,b){this.table=document.getElementById(a);this.search_box=document.getElementById(b)}IDNTable.prototype={onload:function(){var c=this.table.getElementsByTagName("tbody")[0];var e=c.childNodes.length;var d=this;for(var a=0;a<e;a++){var f=c.childNodes[a];if(f&&f.nodeName.toLowerCase()=="tr"){var b=f.childNodes.length;for(y=0;y<b;y++){var g=f.childNodes[y];if(g&&g.nodeName.toLowerCase()=="td"){g.onclick=function(){d.onclick(this)}}}}}},onclick:function(a){var b=a.innerHTML;if(b.replace){b=b.replace(/ /,"")}this.search_box.value+=b}};function phonePopup(b){var c=createDOMElement("div");c.style.cssText="position:relative:width:0px;height:0px;cursor:pointer";var a=createDOMElement("div");a.className="premium-call-box";a.innerHTML="<b>Please Call</b><p>To inquire about and purchase this premium domain name today, please call one of our Domain Specialists.</p><p>Toll Free (US): 888.398.4703 ext 1102 <br /> Intl: ++1.760.736.3700 ext 1102</p>";c.appendChild(a);b.parentNode.appendChild(c);b.onmouseout=function(){if(c){c.parentNode.removeChild(c)}};return false}function CorporateDomainTool(f,a,j,h,i,d,b,g,e,c){this.form=document.getElementById(f);this.available_select=document.getElementById(a);this.selected_select=document.getElementById(j);this.add_button=document.getElementById(h);this.remove_button=document.getElementById(i);this.num_selected_notify=document.getElementById(d);this.est_price_notify=document.getElementById(b);this.add_all_button=document.getElementById(g);this.rm_all_button=document.getElementById(e);this.search_input=document.getElementById(c);this.selectedExt=new Array();this.extensionIndex=new Array()}CorporateDomainTool.prototype.onload=function(){var c=this;var d=getFormFieldsByName(this.form,"domain")[0];this.form.onsubmit=function(){return c.onsubmit()};this.add_button.onclick=function(){if(d.onfocus){d.onfocus()}return c.addExtensions(false)};this.remove_button.onclick=function(){return c.removeExtensions(false)};this.add_all_button.onclick=function(){if(d.onfocus){d.onfocus()}c.addExtensions(true);return false};this.rm_all_button.onclick=function(){c.removeExtensions(true);return false};this.search_input.onkeypress=function(j){return c.search(j)};d.onkeypress=function(k){var j=window.event?window.event.keyCode:k.which;var l=trim(this.value);if(j==8){l=l.substring(0,l.length-1)}else{if(j>=32){l+=String.fromCharCode(j)}}if(!l.match(/^[a-z0-9\-]+$/i)){c.boxErr(this);return}this.style.backgroundColor=""};d.onblur=function(){if(!this.value.match(/^[a-z0-9\-]+$/i)){c.boxErr(this);return}this.style.backgroundColor=""};d.onchange=function(){c.updateDomain()};this.loadExtensionIndex();var g=this.selected_select.options.length;var a=null;var f=null;var b=null;var e=null;var h=null;for(var i=0;i<g;i++){a=this.selected_select.options[i];arr=a.value.split(/\:/);f=arr[0];b=arr[1];e=parseFloat(arr[2]);this.selectedExt[f]=e;for(key in this.extensionIndex){if(this.extensionIndex[key]==b){h=this.available_select.options[key];h.selected=false;h.style.visibility="hidden";h.style.display="none";break}}}this.updateTotals()};CorporateDomainTool.prototype.onsubmit=function(){var f=true;var c=new Array(getFormFieldsByName(this.form,"name")[0],getFormFieldsByName(this.form,"company_name")[0],getFormFieldsByName(this.form,"email")[0],getFormFieldsByName(this.form,"phone")[0]);var b=this.form.elements.length;for(var a=0;a<b;a++){if(this.form.elements[a].onfocus){this.form.elements[a].onfocus()}}for(key in c){if(c[key].onfocus){c[key].onfocus()}if(trim(c[key].value).length<1){f=false;this.boxErr(c[key])}}var e=getFormFieldsByName(this.form,"domain")[0];var d=trim(e.value);if(d.length<1||!d.match(/^[a-z0-9\-]+$/)){e.onfocus();this.boxErr(e);f=false}b=this.selected_select.options.length;if(b<1){this.boxErr(this.selected_select);f=false}for(var a=0;a<b;a++){this.selected_select.options[a].selected=true}return f};CorporateDomainTool.prototype.boxErr=function(a){a.style.backgroundColor="#ffcccc";a.onfocus=function(){this.style.backgroundColor="";this.style.color=""}};CorporateDomainTool.prototype.addExtensions=function(h){var g=this.available_select.options.length;var j=getFormFieldsByName(this.form,"domain")[0];var a=null;var c=null;var d=null;var f=null;var b=null;var e=null;for(var i=0;i<g;i++){a=this.available_select.options[i];if(h==true||a.selected){d=a.value.split(/\:/);f=d[0];b=d[1];e=parseFloat(d[2]);if(this.selectedExt[f]>0){continue}c=createDOMElement("option");c.setAttribute("value",a.value);c.innerHTML=j.value+b+": "+formatPrice(e,"USD");this.selected_select.appendChild(c);this.selectedExt[f]=e;a.selected=false;a.style.visibility="hidden";a.style.display="none";this.selected_select.style.backgroundColor=""}}this.updateTotals();return true};CorporateDomainTool.prototype.removeExtensions=function(c){var b=this.selected_select.options.length;var e=null;var f=-1;var d=new Array();for(var a=0;a<b;a++){e=this.selected_select.options[a];if(c==true||e.selected){f=getOptionIndexByValue(this.available_select,e.value);if(f>=0){this.available_select.options[f].style.visibility="visible";this.available_select.options[f].style.display="";this.available_select.options[f].selected=false}arr=e.value.split(/\:/);sld_id=arr[0];ext=arr[1];price=arr[2];this.selectedExt[sld_id]=0;d.push(e)}}for(key in d){d[key].parentNode.removeChild(d[key])}this.updateTotals()};CorporateDomainTool.prototype.updateTotals=function(){var a=0;var b=0;for(key in this.selectedExt){if(this.selectedExt[key]>0){a++;b+=this.selectedExt[key]}}murderChildren(this.num_selected_notify);murderChildren(this.est_price_notify);this.num_selected_notify.appendChild(document.createTextNode(a));this.est_price_notify.appendChild(document.createTextNode(formatPrice(b,"USD")))};CorporateDomainTool.prototype.updateDomain=function(){var b=this.selected_select.options.length;var c=null;var g=getFormFieldsByName(this.form,"domain")[0];var f;var d;var e;for(var a=0;a<b;a++){c=this.selected_select.options[a];arr=c.value.split(/\:/);f=arr[0];d=arr[1];e=arr[2];murderChildren(c);c.appendChild(document.createTextNode(g.value+d+": "+formatPrice(parseFloat(e),"USD")))}};CorporateDomainTool.prototype.search=function(f){if(this.extensionIndex.length<1){this.loadExtensionIndex()}var d=window.event?window.event.keyCode:f.which;var g=trim(this.search_input.value);if(d==8){g=g.substring(0,g.length-1)}else{if(d>=32){g+=String.fromCharCode(d)}}if(!g.match(/^[a-z0-9\-.]*$/i)){this.boxErr(this.search_input);return true}this.search_input.backgroundColor="";if(!g.match(/^\./)){g="."+g}var b="";var c=-1;for(var a in this.extensionIndex){b=this.extensionIndex[a];if(b.toLowerCase().search(g)!=-1){this.available_select.options[a].selected=true;if(c==-1){c=a}}else{this.available_select.options[a].selected=false}}if(c>=0){this.available_select.options[c].selected=false;this.available_select.options[c].selected=true}else{this.available_select.options[0].selected=true;this.available_select.options[0].selected=false}return true};CorporateDomainTool.prototype.loadExtensionIndex=function(){var c=this.available_select.options.length;var b=null;var d=null;var e=null;var f=null;for(var a=0;a<c;a++){opt=this.available_select.options[a];b=opt.value.split(/\:/);f=b[0];d=b[1];e=b[2];this.extensionIndex[a]=d}};var isOpera=false;var isIE=false;if(typeof(window.opera)!="undefined"){isOpera=true}if(!isOpera&&navigator.userAgent.indexOf("MSIE")>=0){isIE=true}var _namespace="http://www.w3.org/1999/xhtml";var _nspfx="html:";function createDOMElement(a){if(document.createElementNS){return document.createElementNS(_namespace,_nspfx+a)}return document.createElement(a)}function setCss(b,c){b.setAttribute("class",c);b.setAttribute("className",c)}function createImageDom(c,b){var a=createDOMElement("img");a.setAttribute("src",c);a.setAttribute("alt",b);return a}function getSelectedOptionValue(a){if(!a.options[a.selectedIndex]){return false}return a.options[a.selectedIndex].value}function tolOv(a){a.style.border="1px solid red";a.style.outline="1px solid red";a.style.cursor="pointer"}function tolOu(a){a.style.border="1px solid black";a.style.outline="0px"}function getValueFromElement(b){if(!b){return false}if(!b.nodeName){return false}if(b.disabled){return false}var a=b.nodeName.toLowerCase();if(b.localName){a=b.localName.toLowerCase()}if(a=="input"||a=="textarea"){var c=b.attributes.getNamedItem("type");if(c&&(c.value.toLowerCase()=="checkbox"||c.value.toLowerCase()=="radio")){if(b.checked){return b.value}else{return false}}else{return b.value}}else{if(a=="select"){if(b.selectedIndex>=0){return getSelectedOptionValue(b)}}}return false}function LTrim(b){var a=/\s*((\S+\s*)*)/;return b.replace(a,"$1")}function RTrim(b){var a=/((\s*\S+)*)\s*/;return b.replace(a,"$1")}function trim(a){return LTrim(RTrim(a))}function loadAJ(a,c){var b=new AjaxConnection;b.processer=function(d,e){xmlToDom(c,d)};b.base_tag="DomainAdmin";b.Connect(a)}function onloadAJ(a,b){this.onload=function(){loadAJ(a,b)}}function LoadAjaxSimple(a,b){this.ajax=new AjaxConnection;this.ajax.processer=function(c,d){xmlToDom(b,c)};this.url=a;this.post_elements=new Array()}LoadAjaxSimple.prototype={onclick:function(){for(key in this.post_elements){var a=this.post_elements[key];var b=getValueFromElement(a);if(b!==null){this.ajax.addPostVar(a.name,b)}}this.post_elements=new Array();this.ajax.Connect(this.url)},addPostElement:function(a){if(a){this.post_elements.push(a)}}};function xmlToDom(parent_node,xml_node,insert_after){var dom=null;var inserted=false;var exec_text=null;if(xml_node.nodeType==3||xml_node.nodeType==4){if(parent_node){parent_node.appendChild(document.createTextNode(xml_node.nodeValue))}return}if(xml_node.nodeName=="Logout"){alert("You are not logged in");window.location.reload();return}if(xml_node.nodeName=="PHPError"){if(aj_error_handler){aj_error_handler.addPostVar("msg[]",xml_node.firstChild.nodeValue);show_error_box(error_box_dom_id)}return}if(xml_node.nodeName=="ReplaceDOM"){replaceDOM(xml_node);return}if(xml_node.nodeName=="RemoveDOM"){var id=xml_node.attributes.getNamedItem("id");if(id&&id.value){removeDomId(id.value)}return}if(xml_node.nodeName=="AppendDOM"){var id=xml_node.attributes.getNamedItem("id");if(id&&id.value){var element=document.getElementById(id.value);if(element){for(var x=0;x<xml_node.childNodes.length;x++){xmlToDom(element,xml_node.childNodes[x])}}}return}if(xml_node.nodeName=="ClosePopup"){closePopup();return}if(xml_node.nodeName=="RefreshBoxLoader"){if(active_box_loader&&active_box_loader.loadBox){active_box_loader.loadBox(null)}return}if(xml_node.nodeName=="ReloadPage"){window.location.reload();return}if(xml_node.nodeName=="RedirectTo"){window.location.href=xml_node.firstChild.nodeValue;return}if(xml_node.nodeName=="script"){if(xml_node.firstChild){eval(xml_node.firstChild.nodeValue)}return}var chk=false;if(xml_node.nodeName!="RequireRow"&&xml_node.nodeName!="DomainAdmin"&&xml_node.nodeName!="template"){var suppress_name=false;if(isIE&&xml_node.nodeName=="input"&&xml_node.attributes&&xml_node.attributes.getNamedItem("name")){var n=xml_node.attributes.getNamedItem("name");var t=xml_node.attributes.getNamedItem("type");if(t&&t.value=="radio"){dom=document.createElement("<"+xml_node.nodeName+' name="'+n.value+'" type="'+t.value+">");suppress_name=true}else{if(t&&t.value=="checkbox"&&n&&n.value&&xml_node.attributes.getNamedItem("checked")){dom=document.createElement("<"+xml_node.nodeName+' name="'+n.value+'" checked type="'+t.value+">");suppress_name=true}else{dom=document.createElement("<"+xml_node.nodeName+' name="'+n.value+'" type="'+(t&&t.value?t.value:"")+">");suppress_name=true}}}else{dom=createDOMElement(xml_node.nodeName)}dom.event_eval=new Array();var attr_ct=xml_node.attributes.length;for(var x=0;x<attr_ct;x++){var name=xml_node.attributes[x].name.toLowerCase();var value=xml_node.attributes[x].value;try{switch(name){case"class":setCss(dom,value);break;case"onclick":case"onchange":case"onmousedown":case"onmouseup":case"onmouseover":case"onmouseout":case"onmousemove":case"onreset":case"onselect":case"onsubmit":case"onunload":case"onload":case"onkeydown":case"onkeyup":case"onkeypress":case"onfocus":case"onerror":case"ondblclick":case"onblur":case"onabort":eval("dom."+name+"=function(){"+value+"};");break;case"name":if(!suppress_name){dom.setAttribute(xml_node.attributes[x].name,value)}break;case"run":exec_text=value.replace(/this/g,"dom");break;case"checked":dom.checked=true;chk=true;dom.setAttribute(xml_node.attributes[x].name,value);break;case"colspan":dom.setAttribute(xml_node.attributes[x].name,value);dom.colSpan=parseInt(value);break;case"style":dom.setAttribute(xml_node.attributes[x].name,value);dom.style.cssText=value;break;case"type":if(!isIE||xml_node.nodeName!="input"){dom.setAttribute(xml_node.attributes[x].name,value)}break;default:dom.setAttribute(xml_node.attributes[x].name,value);break}}catch(e){}}if(parent_node){if(insert_after){var next_node=insert_after.nextSibling;if(next_node){parent_node.insertBefore(dom,next_node);inserted=true}else{parent_node.appendChild(dom)}}else{parent_node.appendChild(dom)}}}else{dom=parent_node}for(var x=0;x<xml_node.childNodes.length;x++){var c=xml_node.childNodes[x];if(c.nodeType==3||c.nodeType==4){if(dom){dom.appendChild(document.createTextNode(c.nodeValue))}}else{if(inserted==false){xmlToDom(dom,c,insert_after)}else{xmlToDom(dom,c,null)}}}if(exec_text){eval(exec_text)}if(chk==true){dom.checked=true}return dom}function getAllTextNodes(b){var d="";var e=null;for(var a=0;a<b.childNodes.length;a++){e=b.childNodes[a];if(e.nodeType==3||e.nodeType==4){d+=e.nodeValue}else{d+=getAllTextNodes(e)}}return d}function findParent(a,c){var b=a;while(b){if(b.nodeName.toLowerCase()==c.toLowerCase()){return b}b=b.parentNode}return null}function replaceDOM(e){var f=e.attributes.getNamedItem("id");if(f&&f.value){var b=e.attributes.getNamedItem("child");var h=document.getElementById(f.value);if(!h){return false}if(b&&b.value){murderChildren(h);for(var a=0;a<e.childNodes.length;a++){xmlToDom(h,e.childNodes[a],null)}}else{var d=h.parentNode;var c=null;for(var a=0;a<e.childNodes.length;a++){var g=e.childNodes[a];if(g.nodeType==3||g.nodeType==4){continue}else{c=g;break}}if(c==null){return}if(c.nodeType>=3&&c.nodeType<=4){dom=c}else{dom=xmlToDom(null,c,null)}d.replaceChild(dom,h);h=null;dom.setAttribute("id",f.value)}}}var item_register=new Array();function addItemRegister(b,a){item_register[b]=a}function getItemRegister(a){return item_register[a]}function findPos(b){var c=curtop=0;if(b.offsetParent){c=b.offsetLeft;curtop=b.offsetTop;while(b=b.offsetParent){c+=b.offsetLeft;curtop+=b.offsetTop}}var a=new function(){};a.curtop=curtop;a.curleft=c;return a}function disableBoxDomId(a){var b=document.getElementById(a);b.disabled=true;b.style.background="#eaeaea"}function enableBoxDomId(a){var b=document.getElementById(a);b.disabled=false;b.style.background=""}function hideElement(b){var a=document.getElementById(b);a.style.display="none"}function showElement(b){var a=document.getElementById(b);a.style.display=""}function removeDomId(a){var b=document.getElementById(a);if(b&&b.parentNode){b.parentNode.removeChild(b);return true}return false}function kidnapChildren(d,b){for(var a=0;a<b.childNodes.length;a++){var e=b.childNodes[a];d.appendChild(e);b.removeChild(e)}}function bind(b,a){return function(){b[a]()}}function _l(b,c){var a=b.href;a=a.replace(/\.[a-zA-Z]{1,6}(\?.+)?$/,c+"$1");if(c==".xml"){show_popup_window(a);return false}else{if(c==".xhtml"){active_box_loader.changeURL(a);active_box_loader.loadBox(null);return false}}return true}function input_default(a){if(a.has_clicked){return}a.value="";a.has_clicked=true;a.style.color=""}function has_input_default_clicked(a){return a.has_clicked}function clear_default_inputs(b){for(var a=0;a<b.elements.length;a++){var c=b.elements[a];c.onfocus()}}function dropDownRedirect(a){var b=getSelectedOptionValue(a);if(b.length>0){document.location.href=b}}function getFormFieldsByName(e,c){var d=e.elements.length;var b=new Array();for(var a=0;a<d;a++){if(e.elements[a].name==c){b.push(e.elements[a])}}return b}function getOptionIndexByValue(c,d){var b=c.options.length;for(var a=0;a<b;a++){if(c.options[a].value==d){return a}}return -1}function formatPrice(f,i){var g=f.toFixed(2);var c=g.split(/\./);var h=c[0];var k=c[1];var b=",";var e=".";var d="";var a=0;for(var j=h.length-1;j>=0;j--,a++){if(a==3){d=b+d}d=h[j]+d}return d+e+k+" "+i}function DomainSearch(c,a){var b=this;this.url=a;this.domain_name=c;this.ajax=new AjaxConnection;this.ajax.processer=function(e,d){xmlToDom(null,e)};this.tries=0;this.ajax.errorHandler=function(d,e){b.errorHandler(d)}}DomainSearch.prototype={onload:function(){this.run()},run:function(){this.tries++;this.ajax.Connect(this.url+(!this.url.match(/\?/)?"?":"&")+"try="+this.tries)},errorHandler:function(f){if(this.tries<2){this.run();return}if(f.match(/(Failed parsing XML Document)|(Error connecting to Ajax)/)){f="There has been a temporary server error; please try again later"}var b=document.getElementById(this.domain_name);if(b){var e=b.getElementsByTagName("img");var d=false;for(var a=0;a<e.length;a++){if(e[a].src.match(/loading/)){d=true;var c=document.createTextNode(f);e[a].parentNode.insertBefore(c,e[a]);e[a].parentNode.removeChild(e[a]);break}}if(d==false){alert(f)}}}};function DropDownMenu(a){this.ul_dom_id=a;this.menuItems=new Array();this.parents=new Array();this.initialized=new Array()}DropDownMenu.prototype={onload:function(){var b=document.getElementById(this.ul_dom_id);if(!b){return}for(var a=0;a<b.childNodes.length;a++){if(b.childNodes[a].nodeName.toLowerCase()=="li"){this.initMenuItem(b.childNodes[a])}}},initMenuItem:function(b){var c=trim(getAllTextNodes(b));var a=this;b.onmouseover=function(){a.mouseOver(this)};b.onmouseout=function(){var d=this;this.interval_id=setInterval(function(){a.mouseOut(d)},300)}},addMenuItem:function(c,e,a,d,b){if(!this.menuItems[c]){this.menuItems[c]=new Array()}this.menuItems[c][e]=new DropDownMenuNode(a,d,b);this.parents[e]=c},mouseOver:function(g){if(g.interval_id!=null){clearInterval(g.interval_id);g.interval_id=null}var h=g.id;if(this.parents[h]&&this.menuItems[this.parents[h]]){for(var d in this.menuItems[this.parents[h]]){if(this.initialized[d]){this.initialized[d].style.display=""}}}if(!this.initialized[h]){if(this.menuItems[h]){var f=document.createElement("ul");f.style.display="";f.style.zIndex="200";for(var e in this.menuItems[h]){var b=document.createElement("li");b.setAttribute("id",e);if(this.menuItems[h][e].css){b.className=this.menuItems[h][e].css;b.setAttribute("class",this.menuItems[h][e].css)}var c=document.createElement("a");c.setAttribute("href",this.menuItems[h][e].url);c.innerHTML=this.menuItems[h][e].text;b.appendChild(c);this.initMenuItem(b);f.appendChild(b)}g.appendChild(f);this.initialized[h]=f}}else{this.initialized[h].style.display=""}},mouseOut:function(a){var b=a.id;if(this.initialized[b]){this.initialized[b].style.display="none"}}};function DropDownMenuNode(a,c,b){this.url=a;this.text=c;this.css=b}function TrademarkUI(f,e,b,c,d,a){this.id=f;this.form_dom_id=e;this.submit_id=b;this.active_src=c;this.disabled_src=d;this.always_allow=a;this.base_cost=0;this.includedClasses=1;this.classFee=0;this.classGovFee=0;this.required_service=new Array();this.add_services=new Array()}TrademarkUI.prototype.onload=function(){var a=this;document.getElementById(this.form_dom_id).onsubmit=function(){return a.canSubmit(a.always_allow)};this.canSubmit(this.always_allow)};TrademarkUI.prototype.canSubmit=function(b){var e=document.getElementById(this.form_dom_id);var f=document.getElementById(this.submit_id);if(!e){return true}var d=0;if(b==true){d=1}else{var c=null;for(var a=0;a<e.elements.length;a++){c=e.elements[a];if(c.id.match(/^tm_class/)&&c.checked){d++}}}if(d==0){f.src=this.disabled_src;this.updateTotal(d);return false}else{f.src=this.active_src;this.updateTotal(d);return true}};TrademarkUI.prototype.setBaseCost=function(a){this.base_cost=parseFloat(a.replace(/,|( USD$)/,""));if(isNaN(this.base_cost)){this.base_cost=0}};TrademarkUI.prototype.setClassFee=function(a){this.classFee=parseFloat(a.replace(/,|( USD$)/,""));if(isNaN(this.classFee)){this.classFee=0}};TrademarkUI.prototype.setClassGovFee=function(a){this.classGovFee=parseFloat(a.replace(/,|( USD$)/,""));if(isNaN(this.classGovFee)){this.classGovFee=0}};TrademarkUI.prototype.addItemizedCost=function(b){var a=parseFloat(b.replace(/,|( USD$)/,""));if(!isNaN(a)){this.required_service.push(a)}};TrademarkUI.prototype.addService=function(e,b,d){var a=parseFloat(d.replace(/,|( USD$)/,""));if(isNaN(a)){return}this.add_services[e]=new Array();this.add_services[e]["name"]=b;this.add_services[e]["cost"]=a;this.add_services[e]["input"]=document.getElementById("add_service_"+e);this.add_services[e]["total_row"]=null;var c=this;this.add_services[e]["input"].onclick=function(){c.canSubmit(false)}};TrademarkUI.prototype.updateTotal=function(j){var g=document.getElementById("total_add_class_"+this.id);var f=document.getElementById("total_add_gov_"+this.id);this.updateTotalRowValue(g,(j-this.includedClasses)*this.classFee,j-this.includedClasses,this.classFee);this.updateTotalRowValue(f,(j-this.includedClasses)*this.classGovFee,j-this.includedClasses,this.classGovFee);var i=document.getElementById("total_"+this.id);var k=this.base_cost;for(key in this.required_service){k+=this.required_service[key]}var h=0;k+=((h=(j-this.includedClasses)*this.classFee)>0?h:0);k+=((h=(j-this.includedClasses)*this.classGovFee)>0?h:0);var b=document.getElementById("total-line-items-"+this.id);for(key in this.add_services){if(this.add_services[key]["input"].checked==true){k+=this.add_services[key]["cost"];if(this.add_services[key]["total_row"]==null){var a=createDOMElement("tr");this.add_services[key]["total_row"]=a;var d=null;var e=null;a.appendChild(d=createDOMElement("th"));a.appendChild(e=createDOMElement("td"));d.appendChild(document.createTextNode(this.add_services[key]["name"]));e.appendChild(document.createTextNode(formatPrice(this.add_services[key]["cost"],"USD")));b.appendChild(a)}}else{if(this.add_services[key]["total_row"]!=null){this.add_services[key]["total_row"].parentNode.removeChild(this.add_services[key]["total_row"]);this.add_services[key]["total_row"]=null}}}i.innerHTML=formatPrice(k,"USD")};TrademarkUI.prototype.updateTotalRowValue=function(d,c,b,a){if(c<=0){d.style.display="none";return}d.style.display="";var e=d.getElementsByTagName("td")[0];e.innerHTML=formatPrice(c,"USD")+"<br /><small> ("+b+" @ "+formatPrice(a,"USD")+") </small>"};var cursor={x:0,y:0};var last_pos={x:0,y:0};var onload_queue=new Array();var move_list=new Array();function redir(a){window.location.href=a}function page_load(){document.onmousemove=getXY;for(key in onload_queue){var a=onload_queue[key];if(!a){continue}if(a.onload){a.onload()}else{if(a.eventOnLoad){a.eventOnLoad()}}}document.onmouseup=function(){move_list=new Array()}}function addOnLoadQueue(a){onload_queue[onload_queue.length]=a}var change_x=0;var change_y=0;function getXY(c){c=c||window.event;last_pos.x=cursor.x;last_pos.y=cursor.y;if(window.Event){cursor.x=c.pageX;cursor.y=c.pageY}else{var d=document.documentElement;var a=document.body;cursor.x=c.clientX+(d.scrollLeft||a.scrollLeft)-(d.clientLeft||0);cursor.y=c.clientY+(d.scrollTop||a.scrollTop)-(d.clientTop||0)}change_x+=cursor.x-last_pos.x;change_y+=cursor.y-last_pos.y}function move_windows(){if(move_list.length>0){for(key in move_list){move_list[key].move(change_x,change_y)}}change_x=0;change_y=0;if(move_list.length<1){return}setTimeout("move_windows()",75)}function addMoveQueue(b){change_x=0;change_y=0;move_list[move_list.length]=b;setTimeout("move_windows()",75)};
