(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{args=arguments[0]||{};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"];var _12={};_e.frameElement.style.height="";Ht=Ht>_11?_11-_d:Ht;Ht+=_c;CDE.Pop.opts.height=Ht;_12.h=args.minH?(Ht<args.minH?args.minH:Ht):Ht;if(args.minW){_12.w=args.minW;}CDE.Pop.resizeTo(_12);}catch(x){throw new Error(x.message||x.description);}},resizeWinPopToFit:function(win){var _14=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+=_14;win.resizeTo(Wt,Ht);},delay:function(_17){var _18=typeof arguments[1]=="function"?arguments[1]:function(){};self.setTimeout(_18,_17*1000);},preloadImages:function(arr){var _1a=[];var len=-1;if(typeof arr=="string"){_1a.push(arr);}else{if(typeof arr=="object"||typeof arr=="array"){for(i=0;i<arr.length;i++){_1a.push(arr[i]);}}else{return false;}}var _1c=Object.extend({onStart:null,onComplete:null,onError:null},arguments[1]||{});var _1d=_1a.length;var _1e=0;var _1f=function(){_1e++;if(_1e==_1d){if(typeof _1c.onComplete=="function"){_1c.onComplete();}}};var _20=function(){if(typeof _1c.onStart=="function"){_1c.onStart();}_1a.each(function(i){var img=new Image();img.src=i;img.onload=_1f.bind(img,i);img.onerror=typeof _1c.onError=="function"?_1c.onError:_1f.bind(img,i);img.onabort=typeof _1c.onError=="function"?_1c.onError:_1f.bind(img,i);if(img.complete){_1f(i);}});}();},buildAsQuery:function(url,_24){var _25=arguments[2]?Object.extend({r:this.generateRandom(15)},_24):_24;var _26=$H(_25);url+=(url.match(/\?/)?"&":"?")+_26.toQueryString();return url;},alert:function(_27){window.alert(_27);},redirect:function(url,win){if(url){var _2a=win||window;_2a.location.href=url;}},refresh:function(_2b){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 _2e=Object.extend({w:1024,h:768},arguments[1]||{});return this.popUp(url,_2e.w,_2e.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 _33=window.open(url,s.name,browser_info);var _34=!(typeof CDE==="undefined");if(!_33){if(_34&&(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{pop_url=_1.parseURI(url);if(pop_url.host==(top||parent).location.host){_1.CTGuard.deployWin(_33);}if(window.focus){_33.focus();}return _33;}},getCookie:function(_35){var _36=document.cookie.split(";");var _37="";var _38="";var _39="";var _3a=false;for(i=0;i<_36.length;i++){_37=_36[i].split("=");_38=_37[0].replace(/^\s+|\s+$/g,"");if(_38==_35){_3a=true;if(_37.length>1){_39=unescape(_37[1].replace(/^\s+|\s+$/g,""));}return _39;break;}_37=null;_38="";}if(!_3a){return null;}},setCookie:function(_3b,_3c,_3d,_3e,_3f,_40){var _41=new Date();_41.setTime(_41.getTime());if(_3d){_3d=_3d*1000*60*60*24;}var _42=new Date(_41.getTime()+(_3d));document.cookie=_3b+"="+escape(_3c)+((_3d)?";expires="+_42.toGMTString():"")+((_3e)?";path="+_3e:"")+((_3f)?";domain="+_3f:"")+((_40)?";secure":"");},deleteCookie:function(_43,_44,_45){if(this.getCookie(_43)){document.cookie=_43+"="+((_44)?";path="+_44:"")+((_45)?";domain="+_45:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}},hideInputs:function(){if(this.browser_info.BR=="msie"){var _46=["select","input"];_46.each(function(tag){var _48=document.getElementsByTagName(tag);_48=$A(_48);_48.each(function(e){Element.hide(e);});});}},showInputs:function(){if(this.browser_info.BR=="msie"){var _4a=["select","input"];_4a.each(function(tag){var _4c=document.getElementsByTagName(tag);_4c=$A(_4c);_4c.each(function(e){Element.show(e);});});}},addLoadEvent:function(_4e){if(typeof _4e!=="function"){return false;}Event.onDOMReady(_4e);},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,_52,_53){el=$(el);el.src=_52;el.onmouseover=function(){if(_52!=_53){el.src=_53;}};el.onmouseout=function(){el.src=_52;};},LTrim:function(_54){var re=/\s*((\S+\s*)*)/;return _54.replace(re,"$1");},RTrim:function(_56){var re=/((\s*\S+)*)\s*/;return _56.replace(re,"$1");},Trim:function(_58){return this.LTrim(this.RTrim(_58));},breakString:function(str,len,del){len=len||18;del=del||" ";var _5c=str;var _5d="";var _5e=false;var _5f=["src=\"","href=\"","=\"http","\"http","http"];for(var i=0;i<_5f.length;i++){if(str.toLowerCase().indexOf(_5f[i])===0){_5e=true;}}if(str.length>len&&!_5e){while(_5c.length>0){_5d+=_5c.substring(0,len)+del;_5c=_5c.substring(len,_5c.length);}}else{_5d=str;}return _5d;},cleanAndBreakHeading:function(str,len){len=len||18;var _63=this.urldecode(str).stripTags();return this.breakContent(_63,len);},clean:function(str){var _65=this.urldecode(str).stripScripts();_65=_65.replace(/<iframe.*>/g,"");_65=_65.replace(/<embed.*>/g,"");_65=_65.replace(/<object.*>/g,"");return _65;},cleanAndBreak:function(str,len){len=len||18;var _68=this.clean(str);return this.breakContent(_68,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 _6d=arr.join(" ");return _6d;},checkEmpty:function(fld){return fld===""?true:false;},validateObjectForm:function(_6f,f){if(invalid=$H(_6f).keys().find(function(e){return f[e].value==="";})){alert(_6f[invalid]+" is required!");return false;}else{return true;}},validateEmail:function(_72){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(!_72.match(re)){return false;}else{return true;}},truncate:function(str,len){len=len||18;var _76=str;if(str.length>len){_76=str.substring(0,len);_76+="...";}return _76;},addRandom2URL:function(url){var _78=url;var rnd="rnd="+this.generateRandom(10);_78+=(_78.match(/\?/)?"&":"?")+rnd;return _78;},generateRandom:function(_7a){var _7b="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";var max=_7b.toArray().length-1;var rnd="";for(var i=0;i<_7a;i++){rnd+=_7b.charAt(Math.floor(Math.random()*max+1));}return rnd;},urlencode:function(_7f){var _80="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var HEX="0123456789ABCDEF";var _82="";for(var i=0;i<_7f.length;i++){var ch=_7f.charAt(i);if(ch==" "){_82+="+";}else{if(_80.indexOf(ch)!=-1){_82+=ch;}else{var _85=ch.charCodeAt(0);if(_85>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.");_82+="+";}else{_82+="%";_82+=HEX.charAt((_85>>4)&15);_82+=HEX.charAt(_85&15);}}}}return _82;},urldecode:function(_86){if(typeof _86!=="string"){return false;}var _87="0123456789ABCDEFabcdef";var _88="";var i=0;while(i<_86.length){var ch=_86.charAt(i);if(ch=="+"){_88+=" ";i++;}else{if(ch=="%"){if(i<(_86.length-2)&&_87.indexOf(_86.charAt(i+1))!=-1&&_87.indexOf(_86.charAt(i+2))!=-1){_88+=unescape(_86.substr(i,3));i+=3;}else{_88+="%[ERROR]";i++;}}else{_88+=ch;i++;}}}return _88;},checkTextAreaMaxLength:function(_8b,len){var _8d=(_8b.value.length<=len);if(!_8d){alert("Your message is too long. It should be not more than "+len+" characters.");}return _8d;},checkComment:function(){var frm=arguments[0]||$("commentform");var len=65535;if(!frm){return false;}var _90=CDE.ENV.IS_LOGGEDIN?["comment"]:["comment","author","email","securitycode"];var _91=["Comment","Name","Email","Security Code"];var _92=[];for(var i=0,ii=_90.length;i<ii;i++){var _94=frm[_90[i]].value.replace(/^\s+|\s+$/g,"");if(!_94){_92.push(_91[i]+" cannot be empty.");}}if(frm.comment.value.length>len){_92.push("Your message is too long. It should not be more than "+len+" characters");}if(_92.length){alert(_92.join("\n"));}return !_92.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 _9c=arguments[1]||"DumpWin"+this.dumps;var _9d="<h3>"+_9c+"</h3>[Object object]<br/>";for(e in o){_9d+="&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(_9d);dumpWin.document.close();dumpWin.focus();}else{alert("that is not an object!");}}};}();Array.prototype.inArray=function(_9e){var i;for(i=0;i<this.length;i++){if(this[i]===_9e){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(_a0){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};Object.extend(this.options,_a0||{});try{var _a1=this.options.parameters.split("&");["ct","ck"].each(function(_a2){var _a3=encodeURI(_1.getCookie(_a2));if(!_a3){return false;}var rgx=new RegExp("^"+_a2+"=");if(!$A(_a1).find(function(e){return rgx.test(e);})){_a1.push(_a2+"="+_a3);}});this.options.parameters=_a1.join("&");}catch(x){}}});}__CDEXHR__=[];_1.XHR=function(url){var _a7=Object.extend({method:"GET",asynchronous:true,params:"",timeout:30,failOnTimeout:false,onAbort:null,onResponse:null,onFail:null,onTimeout:null},arguments[1]||{});var _a8={xhr:null,isdone:false,status:null,ondone:function(req){__CDEXHR__.push(req);try{this.status=this.xhr.transport.status;}catch(x){}if(this.isdone){return;}if(this.status==200){this.isdone=true;if(typeof _a7.onResponse==="function"){_a7.onResponse(req);}return true;}else{if(this.status==0){return this.onfail();}else{return this.onabort();}}},onabort:function(){if(this.isdone){return;}if(typeof _a7.onAbort==="function"){this.isdone=true;return _a7.onAbort();}else{this.onfail();}},onfail:function(){if(this.isdone){return;}this.isdone=true;if(typeof _a7.onFail==="function"){return _a7.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(_a7.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 _a7.onTimeout==="function"){return _a7.onTimeout();}}};url+=(url.match(/\?/)?"&":"?")+"rnd="+(new Date().getTime());_a8.xhr=new Ajax.Request(url,{method:_a7.method,asynchronous:_a7.asynchronous,parameters:_a7.params,onException:_a8.onexception.bind(_a8),onComplete:_a8.ondone.bind(_a8),onFailure:_a8.onfail.bind(_a8)});setTimeout(_a8.ontimeout.bind(_a8),_a7.timeout*1000);return {xhr:_a8.xhr,abort:function(){_a8.onabort();try{_a8.xhr.transport.abort();_a8.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 _af=arguments[0]||window.document;$A(_af.forms).each(function(FRM){["ck","ct"].each(function(_b1){var _b2=_1.getCookie(_b1);if(!_b2){return false;}if(FRM[_b1]){FRM[_b1].value=_b2;}else{var INP=_af.createElement("input");INP.setAttribute("type","hidden");INP.setAttribute("name",_b1);INP.setAttribute("value",_b2);FRM.appendChild(INP);}});});}};return fn;}();Event.onDOMReady(_1.CTGuard.deploy);if(typeof encodeURI!=="function"){var _b4=window.encodeURI=function(str){if(typeof encodeURIComponent==="function"){return encodeURIComponent(str);}else{if(typeof _b4==="function"){return _b4(str);}else{return escape(str);}}};}_1.base64=function(){var _b6={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(_b7){var _b8="";var _b9,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;_b7=_b6._utf8_encode(_b7);while(i<_b7.length){_b9=_b7.charCodeAt(i++);chr2=_b7.charCodeAt(i++);chr3=_b7.charCodeAt(i++);enc1=_b9>>2;enc2=((_b9&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else{if(isNaN(chr3)){enc4=64;}}_b8=_b8+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}return _b8;},decode:function(_bb){var _bc="";var _bd,chr2,chr3;var _be,enc2,enc3,enc4;var i=0;_bb=_bb.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<_bb.length){_be=this._keyStr.indexOf(_bb.charAt(i++));enc2=this._keyStr.indexOf(_bb.charAt(i++));enc3=this._keyStr.indexOf(_bb.charAt(i++));enc4=this._keyStr.indexOf(_bb.charAt(i++));_bd=(_be<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;_bc=_bc+String.fromCharCode(_bd);if(enc3!=64){_bc=_bc+String.fromCharCode(chr2);}if(enc4!=64){_bc=_bc+String.fromCharCode(chr3);}}_bc=_b6._utf8_decode(_bc);return _bc;},_utf8_encode:function(_c0){_c0=_c0.replace(/\r\n/g,"\n");var _c1="";for(var n=0;n<_c0.length;n++){var c=_c0.charCodeAt(n);if(c<128){_c1+=String.fromCharCode(c);}else{if((c>127)&&(c<2048)){_c1+=String.fromCharCode((c>>6)|192);_c1+=String.fromCharCode((c&63)|128);}else{_c1+=String.fromCharCode((c>>12)|224);_c1+=String.fromCharCode(((c>>6)&63)|128);_c1+=String.fromCharCode((c&63)|128);}}}return _c1;},_utf8_decode:function(_c4){var _c5="";var i=0;var c=c1=c2=0;while(i<_c4.length){c=_c4.charCodeAt(i);if(c<128){_c5+=String.fromCharCode(c);i++;}else{if((c>191)&&(c<224)){c2=_c4.charCodeAt(i+1);_c5+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=_c4.charCodeAt(i+1);c3=_c4.charCodeAt(i+2);_c5+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}}return _c5;}};return _b6;}();})();