function getEvent(a){a=(a||event||false);if(!a.preventDefault){a.preventDefault=function(){this.returnValue=false;return false}}if(!a.stopPropagation){a.stopPropagation=function(){this.cancelBubble=true}}a.kill=function(){this.preventDefault();this.stopPropagation()};return a}cookies={cookies:null,init:function(){this.cookies={};var a=document.cookie.split(";");var d=/^[\s]*([^\s]+?)$/i;for(var b=0;b<a.length;b++){var e=a[b].split("=");if(e.length==2){this.cookies[e[0].match(d)[1]]=unescape(e[1].match(d)?e[1].match(d)[1]:"")}}},get:function(a){if(!this.cookies){this.init()}return this.cookies[a]},set:function(c,e,f){if(!this.cookies){this.init()}this.cookies[c]=e;var a="";if(f){var b=new Date();b.setTime(b.getTime()+(f*24*60*60*1000));a="; expires="+b.toGMTString()}var d=location.host.match(/[^.]+\.[^.]+$/);document.cookie=c+"="+escape(e)+a+"; path=/"+(d?"; domain=."+d:"")}};window._checkers={};window._getChecker=function(a){return window._checkers[a]};SerialSingleURLChecker=function(b,c,a){this.url=b;this.key=c;this.finished=false;this.script=null;this.checker=a;this.run=function(){var f=new Function("","var c=window._getChecker('"+this.checker+"')._checkers["+this.key+"];if(!c||c.finished)return;c.finished=true;var u=window._getChecker('"+this.checker+"').hasConfirm()?c.url:false;window._getChecker('"+this.checker+"').complete(u,c)");var e=document.getElementsByTagName("head")[0]||document.documentElement;var d=document.createElement("script");d.src=window._getChecker(this.checker).complitURL(this.url);d.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){d.onreadystatechange=null;f();try{d.parentNode.removeChild(d,true)}catch(g){}}};this.script=d;e.insertBefore(d,e.firstChild)}};SingleURLChecker=function(b,c,a){this.url=b;this.key=c;this.finished=false;this.script=null;this.checker=a;this.run=function(){var g=new Function("","var c=window._getChecker('"+this.checker+"')._checkers["+this.key+"];if(!c||c.finished)return;c.finished=true;var u=window._getChecker('"+this.checker+"').hasConfirm()?c.url:false;window._getChecker('"+this.checker+"').complete(u,c)");var f=document.getElementsByTagName("head")[0]||document.documentElement;var e=document.createElement("script");e.src=window._getChecker(this.checker).complitURL(this.url);var d=false;e.onload=e.onreadystatechange=function(){if(!d){d=true;if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"){e.onload=e.onreadystatechange=null;try{e.parentNode.removeChild(e,true)}catch(h){}}g()}};this.script=e;f.insertBefore(e,f.firstChild)}};function scale(d,c,a){if(d==0){return 0}var b=c/d;return Math.round(a*b)}function now(){return(new Date()).getTime()}window.URLChecker=function(b,a){this.urls=b;this.valid=false;this.onComplete=null;this.onFail=null;this.timeout=6000;this.count=0;this.index=0;this.current=0;this.startTime=0;this.endTime=0;this.lastTimeout=0;this.nextTimeout=0;this.cookieName=a+"_lwku";this.service=a;this._checkers=[];this._current=null;this._tid=null;this._isSerial=false;this._urlKeys=[];window._checkers[a]=this;this.run=function(f,g,e){if(f){this.onComplete=f}if(g){this.onFail=g}if(e){this.timeout=e}this.detectSerialChecking();var c=cookies.get(this.cookieName);cookies.set(this.cookieName,"",30);if(c&&(""+c)!="undefined"){this._unshift(c)}for(var d in this.urls){this._urlKeys.push(d)}this._urlKeys.reverse();this.count=this._urlKeys.length;this.startTime=now();this.endTime=0;this._next()};this.progress=function(){if(this.endTime>0){return 100}var d=(100/this.count);var c=d*this.index;c+=scale(this.timeout,d,now()-this.lastTimeout);return Math.round(c)};this.complete=function(c){if(!c){this._next()}else{this.valid=c;this._finalizations();cookies.set(this.cookieName,c,30);if(this.onComplete){this.onComplete(c)}}};this.fail=function(){if(this.onFail){this.onFail()}};this.detectSerialChecking=function(){this._isSerial=!!document.createElement("script")["readyState"]};this._next=function(){clearTimeout(this._tid);if(this._current){this._current.finished=true}if(this._urlKeys.length){var c=this.urls[this._urlKeys.pop()];var d=this._checkers.length;this._current=new SingleURLChecker(c,this._checkers.length,this.service);if(this._isSerial){this._current=new SerialSingleURLChecker(c,this._checkers.length,this.service)}this.index=d;this.current=c;this._checkers.push(this._current);this.lastTimeout=now(),this.nextTimeout=this.lastTimeout+this.timeout;this._tid=setTimeout('window._getChecker("'+this.service+'")._timeout()',this.timeout);this._current.run()}else{this._finalizations()}};this._unshift=function(e){for(var d in this.urls){if(this.urls[d]==e){var f=e?[e]:[];for(var c in this.urls){if(c!=d){f.push(this.urls[c])}}this.urls=f;break}}};this._timeout=function(){this._next()};this.setUrls=function(d){this.urls=[];for(var c in d){this.urls[c]=d[c]}};this._remove=function(){for(var c in this._checkers){try{this._checkers[c].script.parentNode.removeChild(this._checkers[c].script,true)}catch(d){}this._checkers[c]=null}this._current=null};this._finalizations=function(){this.endTime=now();this._remove();this._urlKeys=[];if(this.valid==false){this.fail()}};this.complitURL=function(c){return"http://"+c+"/home287/domainAvailability.js?ajax="+(new Date()).getTime()};this.hasConfirm=function(){return window.urlConfirm&&window.urlConfirm===true&&this.valid===false}};
