(function(){if(typeof Prototype==="undefined"){if(typeof _ERR_UNJS_==="undefined"){_ERR_UNJS_=window._ERR_UNJS_={};}if(self==top){_ERR_UNJS_["prototype.js"]="Prototype JS Library";}else{alert("Prototype JS is required! (prototype.js) ");}return false;}var _1=window.CDEFuncs=function(){var _2={};var _3={_ua:navigator.userAgent.toLowerCase(),_os:null,_br:null,_ver:null,__str:null,__pl:null,_is_checked:false,__BR:{code:["konqueror","opera","msie","chrome","safari","firefox","mozilla"],name:["Konqueror","Opera","Internet Explorer","Google Chrome","Safari","Firefox","Mozilla"]},__OS:{code:["linux","x11","macintosh","windows"],name:["Linux","Unix","Mac","Windows"]},check:function(){for(var b=0;b<this.__BR.code.length;b++){var c=this.__BR.code[b];if(this._ua.indexOf(c)!=-1){this._br=b;var d=new RegExp(c+"[ /]?([0-9]+(.[0-9]+)?)");if(d.exec(this._ua)!==null){this._ver=parseFloat(RegExp.$1);}break;}}for(b=0;b<this.__OS.code.length;b++){c=this.__OS.code[b];if(this._ua.indexOf(c)!=-1){this._os=b;break;}}Object.extend(_2,{OS:this.__OS.name[this._os],BR:this.__BR.code[this._br],BR_Name:this.__BR.name[this._br],BR_ver:this._ver});this._is_checked=true;}};_3.check();return {browser_info:_2,settings:_2,logger:function(_7){alert(_7);},page:{width:function(){return window.innerWidth!==null?window.innerWidth:document.body!==null?document.body.clientWidth:null;},height:function(){return window.innerHeight!==null?window.innerHeight:document.body!==null?document.body.clientHeight:null;}},resizePop:function(w,h,_a){if(w>0&&h>0){var _b=_a||window;if(document.all){_b.resizeTo(w,h);}else{if(document.layers||document.getElementById){_b.outerHeight=h;}}}},resizePopToFit:function(){try{var _c=20;var _d=150;var _e=frames[CDE.Pop.winpop.getId()+"_content"];var _f=_e.document.body;var Ht=Math.max(_f.offsetHeight,_f.scrollHeight);var _11=CDEUI.getWindowScroll()["height"];_e.frameElement.style.height="";Ht=Ht>_11?_11-_d:Ht;Ht+=_c;CDE.Pop.opts.height=Ht;CDE.Pop.resizeTo({h:Ht});}catch(x){throw new Error(x.message||x.description);}},resizeWinPopToFit:function(win){var _13=90;var Ht=Math.max(win.document.body.offsetHeight,win.document.body.scrollHeight);var Wt=Math.max(win.document.body.offsetWidth,win.document.body.scrollWidth);Ht+=_13;win.resizeTo(Wt,Ht);},delay:function(_16){var _17=typeof arguments[1]=="function"?arguments[1]:function(){};self.setTimeout(_17,_16*1000);},preloadImages:function(arr){var _19=[];var len=-1;if(typeof arr=="string"){_19.push(arr);}else{if(typeof arr=="object"||typeof arr=="array"){for(i=0;i<arr.length;i++){_19.push(arr[i]);}}else{return false;}}var _1b=Object.extend({onStart:null,onComplete:null,onError:null},arguments[1]||{});var _1c=_19.length;var _1d=0;var _1e=function(){_1d++;if(_1d==_1c){if(typeof _1b.onComplete=="function"){_1b.onComplete();}}};var _1f=function(){if(typeof _1b.onStart=="function"){_1b.onStart();}_19.each(function(i){var img=new Image();img.src=i;img.onload=_1e.bind(img,i);img.onerror=typeof _1b.onError=="function"?_1b.onError:_1e.bind(img,i);img.onabort=typeof _1b.onError=="function"?_1b.onError:_1e.bind(img,i);if(img.complete){_1e(i);}});}();},buildAsQuery:function(url,_23){var _24=arguments[2]?Object.extend({r:this.generateRandom(15)},_23):_23;var _25=$H(_24);url+=(url.match(/\?/)?"&":"?")+_25.toQueryString();return url;},alert:function(_26){window.alert(_26);},redirect:function(url,win){if(url){var _29=win||window;_29.location.href=url;}},refresh:function(_2a){if(location.reload){location.reload();}else{if(location.replace){location.replace(CDE.ENV.CDE_CURURL);}else{location.href=CDE.ENV.CDE_CURURL;}}},prgRefresh:function(){var url="/panel/complete.php?ru="+top.location.href;if(top.location.replace){top.location.replace(url);}else{top.location.href=url;}CDE.Pop.close();},popNewWindow:function(url){var _2d=Object.extend({w:1024,h:768},arguments[1]||{});return this.popUp(url,_2d.w,_2d.h,{menubar:true,toolbar:true,location:true,name:"newwin"+(new Date().getTime())});},popUp:function(url,w,h){var s=Object.extend({resizable:true,toolbar:false,menubar:false,location:false,location:false,scrollbars:true,directories:false,name:"cdepop"},arguments[3]||{});browser_info="width="+w+",height="+h;browser_info+=",top="+((screen.width-w)/2);browser_info+=",left="+((screen.height-h)/2);browser_info+=",toolbar="+(s.toolbar?"1":"0");browser_info+=",location="+(s.location?"1":"0");browser_info+=",directories="+(s.directories?"1":"0");browser_info+=",status="+(s.status?"1":"0");browser_info+=",menubar="+(s.menubar?"1":"0");browser_info+=",scrollbars="+(s.scrollbars?"1":"0");browser_info+=",resizable="+(s.resizable?"1":"0");var _32=window.open(url,s.name,browser_info);var _33=!(typeof CDE==="undefined");if(!_32){if(_33&&(typeof CDE.Pop!=="undefined")){CDE.Pop.open("/calliope/menubar/src/nopopupmsg.php",{title:"Popup blocker is enabled!",w:450,h:300},true);}else{alert("Please disable your pop-up blocker!");}}else{_1.CTGuard.deployWin(_32);if(window.focus){_32.focus();}return _32;}},getCookie:function(_34){var _35=document.cookie.split(";");var _36="";var _37="";var _38="";var _39=false;for(i=0;i<_35.length;i++){_36=_35[i].split("=");_37=_36[0].replace(/^\s+|\s+$/g,"");if(_37==_34){_39=true;if(_36.length>1){_38=unescape(_36[1].replace(/^\s+|\s+$/g,""));}return _38;break;}_36=null;_37="";}if(!_39){return null;}},setCookie:function(_3a,_3b,_3c,_3d,_3e,_3f){var _40=new Date();_40.setTime(_40.getTime());if(_3c){_3c=_3c*1000*60*60*24;}var _41=new Date(_40.getTime()+(_3c));document.cookie=_3a+"="+escape(_3b)+((_3c)?";expires="+_41.toGMTString():"")+((_3d)?";path="+_3d:"")+((_3e)?";domain="+_3e:"")+((_3f)?";secure":"");},deleteCookie:function(_42,_43,_44){if(this.getCookie(_42)){document.cookie=_42+"="+((_43)?";path="+_43:"")+((_44)?";domain="+_44:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}},hideInputs:function(){if(this.browser_info.BR=="msie"){var _45=["select","input"];_45.each(function(tag){var _47=document.getElementsByTagName(tag);_47=$A(_47);_47.each(function(e){Element.hide(e);});});}},showInputs:function(){if(this.browser_info.BR=="msie"){var _49=["select","input"];_49.each(function(tag){var _4b=document.getElementsByTagName(tag);_4b=$A(_4b);_4b.each(function(e){Element.show(e);});});}},addLoadEvent:function(_4d){if(typeof _4d!=="function"){return false;}Event.onDOMReady(_4d);},clearEl:function(el){var e=$(el)||el;for(i=0;i<e.childNodes.length;i++){if(e.childNodes[i]){Element.remove(e.childNodes[i]);}}},hoverize:function(el,_51,_52){el=$(el);el.src=_51;el.onmouseover=function(){if(_51!=_52){el.src=_52;}};el.onmouseout=function(){el.src=_51;};},LTrim:function(_53){var re=/\s*((\S+\s*)*)/;return _53.replace(re,"$1");},RTrim:function(_55){var re=/((\s*\S+)*)\s*/;return _55.replace(re,"$1");},Trim:function(_57){return this.LTrim(this.RTrim(_57));},breakString:function(str,len,del){len=len||18;del=del||" ";var _5b=str;var _5c="";var _5d=false;var _5e=["src=\"","href=\"","=\"http","\"http","http"];for(var i=0;i<_5e.length;i++){if(str.toLowerCase().indexOf(_5e[i])===0){_5d=true;}}if(str.length>len&&!_5d){while(_5b.length>0){_5c+=_5b.substring(0,len)+del;_5b=_5b.substring(len,_5b.length);}}else{_5c=str;}return _5c;},cleanAndBreakHeading:function(str,len){len=len||18;var _62=this.urldecode(str).stripTags();return this.breakContent(_62,len);},clean:function(str){var _64=this.urldecode(str).stripScripts();_64=_64.replace(/<iframe.*>/g,"");_64=_64.replace(/<embed.*>/g,"");_64=_64.replace(/<object.*>/g,"");return _64;},cleanAndBreak:function(str,len){len=len||18;var _67=this.clean(str);return this.breakContent(_67,len);},breakContent:function(str,len){var arr=[];arr=str.split(" ");for(var i=0;i<arr.length;i++){arr[i]=this.breakString(arr[i],len," ");}var _6c=arr.join(" ");return _6c;},checkEmpty:function(fld){return fld===""?true:false;},validateObjectForm:function(_6e,f){if(invalid=$H(_6e).keys().find(function(e){return f[e].value==="";})){alert(_6e[invalid]+" is required!");return false;}else{return true;}},validateEmail:function(_71){var re=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!_71.match(re)){return false;}else{return true;}},truncate:function(str,len){len=len||18;var _75=str;if(str.length>len){_75=str.substring(0,len);_75+="...";}return _75;},addRandom2URL:function(url){var _77=url;var rnd="rnd="+this.generateRandom(10);_77+=(_77.match(/\?/)?"&":"?")+rnd;return _77;},generateRandom:function(_79){var _7a="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";var max=_7a.toArray().length-1;var rnd="";for(var i=0;i<_79;i++){rnd+=_7a.charAt(Math.floor(Math.random()*max+1));}return rnd;},urlencode:function(_7e){var _7f="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var HEX="0123456789ABCDEF";var _81="";for(var i=0;i<_7e.length;i++){var ch=_7e.charAt(i);if(ch==" "){_81+="+";}else{if(_7f.indexOf(ch)!=-1){_81+=ch;}else{var _84=ch.charCodeAt(0);if(_84>255){alert("Unicode Character '"+ch+"' cannot be encoded using standard URL encoding.\n"+"(URL encoding only supports 8-bit characters.)\n"+"A space (+) will be substituted.");_81+="+";}else{_81+="%";_81+=HEX.charAt((_84>>4)&15);_81+=HEX.charAt(_84&15);}}}}return _81;},urldecode:function(_85){if(typeof _85!=="string"){return false;}var _86="0123456789ABCDEFabcdef";var _87="";var i=0;while(i<_85.length){var ch=_85.charAt(i);if(ch=="+"){_87+=" ";i++;}else{if(ch=="%"){if(i<(_85.length-2)&&_86.indexOf(_85.charAt(i+1))!=-1&&_86.indexOf(_85.charAt(i+2))!=-1){_87+=unescape(_85.substr(i,3));i+=3;}else{_87+="%[ERROR]";i++;}}else{_87+=ch;i++;}}}return _87;},checkTextAreaMaxLength:function(_8a,len){var _8c=(_8a.value.length<=len);if(!_8c){alert("Your message is too long. It should be not more than "+len+" characters.");}return _8c;},checkComment:function(){var frm=arguments[0]||$("commentform");var len=65535;if(!frm){return false;}var _8f=CDE.ENV.IS_LOGGEDIN?["comment"]:["comment","author","email","securitycode"];var _90=["Comment","Name","Email","Security Code"];var _91=[];for(var i=0,ii=_8f.length;i<ii;i++){var _93=frm[_8f[i]].value.replace(/^\s+|\s+$/g,"");if(!_93){_91.push(_90[i]+" cannot be empty.");}}if(frm.comment.value.length>len){_91.push("Your message is too long. It should not be more than "+len+" characters");}if(_91.length){alert(_91.join("\n"));}return !_91.length;},parseURI:function(){var str=arguments[0]||"";var o={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};var m=o.parser[o.strictMode?"strict":"loose"].exec(str),uri={},i=14;while(i--){uri[o.key[i]]=m[i]||"";}uri[o.q.name]={};uri[o.key[12]].replace(o.q.parser,function($0,$1,$2){if($1){uri[o.q.name][$1]=$2;}});return uri;},dumpOBJ:function(o){if(typeof o=="object"){if(this.dumps===undefined){this.dumps=0;}this.dumps++;var _9b=arguments[1]||"DumpWin"+this.dumps;var _9c="<h3>"+_9b+"</h3>[Object object]<br/>";for(e in o){_9c+="&nbsp;&nbsp;["+e+":"+eval("o."+e)+"]</br>";}dumpWin=window.open("","dump"+this.dumps,"width=300,height=300,scrollbars=yes");dumpWin.document.open();dumpWin.document.write(_9c);dumpWin.document.close();dumpWin.focus();}else{alert("that is not an object!");}}};}();Array.prototype.inArray=function(_9d){var i;for(i=0;i<this.length;i++){if(this[i]===_9d){return true;}}return false;};String.prototype.unquoted=function(){return this.replace("&#039;","'").replace("&quot;","\"").replace(/&amp;/g,"&");};if(Ajax&&Ajax.Base){Object.extend(Ajax.Base.prototype,{setOptions:function(_9f){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};Object.extend(this.options,_9f||{});try{var _a0=this.options.parameters.split("&");["ct","ck"].each(function(_a1){var _a2=encodeURI(_1.getCookie(_a1));if(!_a2){return false;}var rgx=new RegExp("^"+_a1+"=");if(!$A(_a0).find(function(e){return rgx.test(e);})){_a0.push(_a1+"="+_a2);}});this.options.parameters=_a0.join("&");}catch(x){}}});}_1.XHR=function(url){var _a6=Object.extend({method:"GET",asynchronous:true,params:"",timeout:30,failOnTimeout:false,onAbort:null,onResponse:null,onFail:null,onTimeout:null},arguments[1]||{});var _a7={xhr:null,isdone:false,status:null,ondone:function(req){try{this.status=this.xhr.transport.status;}catch(x){}if(this.isdone){return;}if(this.status==200){this.isdone=true;if(typeof _a6.onResponse==="function"){_a6.onResponse(req);}return true;}else{if(this.status==0){return this.onfail();}else{return this.onabort();}}},onabort:function(){if(this.isdone){return;}if(typeof _a6.onAbort==="function"){this.isdone=true;return _a6.onAbort();}else{this.onfail();}},onfail:function(){if(this.isdone){return;}this.isdone=true;if(typeof _a6.onFail==="function"){return _a6.onFail();}return true;},onexception:function(xhr,msg){if(this.isdone){return;}if(xhr.transport.readyState===4){this.onabort();}else{if(xhr.transport.readyState===0){this.onfail();}else{this.onfail();}}},ontimeout:function(){if(this.isdone){return;}if(_a6.failOnTimeout){try{this.xhr.transport.abort();this.xhr.transport.onreadystatechange=function(){};}catch(x){try{console.log(x.message);}catch(e){}}finally{}return this.onfail();}if(typeof _a6.onTimeout==="function"){return _a6.onTimeout();}}};url+=(url.match(/\?/)?"&":"?")+"rnd="+(new Date().getTime());_a7.xhr=new Ajax.Request(url,{method:_a6.method,asynchronous:_a6.asynchronous,parameters:_a6.params,onException:_a7.onexception.bind(_a7),onComplete:_a7.ondone.bind(_a7),onFailure:_a7.onfail.bind(_a7)});setTimeout(_a7.ontimeout.bind(_a7),_a6.timeout*1000);return {xhr:_a7.xhr,abort:function(){_a7.onabort();try{_a7.xhr.transport.abort();_a7.xhr.transport.onreadystatechange=function(){};}catch(x){try{console.log(x.message);}catch(e){}}finally{}}};};_1.CTGuard=function(){var fn={deployWin:function(){var win=arguments[0]||window;Event.observe(win,"load",function(e){_1.CTGuard.deploy(e.target);});},deploy:function(){var _ae=arguments[0]||window.document;$A(_ae.forms).each(function(FRM){["ck","ct"].each(function(_b0){var _b1=_1.getCookie(_b0);if(!_b1){return false;}if(FRM[_b0]){FRM[_b0].value=_b1;}else{var INP=_ae.createElement("input");INP.setAttribute("type","hidden");INP.setAttribute("name",_b0);INP.setAttribute("value",_b1);FRM.appendChild(INP);}});});}};return fn;}();Event.onDOMReady(_1.CTGuard.deploy);if(typeof encodeURI!=="function"){var _b3=window.encodeURI=function(str){if(typeof encodeURIComponent==="function"){return encodeURIComponent(str);}else{if(typeof _b3==="function"){return _b3(str);}else{return escape(str);}}};}})();