(function(){if(typeof CDEFuncs==="undefined"||typeof Prototype==="undefined"){if(typeof _ERR_UNJS_==="undefined"){_ERR_UNJS_=window._ERR_UNJS_={};}if(self===top){_ERR_UNJS_["CDEFuncs.js"]="IPH Custom JS Functions";}else{alert("CDEFuncs is required! (CDEFuncs.js)");}return false;}var _1=window.CDE=function(){var _2="";var _3=["CDE.js"];var _4=[];var _5=[];$A(document.getElementsByTagName("script")).findAll(function(s){return (s.src&&s.src.match(/CDE\.js(\?.*)?$/));}).each(function(s){var _8=s.src.replace(/CDE\.js(\?.*)?$/,"");_2=_8;});var _9=function(_a){var _b=$A(document.getElementsByTagName("script")).any(function(s){return s.src&&s.src.match(_a);});var _d=_3.any(function(s){return s.match(_a);});return (_b||_d);};return {version:2.01,ENV:{PATH:_2},setValue:function(){Object.extend(this.ENV,arguments[0]||{});},BTNS:[],POPIMGS:["http://static.i.ph/3.9.0/images/pop-titlebg.gif","http://static.i.ph/3.9.0/images/pop-nw.gif","http://static.i.ph/3.9.0/images/pop-ne.gif","http://static.i.ph/3.9.0/images/pop-resize.gif","http://static.i.ph/3.9.0/images/pop-close.gif","http://static.i.ph/3.9.0/images/pop-minimize.gif","http://static.i.ph/3.9.0/images/pop-maximize.gif",],require:function(_f){var _10=arguments[1]||_2;var _11=_9(_f);var _12=(this.ENV.DEBUG_MODE)?_2+"../libs-src/":_2+"../libs/";if(!_11){_3.push(_f);var rnd=CDEFuncs.generateRandom(5);var _14=(this.ENV.DEBUG_MODE)?"?rnd="+rnd:"?ver="+this.ENV.VER;document.write("<script type=\"text/javascript\" src=\""+_10+_f+_14+"\"></script>");}},addInit:function(fn){if(typeof fn=="function"){_4.push(fn);}},addLibrary:function(_16,_17){_5.push({name:_16,path:_17});},init:function(){var _18=(this.ENV.DEBUG_MODE)?_2+"../libs-src/":_2+"../libs/";var _19=this;this.setValue({PATHLIBS:_18});_4.each(function(evt){Event.onDOMReady(evt);});CDEFuncs.preloadImages(_1.POPIMGS);},setPaths:function(){this.setValue({IMAGES_DIR:this.ENV.CDE_STATIC+"/menubar/images",BUTTONS_DIR:this.ENV.CDE_STATIC+"/menubar/btns",MENUBAR_DIR:"/calliope/menubar/src"});},cdeparams:function(){var _1b={ak:this.ENV.CDE_APPKEY,us:this.ENV.CDE_USAGE,tgp:this.ENV.CDE_TGTPATH,tgf:this.ENV.CDE_TGTFILE,cu:this.ENV.CDE_CURURL};if(this.ENV.CDE_USAGE=="blogs"){_1b.bn=this.ENV.BLOGNAME;_1b.bid=this.ENV.BLOG_ID;}return _1b;},buildCDEParams:function(url){return CDEFuncs.buildAsQuery(url,this.cdeparams());},errorMsg:function(str){if(this.ENV.DEBUG_MODE&&typeof str=="string"&&str!==""){alert(str);}},getbtn_header:function(){var _1e=arguments[0]||false;_1e=(_1e)?true:false;var _1f=this.ENV.BUTTONS_DIR+"/";_1f+=(!_1e)?this.BTNS[this.ENV.CDE_TGTFILE].hdr:this.BTNS[this.ENV.CDE_TGTFILE].hdrH;return _1f;},getbtn_title:function(){var _20=arguments[0]||false;_20=(_20)?true:false;var _21=this.ENV.BUTTONS_DIR+"/";_21+=(!_20)?this.BTNS[this.ENV.CDE_TGTFILE].tit:this.BTNS[this.ENV.CDE_TGTFILE].titH;return _21;}};}();_1.setValue(CDEFuncs.browser_info);_1.setValue({RTE_ALLOWED:["msie","firefox","mozilla"].any(function(b){return b==_1.ENV.BR;}),PRELOAD_IMAGES:[]});_1.BTNS["index.php"]={hdr:"edit_mainpage_header_hover.png",hdrH:"edit_mainpage_header.png",tit:"edit_mainpage_blog_title.png",titH:"edit_mainpage_blog_title_hover.png"};_1.BTNS["single.php"]={hdr:"edit_detailspage_header_hover.png",hdrH:"edit_detailspage_header.png",tit:"edit_detailspage_title_hover.png",titH:"edit_detailspage_title.png"};_1.BTNS["search.php"]={hdr:"edit_searchpage_header_hover.png",hdrH:"edit_searchpage_header.png",tit:"edit_searchpage_blog_title.png",titH:"edit_searchpage_blog_title_hover.png"};_1.BTNS["archive.php"]={hdr:"edit_archivepage_header_hover.png",hdrH:"edit_archivepage_header.png",tit:"edit_archivepage_blog_title.png",titH:"edit_archivepage_blog_title_hover.png"};var _23=window.CDEUI=function(){return {getWindowScroll:function(){var w=window;var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft;}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft;}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight;}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight;}else{W=body.offsetWidth;H=body.offsetHeight;}}}return {"top":T,left:L,width:W,height:H};}};}();Object.extend(_1,{Topbar:{isOpen:false,viewWrap:"iphViewWrap",views:{prog:"iphProgress",login:"iphLogin",settings:"iphSettings",stats:"iphStats"},buttons:{accounts:{login:"account-login",settings:"account-settings",stats:"account-stats"}},showLogin:function(){$(this.viewWrap).show();$(this.views.prog).show();return false;},init:function(){if(!$("iphTopbarWrap")||!$("iphTopbarLower")){return;}this.showLogin=this.showLogin.bind(this);var _26=$("account-login");if(typeof _26!=="undefined"){_26.onclick=_1.Login.open;}$$("#iphLogin iframe")[0].src="/panel/topbar/login.htm";this.initSites();this.getNews();},initSites:function(){var ce={b:"account-blogs",i:"account-photos",m:"account-audio"};var _28=$(ce.b).firstChild;_28.href="/blogs/"+_1.ENV.ACCOUNT_LOGIN+"/"+(_1.ENV.IS_EDITMODE?"?emode=on":"");_28.title="Commentary, rants, musings and more";if(_1.ENV.IS_LOGGEDIN&&_1.ENV.IS_OWNER){return false;}var _29=function(_2a){if(!_2a["c"]){return false;}var c=_2a["c"];if(!c.inArray("b")){$(ce.b).hide();}if(!c.inArray("i")){$(ce.i).hide();}};if(!_1.ENV.SITES){var xhr=CDEFuncs.XHR("/admin/sites.json",{method:"GET",onResponse:function(req){_1.ENV.SITES=JSON.parse(req.responseText);_29(_1.ENV.SITES);}});}else{_29(_1.ENV.SITES);}},getNews:function(){var _2e=function(n){if(!n||!n.link||!n.title){return false;}var _30=$("iphNews");var _31=$("iphNewsWrap");_30.href=n.link;_30.innerHTML=n.title;_31.show();};var xhr=CDEFuncs.XHR("/panel/topbar/news-json.php",{method:"GET",onResponse:function(req){resp=JSON.parse(req.responseText);if(resp.success===1){_2e({link:resp.data.l,title:resp.data.t});}}});}}});_1.addInit(_1.Topbar.init.bind(_1.Topbar));_1.addInit(function(){if(!_1.ENV.IS_LOGGEDIN){return false;}var msg="You are using a browser that isn't completely compatible with i.PH"+"<br/> You may experience quirky behaviour or irregularities. "+"<br/><br/>"+"<a href=\"http://www.mozilla.com/firefox/\" target=\"_blank\" title=\"Download Firefox\">"+"Please switch to a browser that is compatible with i.PH </a>";var _35=function(){var div=document.createElement("div");document.body.appendChild(div);$(div).addClassName("iphwarning");$(div).innerHTML=msg;};var _37=function(){var _38=false;var _os=_1.ENV.OS.toLowerCase();var _br=_1.ENV.BR.toLowerCase();var _3b=_1.ENV.BR_ver;var _ua=navigator.userAgent.toLowerCase();switch(_br){case "firefox":_38=(_3b==2||_3b>=3);break;case "msie":_38=(_os=="windows"&&(_3b==6||_3b==7));break;case "safari":if(!_ua.match(/chrome/i)){var m=_ua.match(/version\/([0-9.]+)/i);_38=("3.1"<=m[1]);}break;default:break;}if(_38&&_os=="mac"&&!_ua.match(/intel/i)){_38=false;}return _38;};if(!_37()){return _35();}});_1.Posts=function(){var _3e="/calliope/rte/index.php";var _3f={resizable:true,scrollbars:true,name:"rtepop"};var _40=[];var RTE={activeWindows:{},open:function(_42){if(!_1.ENV.RTE_ALLOWED){_1.Pop.open("/calliope/menubar/src/nortemessage.php",{title:"Browser Not Compatible",h:250},true);return false;}if(!_42){return false;}if(_1.WorkOffline&&_1.WorkOffline.is_enabled){delete _42.ru;}var url=CDEFuncs.buildAsQuery(_3e,_42);if(_1.WorkOffline&&_1.WorkOffline.is_enabled){if(!_1.WorkOffline.is_connected&&_42.method!=="create"){_1.GMsgr.show("Editing Post is not available while Offline",{autoCloseIn:5,hasClose:true});return false;}if(_1.WorkOffline.is_connected){url+="&rnd="+(new Date().getTime());}var _44=[_42.method,_42.blogid,_42.itemid].findAll(function(opt){return opt;}).join("_");if(_42.method==="create"){_44+="_"+new Date().getTime();}var _46=this.activeWindows[_44]||null;if(!_46||_46.closed){this.activeWindows[_44]=CDEFuncs.popUp(url,800,600,{name:_44});}else{alert("Post Editor is still active. You may continue to Edit and/or Publish your post before starting another.");_46.focus();}}else{location.href=url;}},del:function(_47){if(!_47){return false;}if(_1.WorkOffline&&_1.WorkOffline.is_enabled&&!_1.WorkOffline.is_connected&&_47.method!=="create"){_1.GMsgr.show("Deleting Post is not available while Offline",{autoCloseIn:5,hasClose:true});return false;}_47.itemTitle=CDEFuncs.truncate(_47.itemTitle,50);var _48="DELETE POST\n\n"+"Are you sure you want to delete the post:\n"+"\""+CDEFuncs.urldecode(_47.itemTitle)+"\""+"?";if(window.confirm(_48)){var _49=$("post-"+_47.postid);var _4a=_1.ENV.CDE_TGTFILE=="single.php";if(!_4a){var _4b=_49.innerHTML;var div=document.createElement("div");div.innerHTML="<center><div style=\"margin:30px;padding:10px;\">"+"<img src=\"http://static.i.ph/3.9.0/menubar/images/wait.gif\"/> <br/><br/>"+"Deleting Post...</div></center>";_49.parentNode.insertBefore(div,_49);_49.hide();}else{_1.Waiter.open({content:"Deleting..."});}var _4d="/calliope/menubar/src/delpost.php?";_4d=CDEFuncs.buildAsQuery(_4d,_47);_47.formaction="deleteitem";CDEFuncs.XHR(_4d,{method:"POST",params:$H(_47).toQueryString(),onResponse:function(req){var _4f=JSON.parse(req.responseText);if(_4f&&_4f.isok){if(_1.ENV.CDE_TGTFILE=="single.php"){top.location.href="/";}else{Element.remove(_49);div.innerHTML="<div style=\"margin:10px;padding:10px;\" class=\"entry\">"+"<p style=\"color: #F00;\"><strong>This post has been deleted</strong></p>"+"</div>";new Effect.Highlight(div,{duration:5,afterFinish:function(){Element.remove(div);}});}}else{_1.Waiter.close();alert(_4f.errmsg||"An error occurred while trying to delete the post");Element.show(_49);Element.remove(div);}},onFail:function(){_1.Waiter.close();alert("Unable to perform the process. Please check your network connection");Element.show(_49);Element.remove(div);}});}}};var _50=function(_51){var _52=DomBuilder.apply();var _53={blogid:_51.blogID||_1.ENV.BLOG_ID,blog:_51.blog||_1.ENV.BLOGNAME};var _54={newpost:function(){var el=$(_51.elem)||$("em_newpost");var _56=_52.SPAN({style:"float:right;display:inline"});var IMG=_52.IMG({src:_1.ENV.CDE_STATIC+"/menubar/btns/new_post.png"});var _58=_52.SPAN({title:"Create a new blog post.",style:"cursor:pointer;display:inline"},IMG);_56.appendChild(_58);_56.appendChild(_52.BR());el.appendChild(_56);el.appendChild(_52.BR({style:"clear:both;"}));CDEFuncs.hoverize(IMG,IMG.src,_1.ENV.CDE_STATIC+"/menubar/btns/new_post_hover.png");Object.extend(_53,{method:"create",wintitle:"Create Post",ru:_1.ENV.CDE_CURURL});Event.observe(IMG,"click",RTE.open.bind(RTE,_53));},editpost:function(){var el=$("em_postedit_"+_51.postID);var _5a=_52.SPAN({style:"float:right;display:inline"});var IMG=_52.IMG({src:_1.ENV.CDE_STATIC+"/menubar/btns/edit_post.png","class":"imgbtn_editpost"});var _5c=_52.SPAN({title:"Edit this blog post.",style:"cursor:pointer; display: inline"},IMG);_5a.appendChild(_5c);el.appendChild(_5a);CDEFuncs.hoverize(IMG,IMG.src,_1.ENV.CDE_STATIC+"/menubar/btns/edit_post_hover.png");Object.extend(_53,{method:"retrieve",wintitle:"Edit Post",itemid:_51.postID,itemTitle:_51.posttitle,ru:_1.ENV.CDE_CURURL});Event.observe(IMG,"mouseover",Element.addClassName.bind(this,_51.elem,"entry_editmode"));Event.observe(IMG,"mouseout",Element.removeClassName.bind(this,_51.elem,"entry_editmode"));Event.observe(IMG,"click",RTE.open.bind(RTE,_53));},delpost:function(){var el=$("em_postdel_"+_51.postID);var _5e=_52.SPAN({style:"float:right;display:inline"});var IMG=_52.IMG({src:_1.ENV.CDE_STATIC+"/menubar/btns/delete_item.png","class":"imgbtn_delpost"});var _60=_52.SPAN({title:"Delete this blog post.",style:"cursor:pointer; display: inline"},IMG);_5e.appendChild(_60);el.appendChild(_5e);CDEFuncs.hoverize(IMG,IMG.src,_1.ENV.CDE_STATIC+"/menubar/btns/delete_item_hover.png");Object.extend(_53,{method:"retrieve",wintitle:"Edit Post",postid:_51.postID,itemTitle:_51.posttitle});Event.observe(IMG,"mouseover",Element.addClassName.bind(this,_51.elem,"entry_editmode"));Event.observe(IMG,"mouseout",Element.removeClassName.bind(this,_51.elem,"entry_editmode"));Event.observe(IMG,"click",RTE.del.bind(RTE,_53));}};if(_51.isNew){_54.newpost();}else{if(_51.hasEdit){_54.editpost();}if(_51.hasDelete){_54.delpost();}}};var fn={_list:[],RTE:RTE,add:function(){var _62=Object.extend({isNew:false,hasEdit:false,hasDelete:false,isDraft:false,elem:"",title:"",blogID:0,postID:0},arguments[0]||{});_50(_62);}};return fn;}();_1.Login={open:function(){_1.ENV.COOKIE_ENABLED=false;try{var _63="_ck_"+new Date().getTime();CDEFuncs.setCookie("cktest",_63,"/");if(CDEFuncs.getCookie("cktest")==_63){_1.ENV.COOKIE_ENABLED=true;CDEFuncs.deleteCookie("cktest");}else{alert("Your browser's cookie functionality is turned off. Please turn it on.");return false;}}catch(x){}_1.Topbar.showLogin();}};Object.extend(_1,{Pop:{curid:false,checker:false,_hiddenTags:[],_defaults:{w:300,h:100,title:"",processMsg:"Please wait...",zIndex:1200,resizable:true,closable:true,minimizable:false,maximizable:false,draggable:true,showEffect:Element.show,hideEffect:Element.hide,preloadWindow:true,autofixWindow:true,checktimeout:true,allowIntercept:false},_themes:{info:"calliope_status",config:"cdepopup"},_getNewId:function(){return "cdepop"+(new Date().getTime());},winpop:null,resizeTo:function(){var _64=Object.extend({w:this.opts.width,h:this.opts.height},arguments[0]||{});Windows.close(this.winpop.getId());this.winpop.setSize(_64.w,_64.h);this.winpop.showCenter(true);if(MlFFFix.isNeeded()){MlFFFix.setSize();MlFFFix.setXY();}},open:function(url){this.close();var _66=Object.extend({parent:$("CDELYR")||document.body},this._defaults);Object.extend(_66,arguments[1]||{});_66.width=_66.width||_66.w;_66.w=null;_66.height=_66.height||_66.h;_66.h=null;_66.url=url;_66.className=this._themes.config;this.opts=_66;var _67=this;var _68=arguments[2]||false;if(_1.ENV.BR=="opera"){_68=false;}var _69=function(){if(!_67.opts.checktimeout){return true;}var _6a=_67.winpop.getId()+"_content";var doc=false,content=false,href=false;Try.these(function(){doc=$(_6a).contentWindow.document.documentElement;href=$(_6a).contentWindow.location.href;content=doc.textContent||doc.outerText;},function(){doc=$(_6a).contentDocument;href=$(_6a).location.href;content=doc.body.innerHTML;},function(){doc=window.frames[_6a].document;href=window.frames[_6a].location.href;content=doc.body.innerHTML;});return content||href;};var _6c=function(){var _6d=arguments[0]||false;if(_69()===false||_6d){_1.Waiter.close();if(_67.checker){window.clearInterval(_67.checker);}alert("Unable to load the window");return false;}return true;};this.opts.onload=(function(_6e){if(!_6c()){return false;}if(_67.checker){window.clearInterval(_67.checker);}try{if(this.opts.preloadWindow){_1.Waiter.close();this.winpop.showCenter(_6e);if(MlFFFix.isNeeded()){MlFFFix.showFix(this.winpop);}}if(this.opts.autofixWindow){CDEFuncs.resizePopToFit(this.opts);}if(this.opts.allowIntercept){this.actionIntercept();}else{_67.opts.iframe=frames[_67.winpop.getId()+"_content"];CDEFuncs.CTGuard.deploy(_67.opts.iframe.document);}}catch(x){throw new Error(x.message||x.description);}}).bind(this,_68);this.curid=this._getNewId();this.winpop=new Window(this.curid,this.opts);var _6f=new Date().getTime();var _70=1.5*60*1000;this.checker=window.setInterval((function(){if(CDEFuncs.settings.BR=="safari"){if(((new Date().getTime())-_6f)>_70){_6c(true);}}if(!_6c()){return false;}}),5000);if(this.opts.preloadWindow){_1.Waiter.open({content:"Please wait..."});}else{this.winpop.showCenter(_68);if(MlFFFix.isNeeded()){MlFFFix.showFix(this.winpop);}}this.closeObserver={onClose:_67.actionClose.bind(_67),onDestroy:function(evt,win){if(_67.winpop==win){Windows.removeObserver(this);}}};Windows.addObserver(this.closeObserver);$(_1.Pop.winpop.getId()+"_content").setStyle({overflow:"auto"});return false;},setCenter:function(){var wS=WindowUtilities.getWindowScroll();var _74=wS.height/2-this.opts.height/2;var _75=wS.width/2-this.opts.width/2;this.winpop.setLocation(_74,_75);},close:function(e){if(this.winpop!==null&&this.winpop.isVisible&&this.winpop.isVisible()){if(!e){var e=window.event||{};}Windows.close(e,this.winpop.getId());this.winpop.destroy();this.winpop=null;}},fixHeight:function(){var _77=Element.getDimensions(frames[this.winpop.getId()+"_content"].document.body)["height"];var _78=_23.getWindowScroll()["height"];var _79=_77>_78?_78-50:_77;this.resizeTo({h:_79});},open_info:function(_7a){this.close_info();var _7b=Object.extend({},this._defaults);_7b.width=_7b.width||_7b.w;_7b.height=_7b.height||_7b.h;_7b.className=this._themes.info;_7b.resizable=false;_7b.closable=false;_7b.draggable=false;Object.extend(_7b,arguments[1]||{});switch(arguments[2]){case 0:Dialog.info(_7a,{windowParameters:_7b},_7b);break;case 1:Dialog.alert(_7a,{windowParameters:_7b},_7b);break;case 3:Dialog.confirm(_7a,{windowParameters:_7b},_7b);break;default:Dialog.info(_7a,{windowParameters:_7b},_7b);break;}},close_info:function(){Dialog.closeInfo();},formSubmit:function(_7c,_7d){var _7e=_7d||"Processing the form...";_7c.submit();_1.Waiter.open({content:_7e});},formIntercept:function(){Object.extend(this.opts,{onload:this.actionIntercept.bind(this)});},actionIntercept:function(){_this=this;this.opts.iframe=frames[this.winpop.getId()+"_content"];CDEFuncs.CTGuard.deploy(this.opts.iframe.document);$A(this.opts.iframe.document.forms).each(function(f){var _80=$A(f.elements).findAll(function(e){return (e.type=="button"||e.type=="submit");});_80.each(function(b){if(b.type=="button"&&(b.value=="Cancel")){b.onclick=_this.actionCancel.bind(_this);}if(b.value.match(/Save|Submit|Update/i)||b.type=="submit"){b.onclick=_this.actionSubmit.bind(_this,f);}});f.onsubmit=_this.actionSubmit.bind(_this);});},actionClose:function(){if(typeof this.opts.doClose=="function"){return this.opts.doClose();}},actionCancel:function(){this.close();},actionBeforeSubmit:function(f){if(typeof this.opts.doBeforeSubmit=="function"){return this.opts.doBeforeSubmit(f);}else{return true;}},actionSubmit:function(f){if(this.actionBeforeSubmit(f)){_1.Waiter.open({content:this.opts.processMsg});this.opts.form=f;this.opts.formObj=Form.serialize(f).toQueryParams();f.submit();return false;}else{return false;}},actionDuringSubmit:function(){Event.stopObserving(this.opts.iframe,"unload",this.actionDuringSubmit.bind(this));},actionAfterSubmit:function(){_1.Waiter.close();if(typeof this.opts.doAfterSubmit=="function"){this.opts.doAfterSubmit(arguments[0]);}},actionTry:function(f){if(this.actionBeforeTry(f)){if(typeof this.opts.doTry=="function"){this.opts.doTry(f);}}},actionBeforeTry:function(f){if(typeof this.opts.doBeforeTry=="function"){return typeof this.opts.doBeforeTry(f);}else{return true;}},actionApply:function(f){if(this.actionBeforeApply(f)){if(typeof this.opts.doApply=="function"){this.opts.doApply(f);}else{new Ajax.Request(f.action,{method:"post",parameters:Form.serialize(f),asynchronous:true,evalScripts:true,onComplete:this.actionAfterApply.bind(this)});}}},actionBeforeApply:function(f){if(typeof this.opts.doBeforeApply=="function"){return this.opts.doBeforeApply(f);}else{return true;}},actionAfterApply:function(){if(typeof this.opts.doAfterApply=="function"){return this.opts.doAfterApply();}}}});Object.extend(_1,{Waiter:{open:function(){var box=Object.extend({height:100,width:200,title:"",zIndex:1250,content:"Please wait...",resizable:false,closable:false,minimizable:false,maximizable:false,draggable:false},arguments[0]||{});var txt="<br/>";txt+="<br/><br/><h4 style='size:12px;'>"+box.content+"</h4>";_1.Pop.open_info(txt,box);},close:function(){_1.Pop.close_info();}}});var _8b=window.CDEImages={preload:function(_8c){},applyImgBg:function(el,_8e){if(typeof el==="string"){el=$(el);}el.style.backgroundImage="url("+_8e+")";var img=new Image(100,100);img.src=_8e;}};_1.Widgets=function(){var _90=[];var _fn={get:function(_92){return _90.find(function(w){return w.name===_92;});},buildIFRAME:function(w){var _95="ifr-"+w.inst;var _96=CDEFuncs.buildAsQuery(w.url,{id:_95,name:_95});var IFR=document.createElement("iframe");IFR.setAttribute("frameborder","0");IFR.setAttribute("src",_96);IFR.setAttribute("id",_95);IFR.setAttribute("name",_95);return IFR;}};var fn={list:function(){return _90;},add:function(_99){var _9a=Object.extend({name:_99,inst:"",url:"",el:"",h:300},arguments[1]||{});_90.push(_9a);Event.onDOMReady(function(){_1.Widgets.load.call(_1.Widgets,_99);});},get:function(_9b){return _fn.get(_9b);},load:function(_9c){var _9d=_fn.get(_9c);if(!_9d||!$(_9d.el)||!_9d.url){return false;}var IFR=_fn.buildIFRAME(_9d);$(_9d.el).update("");$(_9d.el).appendChild(IFR);Element.setStyle(IFR.name,{height:_9d.h+"px",width:"100%"});},loadAll:function(){_90.each(function(w){_1.Widgets.load(w.name);});}};return fn;}();_1.WidgetFrames=function(){var fn={set:function(_a1,w,h){if(ifr=$(_a1)){var css={};if(w){ifr.setAttribute("width",w);css.width=w+"px";}if(h){ifr.setAttribute("height",h);css.height=h+"px";}Element.setStyle(_a1,css);}}};return fn;}();CDEFuncs.refresh=function(){var txt=arguments[0]||"Please wait while we reload the page...";_1.Waiter.open({content:txt});if(top.location.reload){top.location.reload();}else{top.location.href=_1.ENV.CDE_CURURL;}};CDEFuncs.redirect=function(url,win){var txt="Redirecting...";_1.Waiter.open({content:txt});if(url){var _a9=win||window;_a9.location.href=url;}};_1.addInit(CDEFuncs.CTGuard.deploy);var _aa=window.MlFFFix={isNeeded:function(){var _ab=false;if(["firefox","mozilla"].any(function(b){return b==_1.ENV.BR;})&&["Linux","Mac"].any(function(o){return o==_1.ENV.OS;})){with(document){if(getElementsByTagName("embed").length+getElementsByTagName("object").length){_ab=true;}}}return _ab;},showFix:function(win){var _af="MacLinuxFFFix";if($(_af)){return false;}this.win=win;this.tgtID=(win.getId)?$(win.getId()):this.win||$(this.win);this.__fix=document.createElement("iframe");this.__fix.id=_af;this.__fix.setStyle({position:"absolute",zIndex:this.tgtID.getStyle("zIndex")-1});this.setSize();this.setXY();this.parent=$("CDELYR")||document.body,this.parent.insertBefore(this.__fix,this.parent.firstChild);this.evtScroll=this.setXY.bindAsEventListener(this);Event.observe(window,"scroll",this.evtScroll);Event.observe(window,"resize",this.evtScroll);var _b0=this;this.evtWins={onEndResize:this.setSize.bind(this),onEndMove:this.setXY.bind(this),onClose:this.destroy.bind(this),onDestroy:this.destroy.bind(this)};Windows.addObserver(this.evtWins);},setSize:function(){if(this.tgtID){var d=this.tgtID.getDimensions();this.__fix.setStyle({width:(d.width)+"px",height:(d.height+40)+"px"});}},setXY:function(){if(this.tgtID){var p=Position.cumulativeOffset(this.tgtID);this.__fix.setStyle({"top":p[1]+"px",left:p[0]+"px"});this.setSize();}},destroy:function(){Event.stopObserving(window,"scroll",this.evtScroll);Event.stopObserving(window,"resize",this.evtScroll);try{Element.remove(this.__fix);}catch(e){}try{Windows.removeObserver(this.evtWins);}catch(e){}}};})();
