
if(typeof YAHOO=="undefined"||!YAHOO){throw new Error('YAHOO not declared (requires YUI)');}
YAHOO.namespace('Toolkit');(function(){var Y=YAHOO,Dom=Y.util.Dom,ArrayNative=Array.prototype;Y.lang.augmentObject(Dom,{setStyles:function(el,styles)
{for(var s in styles){Dom.setStyle(el,s,styles[s]);}},down:function(rootEl,classname,tagname)
{return Dom.getElementsByClassName(classname,tagname||"*",Dom.get(rootEl))[0];}});Y.lang.augmentObject(Y,{bind:function(f,c)
{var a=ArrayNative.slice.call(arguments,2);return function(){return f.apply(c||f,ArrayNative.slice.call(arguments,0).concat(a));};}});})();(function(){var Y=YAHOO,L=Y.lang,Native=Array.prototype;Y.Array=function(o)
{a=[];for(i=0,l=o.length;i<l;i=i+1){a.push(o[i]);}
return a;};Y.Array.each=(Native.forEach)?function(a,f,o){Native.forEach.call(a||[],f,o||Y);return Y;}:function(a,f,o){var l=(a&&a.length)||0,i;for(i=0;i<l;i=i+1){f.call(o||Y,a[i],i,a);}
return Y;};})();(function(){var Y=YAHOO,Toolkit=Y.Toolkit;Y.lang.augmentObject(Toolkit,{toQueryString:function(obj,name){var i,l,s=[];if(Y.lang.isNull(obj)||Y.lang.isUndefined(obj)){return name?encodeURIComponent(name)+'=':'';}
if(Y.lang.isBoolean(obj)){obj=obj?1:0;}
if(Y.lang.isNumber(obj)||Y.lang.isString(obj)){return encodeURIComponent(name)+'='+encodeURIComponent(obj);}
if(Y.lang.isArray(obj)){name=name;for(i=0,l=obj.length;i<l;i++){s.push(arguments.callee(obj[i],name));}
return s.join('&');}
var begin=name?name+'[':'',end=name?']':'';for(i in obj){if(obj.hasOwnProperty(i)){s.push(arguments.callee(obj[i],begin+i+end));}}
return s.join("&");}});})();(function(){var lineNr=0,isDOMReady=!!document.getElementsByTagName('body')[0],history=[],div=false;function build()
{var top,hd,bd;top=document.createElement('div');top.appendChild((hd=document.createElement('div')));top.appendChild((bd=document.createElement('div')));top.style.position='absolute';top.style.right='0';top.style.bottom='0';top.style.padding='2px';top.style.background='#ff4040';top.style.color='#fff';top.style.font='11px/13px "Courier New", monospace';top.style.width='300px';top.style.overflow='hidden';top.style.cursor='pointer';hd.style.padding='0 0 2px';hd.style.display='block';bd.style.background='#ffe0e0';bd.style.color='#000';bd.style.width='300px';bd.style.height='200px';bd.style.overflow='scroll';bd.style.display='none';hd.innerHTML="Javascript Log (mouse hover to toggle)";hd.onmouseover=function()
{var disp=bd.style.display==='block';if(disp){bd.style.display='none';}
else{bd.style.display='block';}
return false;};document.getElementsByTagName('body')[0].appendChild(top);return bd;}
function output(message)
{var t=document.createTextNode(''+lineNr+': '+message),br=document.createElement('br');div.appendChild(t);div.appendChild(br);lineNr++;}
function log()
{var message;if(!isDOMReady){if(!(isDOMReady=!!document.getElementsByTagName('body')[0])){history.push("[DOM!READY] "+arguments[0]);return;}}
if(!div)
{div=build();while((message=history.shift()))
{output(message);}}
output(arguments[0]);if(typeof(div.scrollTop)!=="undefined"){div.scrollTop=div.scrollHeight;}}
YAHOO.Toolkit.Console={};if(typeof(window.console)!=="undefined"&&typeof(window.loadFirebugConsole)!=="undefined")
{YAHOO.Toolkit.Console.log=function()
{console.log.apply(console,arguments);};}
else{YAHOO.Toolkit.Console.log=log;}})();if(typeof YAHOO=="undefined"||!YAHOO){throw new Error('YAHOO not declared (requires YUI)');}
YAHOO.namespace('SSLP');var App=YAHOO.SSLP;App.env={FIX_IE_DROPDOWNS:true,FIX_IE_DROPDOWN_VERSION:6,AUTORUN_ENABLED:true};App.Helper={createClass:function(px)
{var fn=function(){return this.init.apply(this,arguments);};if(px){fn.prototype=px;}
return fn;},extend:function(subc,superc,overrides){YAHOO.lang.extend(subc,superc,overrides);}};(function(){App.Helper.TRON=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,TRON=App.Helper.TRON;TRON.CSS_CLASS='JsTRON';TRON.STRING_SEP='~';TRON.STATUS_EMPTY=-1;TRON.STATUS_FAILED=0;TRON.STATUS_SUCCESS=1;TRON.STATUS_PROGRESS=2;TRON.handleErrors=function(tron)
{var errors=tron.getGlobalErrors(),options,useRefresh=tron.getAction()==="refresh",useReload=tron.getAction()==="reload",REFRESH_PAGE="refresh-page";if(!errors.length){if(tron.getAction()==="reload"){window.location.reload();}else{return;}}
if(!App.Ui||!App.Ui.AjaxDialog){window.alert(errors.join("\n"));return;}
if(!useReload){options={title:tron.getReturnValues().dialogTitle||(App.env.localize&&App.env.localize.GLOBAL_ERROR_TITLE)||"Oops",body:"<p>"+errors.join("<br/>")+"</p>",icon:"warning"};if(useRefresh){options.buttons=[{label:App.env.localize.REFRESH_PAGE,cust:REFRESH_PAGE+" reload"}];}
dialogId=App.Ui.Helper.generateDialogMarkup(options);oDialog=new App.Ui.AjaxDialog(dialogId,{useMarkup:true});if(useRefresh)
{function refreshHandler(e,el){window.location.reload();return false;}
oDialog.on(REFRESH_PAGE,refreshHandler);}
oDialog.show();}else{window.location.reload();return false;}};TRON.prototype={oJson:null,init:function(source)
{var i,inputs,oJson={status:TRON.STATUS_EMPTY,action:'',returnValues:{},globalErrors:[],globalMessages:[]};if(source.nodeType)
{if(!Dom.hasClass(source,TRON.CSS_CLASS)){source=Dom.getElementsByClassName(TRON.CSS_CLASS,'div',source)[0];}
if(!source){App.log("App.Helper.TRON() No TRON in container (%o)",source);this.oJson=oJson;return;}
inputs=Y.Array(source.getElementsByTagName('input'));for(i=0;i<inputs.length;i++)
{var el=inputs[i],propNames=el.getAttribute('name').split('.'),propValue=el.value;switch(propNames[0]){case'status':oJson.status=parseInt(propValue,10);break;case'action':oJson.action=propValue;break;case'returnValues':oJson.returnValues[propNames[1]]=propValue;break;case'globalErrors':case'globalMessages':oJson[propNames[0]]=Y.lang.trim(propValue)?propValue.split(TRON.STRING_SEP):[];break;default:oJson[propNames[0]]=propValue;break;}}}
else if(Y.lang.isString(source))
{try{oJson=Y.lang.JSON.parse(source);}catch(e){App.halt("App.Helper.TRON()  Invalid JSON format (%o)",source);}}
else{oJson=Y.lang.merge(oJson,source);}
if(!Y.lang.isNumber(oJson.status)||!Y.lang.isObject(oJson.returnValues)||!Y.lang.isArray(oJson.globalErrors)||!Y.lang.isArray(oJson.globalMessages)){App.halt("App.Helper.TRON()  Invalid TRON format (%o)",oJson);}
this.oJson=oJson;},isEmpty:function(){return this.oJson.status===TRON.STATUS_EMPTY;},isSuccess:function(){return this.oJson.status===TRON.STATUS_SUCCESS;},getStatus:function(){return this.oJson.status;},getAction:function(){return this.oJson.action;},getReturnValues:function(){return this.oJson.returnValues;},getGlobalErrors:function(){return this.oJson.globalErrors;},getGlobalMessages:function(){return this.oJson.globalMessages;}};})();(function(){var HEADER_AUTHENTICATE="SSLS-AUTHENTICATE",HEADER_SESSIONEXPIRED="SSLS-SESSIONEXPIRED",HEADER_SELECTSITE="SSLS-SELECTSITE",HEADER_SSOREDIRECT="Ssls-Ssoredirect",HEADER_REDIRECTURL="Ssls-Redirecturl",HEADER_UNEXPECTED="Ssls-Unexpected";App.AjaxFilter={onSuccess:function(o)
{return true;},onFailure:function(o)
{App.log('AjaxFilter.onFailure(%o)',o);if(o.status===500)
{if(o.getResponseHeader[HEADER_AUTHENTICATE]==='true'||o.getResponseHeader[HEADER_SESSIONEXPIRED]==='true'||o.getResponseHeader[HEADER_SELECTSITE]==='true'||o.getResponseHeader[HEADER_SSOREDIRECT]==='true'||o.getResponseHeader[HEADER_UNEXPECTED]=='true')
{var location=o.getResponseHeader[HEADER_REDIRECTURL]||false;if(location!==false)
{App.alert('(DEVELOPER MSG) HTTP 500 + SSLS-REDIRECTURL to:'+location);window.location.href=location;}
return false;}}
return true;}};})();(function(){var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,THEME_DIALOG_CLASS="themed-dialog";Y.lang.augmentObject(App,{Toolkit:YAHOO.Toolkit,init:function()
{App.log("App.init()");this.globalED=new App.Ui.EventDelegator(document.body,"click");this.initGlobalEvents();this.initFormElements();if(App.Ui&&App.Ui.AjaxRequest){App.Ui.AjaxRequest.prototype.responseFilter=App.AjaxFilter;}
if(this.isLandingPage())
{if(App.LandingPage){App.LandingPage.init();}
else
{App.alert("App.LandingPage is not defined");}}
App.log("App.init() SUCCESSFUL");},initGlobalEvents:function()
{this.globalED.on("admin-logout-link",function(e,el){return App.Ui.Helper.openAjaxDialog({srcHref:el,successUrl:App.env.logoutUrl});});this.globalED.on("wt",this.onWebTrendsLink,this);if(App.Ui.ImageLightbox){this.globalED.on(App.Ui.ImageLightbox.CLASS_IMAGE_LIGHTBOX,this.onImageLightbox,this);}
this.globalED.on("open-pageproperties",this.onPageProperties,this);this.globalED.on("ajax-dialog",function(e,el){return App.Ui.Helper.openAjaxDialog({srcHref:el});});this.globalED.on("toggle",this.onToggle,this);this.globalED.on("open-dialog",function(e,el){return App.Ui.Helper.openAjaxDialog({srcHref:el,successUrl:window.location.href});});this.shareED=new App.Ui.EventDelegator(document.body,["mousedown","click"]);this.shareED.on("share",this.onShare,this);this.shareED.on("embed-code",this.onShowEmbed,this);},onToggle:function(e,el){Event.stopEvent(e);App.Ui.toggle(el);},onShare:function(e,el){App.log("onShare clicked ",e,el);this.share.linkEl=el;this.share.shareLink=this.share.linkEl.href;if(e.type=="mousedown"){this.share.init(el);}},onShowEmbed:function(e,el){if(e.type=="click"){App.log("onShowEmbed clicked ",e,el);Event.stopEvent(e);this.share.showEmbed(el);}},share:{LABEL_SHOW:"show",linkEl:null,shareLink:"",shareType:false,module:null,moduleId:0,init:function(el){App.log("App.share.init() ",this);this.linkEl=el;this.shareLink=this.linkEl.href;this.shareType=this.get_share_type();var containerEl=Dom.getAncestorByClassName(el,"m_share");App.log(">>> containerEl ",containerEl);if(containerEl.id=="share_social"){this.linkDefault();}else if(containerEl.id.indexOf("_box")>-1){App.log("THIS IS A LIGHTBOX SHARE");var shareContainerEl=Dom.getAncestorByClassName(this.linkEl,"m_share");if(/_(m[\d]+)/.test(shareContainerEl.id)){this.moduleEl=Dom.get(RegExp.$1);this.clickType="lightbox";App.log("found module ",this.moduleEl);this.linkModule();}else App.log("ERROR couldn't find matching module for lightbox image");}else{this.moduleEl=Dom.getAncestorByClassName(this.linkEl,"module");this.linkModule();};},linkDefault:function(){App.log("App.share.linkDefault() - SHARE page the default way, link will remain unchanged");},linkModule:function(){App.log("App.share.linkModule() - SHARE module");if(this.moduleEl){this.moduleId=parseInt(this.moduleEl.id.substring(1),10);App.log("this.moduleId ",this.moduleId,App.ModuleMgr.modules);if(this.moduleId!=0&&App.ModuleMgr.modules[this.moduleId]){this.module=App.ModuleMgr.modules[this.moduleId];var moduleType=this.module.oModuleDef.module_class;switch(moduleType){case"PICTURE_VIEWER":this._update_pic_link();break;case"PICTURE_CAROUSEL":this._update_pic_link();break;case"PICTURE_COVERFLOW":this._update_pic_link();break;case"SHARE_TOOLBAR":this.linkDefault();break;default:this._add_module_anchor();}}else{App.log("ERROR: can't find a module with id ",this.moduleId);}}},showItem:function()
{App.log("App.share.showItem() ",document.location.hash,document.location.search);if(document.location.hash=="")return false;this.moduleId=parseInt(document.location.hash.substring(2),10);if(this.moduleId==0||!App.ModuleMgr.modules[this.moduleId]){App.log("ERROR: requested module does not exist (anymore)");return false;}
this.module=App.ModuleMgr.modules[this.moduleId];this.moduleType=this.module.oModuleDef.module_class;App.log("moduleType ",this.moduleType);switch(this.moduleType){case"PICTURE_VIEWER":this._show_pic();break;case"PICTURE_CAROUSEL":this._show_pic();break;case"PICTURE_COVERFLOW":this._show_pic();break;default:this.linkDefault();}},_get_mediaid:function(){App.log("this.module.inst ",this.module.inst);App.log("this.module.oModuleDef.config ",this.module.oModuleDef.config);return this.get_param(document.location.search,this.LABEL_SHOW);},_show_pic:function(){var mediaid=this._get_mediaid();App.log("mediaid = ",mediaid);if(mediaid==0){App.log("> No valid media id found for social sharing");return false;}
var viewer=this.module.inst;App.log("viewer is ",viewer);var idx=viewer._lookupIdxByMediaid(mediaid);App.log("mediaIdx sequential index is ",idx);var delay=(YAHOO.env.ua.ie)?500:500;if(this.moduleType=="PICTURE_VIEWER"){App.log("found media item: ",viewer.config.media[idx]);viewer.slide=idx;viewer.setViewport(viewer.slide,false);viewer.Slideshow.stop(viewer);Y.lang.later(delay,this,function(){viewer._moveToImage(viewer.config.media[idx].img,0);});}
if(this.moduleType=="PICTURE_CAROUSEL"){App.log("found media item: ",viewer.options.media[idx]);viewer.slide=idx;var shareData=viewer.getShareData(viewer.options.media[idx]);App.log("shareData ",shareData);App.log("viewer shareEl ",viewer.shareEl);Y.lang.later(delay,this,function(){App.flashImg(shareData);});}
if(this.moduleType=="PICTURE_COVERFLOW"){App.log("found media item: ",viewer.options.media[idx]);viewer.slide=idx;var shareData=viewer.getShareData(viewer.options.media[idx]);App.log("shareData ",shareData);App.log("viewer shareEl ",viewer.shareEl);Y.lang.later(delay,this,function(){App.flashImg(shareData);});}},get_share_type:function()
{var spanEl=Dom.getElementsByClassName("ico","span",this.linkEl)[0];var shareClass=Dom.getAttribute(spanEl,"class");return(/ico_([^\s]+)/.test(shareClass))?RegExp.$1:false;},get_social_param_names:function()
{var paramMap={"fb":{url:"u",title:"t",desc:false},"digg":{url:"url",title:"title",desc:"bodytext"},"delicious":{url:"url",title:"title",desc:"notes"},"google":{url:"bkmk",title:"title",desc:"annotation"},"twit":{url:"status",title:"title",desc:"desc"},"netlog":{url:"url",title:"title",desc:"description"}}
return paramMap[this.shareType];},get_param:function(subject,param){var RE=new RegExp(param+"=([^&]*)");return(RE.test(subject))?RegExp.$1:false;},set_param:function(subject,param,newVal){var RE=new RegExp("("+param+")=[^&]*");return subject.replace(RE,"$1="+newVal);},moduleData:function(){App.log("moduledata: this.module.oModuleDef.config ",this.module.oModuleDef.config);return this.module.oModuleDef.config.share;},_update_href:function(){App.log("shareLink: %o",this.shareLink);if(this.linkEl.href!=this.shareLink)this.linkEl.href=this.shareLink;App.log("updated href to %o",this.linkEl.href);},_add_module_anchor:function(){var lbl=this.get_social_param_names();var url=this.get_param(this.shareLink,lbl.url);App.log("Original url = ",url);var moduleAnchor=escape("#"+this.module.container.id);if(this.shareLink.indexOf(moduleAnchor)>-1)moduleAnchor="";else{moduleAnchor=escape("?m="+this.module.container.id)+moduleAnchor;}
this.shareLink=this.set_param(this.shareLink,lbl.url,url+moduleAnchor);App.log("this.shareLink ",this.shareLink);App.log("moduleAnchor ",moduleAnchor);this._update_href();},_update_pic_link:function(){var shareData=this.moduleData();App.log("_update_pic_link ",shareData);var mediaid=shareData.mediaid||0;var title=shareData.title||"";var desc=shareData.desc||"";var shareType=this.get_share_type();App.log("shareType is ",shareType);App.log("shareData is ",shareData);var lbl=this.get_social_param_names();App.log("share labels ",lbl);var moduleAnchor=escape("#"+this.module.container.id);this.shareLink=this.set_param(this.shareLink,this.LABEL_SHOW,mediaid+moduleAnchor);if(lbl.title)this.shareLink=this.set_param(this.shareLink,lbl.title,title);if(lbl.desc)this.shareLink=this.set_param(this.shareLink,lbl.desc,desc);this._update_href();},showEmbed:function(el){var EMBED_PREFIX="embed_";this.moduleEl=Dom.getAncestorByClassName(el,"module");App.log("App.share.showEmbed() ",el,this.moduleEl);this.moduleId=parseInt(this.moduleEl.id.substring(1),10);this.module=App.ModuleMgr.modules[this.moduleId];if(this.module&&this.module.inst.showEmbed){var txtarea=Dom.get(EMBED_PREFIX+this.moduleEl.id);if(txtarea){if(Dom.hasClass(txtarea,"hidden")){this.module.inst.showEmbed(txtarea);}else{}}}}},initFormElements:function(elRoot)
{elRoot=elRoot||document;if(!App.Ui.maxLength){App.warn("App.Ui.maxLength not available (uiform not loaded?)");}
if(App.env.AUTORUN_ENABLED)
{App.Ui.maxLength.run();if(App.env.FIX_IE_DROPDOWNS){App.Ui.fixDropdowns.run();}}
this.globalED.on("submit-form",this._submitForm,this);},ready:function(f)
{Event.onDOMReady(f);},onBeforeSubmit:function(){return true;},_submitForm:function(e)
{App.log("clicked on submit");Event.stopEvent(e);if(document.forms.length>0)
{App.env.submitData=App.env.submitData||document.forms[0];var doSubmit=this.onBeforeSubmit();if(doSubmit!==false)
{App.log("submit form ",App.env.submitData);App.env.submitData.submit();}}},onPageProperties:function(e,el)
{var srcUrl=Dom.getAttribute(el,"href");return this.openPageProperties(srcUrl);},openPageProperties:function(url)
{return App.Ui.Helper.openAjaxDialog({srcUrl:url,successUrl:window.location.href,events:{onDialogInit:function()
{App.log("PageProperties.init()");if(App.PageManager){App.PageManager.onLoadPagePopup();}}}});},onWebTrendsLink:function(e,el)
{var attr=App.Ui.Helper.getDataset(el);if(attr.hasOwnProperty('wt')){App.webtrendsEventDelegator.clickEvent(attr.wt);}
return true;},onImageLightbox:function(e,el)
{App.log("onImageLightbox()",el);var imgId=el.id||Dom.generateId(),imgTitle=Dom.getAttribute(el,"title"),imgUrl=Dom.getAttribute(el,"href");this.showImageLightBox(imgUrl,imgTitle);return false;},flashImg:function(o){App.log("*** flashImg (open popup) ",o);App._setFlashModuleShare(o);App.log("imgUrl before replace: "+o.url);var imgUrl=o.url.replace('_FLASH','_LARGE');imgUrl=imgUrl.replace('_BANNER_MEDIUM','_LARGE');imgUrl=imgUrl.replace('_RECTANGLE','_LARGE');App.log("imgUrl after replace: "+imgUrl);App.webtrendsEventDelegator.galleryEvent("enlargeCarousel",imgUrl);App.showImageLightBox(imgUrl,o.title,o.moduleid);},flashImgSelect:function(o){App.log("*** flashImgSelect ",o);App._setFlashModuleShare(o);},_setFlashModuleShare:function(o){App.log("_setFlashModuleShare set share link for social media ",o);var module=App.ModuleMgr.modules[o.moduleid];if(module)module.oModuleDef.config.share=o;},showImageLightBox:function(imgUrl,imgTitle,moduleId)
{if(Y.lang.isUndefined(App.Ui.ImageLightbox)){App.halt("onImageLightbox(): App.Ui.ImageLightbox is not available");}
var options={url:imgUrl,title:imgTitle||"Image Preview"};App.log("showImageLightBox ",moduleId);if(moduleId){var module=App.ModuleMgr.modules[moduleId];var shareEl=Dom.getElementsByClassName("m_share","div",module.container)[0];if(shareEl.id)options.shareLinks=shareEl.id;App.log("found shareEl ",shareEl);}
var imageLightbox=new App.Ui.ImageLightbox(options);App.log("imageLightbox.show(options) ",options);imageLightbox.show(options);},getGlobalED:function()
{return this.globalED;},isLandingPage:function()
{return!!App.env.modulemgr;},getDomain:function(sUrl){return this.getURLParts(sUrl).domain;},getDomainPath:function(sUrl){return this.getURLParts(sUrl).path;},getURLParts:function(sUrl){var urlObj={domain:"",path:"",query:""};var domainRE=/(^https?:\/\/[^\/?]*)\/?([^?]*)\??(.*)/i;if(domainRE.test(sUrl)){urlObj.domain=RegExp.$1;urlObj.path=RegExp.$2;urlObj.query=RegExp.$3;}
return urlObj;},get_param:function(subject,param){var RE=new RegExp(param+"=([^&]*)");return(RE.test(subject))?RegExp.$1:false;},YellowBar:function(){var idHash=this.get_param(window.location.search,"index");var display=false;if(idHash&&App.env.yellowUrl){var body=document.getElementsByTagName("body")[0];YAHOO.util.Dom.setStyle(body,'margin-top','142px');var yellowBar=document.getElementById("YPbar");if(yellowBar){yellowBar.style.display="block";document.getElementById('yellow_frame').src="http://"+App.env.yellowUrl+"/q/business/ms/header/"+idHash;}
App.ready(function(){App.globalED.onId("custMenu",function(e,el){YAHOO.util.Event.stopEvent(e);var clickedEl=YAHOO.util.Event.getTarget(e);if(clickedEl.tagName.toLowerCase()=="a"){if(clickedEl.href.indexOf("?")==-1){top.location.href=clickedEl.href+"?index="+idHash;}
else{top.location.href=clickedEl.href+"&index="+idHash;}}});App.globalED.onId("sitemapHolder",function(e,el){YAHOO.util.Event.stopEvent(e);var clickedEl=YAHOO.util.Event.getTarget(e);if(clickedEl.tagName.toLowerCase()=="a")
if(clickedEl.href.indexOf("?")==-1){top.location.href=clickedEl.href+"?index="+idHash;}
else{top.location.href=clickedEl.href+"&index="+idHash;}});});display=true;}
if(!display){this.TruvoBar();}},TruvoBar:function(){var display=clickthrough=(window.location.search.indexOf(App.env.queryTrigger)>-1);var docReferrer=(App.env.truvoBartest)?App.env.dummyReferrer:document.referrer;App.env.TruvoSearchUrl=(clickthrough)?location.search.substr(App.env.queryTrigger.length+1):escape(docReferrer);App.env.TruvoUrl=App.getDomain(unescape(App.env.TruvoSearchUrl))+"/";if(docReferrer&&!display){var lowercaseReferrer=docReferrer.toLowerCase();var skipContext=(lowercaseReferrer.indexOf(App.env.contextPath.toLowerCase())>-1);if(!skipContext){var i=0;var refLength=App.env.truvoBarReferrers.length;while(!display&&i<refLength)display=(lowercaseReferrer.indexOf(App.env.truvoBarReferrers[i++])>-1);}
if(display){var referrer=App.getURLParts(docReferrer);var currPage=App.getURLParts(top.location.href);if(referrer.domain==currPage.domain&&referrer.path.length==0)display=false;}}
if(App.env.truvoBartest){App.env.truvoBartestResult=display;}else{if(display){var truvoBar=document.getElementById("GPbar");if(truvoBar)
truvoBar.style.display="block";var backButton=document.getElementById("backToTruvoSearchUrl");backButton.href=unescape(App.env.TruvoSearchUrl);var logoLink=document.getElementById("backToTruvoUrl");logoLink.href=App.env.TruvoUrl;App.ready(function(){App.globalED.onId("custMenu",function(e,el){YAHOO.util.Event.stopEvent(e);var clickedEl=YAHOO.util.Event.getTarget(e);if(clickedEl.tagName.toLowerCase()=="a")
top.location.href=clickedEl.href+App.env.queryTrigger+"="+App.env.TruvoSearchUrl;});});}}},checkSplashScreen:function(o)
{App.log(">> checkSplashScreen ",o);var siteId=(o.siteId)?o.siteId:"";var showSplash="false";var comingFromTruvo="false";switch(o.strategy){case"cookie":showSplash=YAHOO.util.Cookie.get("truvoShowSplashScreenNow_"+siteId);comingFromTruvo=YAHOO.util.Cookie.get("comingFromTruvo_"+siteId);break;case"always":showSplash="true";break;}
App.log("showSplash ",showSplash);if(showSplash=="true"&&comingFromTruvo=="false")this.showSplashScreen(o);},showSplashScreen:function(o)
{if(o.contentDiv){oDialog=new App.Ui.AjaxDialog(o.contentDiv,{useMarkup:true,close:false,skin:THEME_DIALOG_CLASS});oDialog.show();}},isBackendPage:function()
{var currPage=this.getURLParts(top.location.href);var context=(App.env.contextPath.substr(0,1)=="/")?App.env.contextPath.substr(1):App.env.contextPath;var adminpath=context+"/admin/";var isAdmin=(currPage.path.indexOf(adminpath)>-1);return isAdmin;},getRequestParameter:function(param)
{var q=document.location.search||document.location.hash;if(param===null){return q;}
if(q)
{var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++)
{if(pairs[i].substring(0,pairs[i].indexOf("="))==param)
{return pairs[i].substring((pairs[i].indexOf("=")+1));}}}
return"";},hasModules:function()
{return Dom.getElementsByClassName('m_tile','div','custGrid').length>0;},halt:function()
{if(typeof(console)!=="undefined"&&typeof(console.error)==='function'){console.error.apply(console.error,arguments);}
alert(message);},warn:function()
{if(typeof(console)!=="undefined"&&typeof(console.warn)==='function'){}else{App.log.apply(App.log,arguments);}},alert:function(s)
{if(App.env.logging===true){alert(s);}}});function initLogger()
{if(App.env.logging){if(YAHOO.env.ua.ie){App.log=(typeof firebug=="undefined")?App.Toolkit.Console.log:console.log;}else{App.log=App.Toolkit.Console.log;}}else{App.log=function(){};}};Event.onDOMReady(function(){initLogger();App.init();});})();var onCoverFlowChange=App.flashImg;var onCoverFlowSelect=App.flashImgSelect;if(typeof(App)==='undefined'||!App){throw new Error('App is not declared');}
if(!App.Ui){App.Ui={};}
(function(){var Y=YAHOO,Dom=Y.util.Dom;App.Ui.Helper={getParams:function(el,name)
{var re=new RegExp("(?:^|\\s)"+name+"-([^-]+)-(\\w+)","g"),obj={},a;while((a=re.exec(el.className)))
{var prop=a[1],value=a[2];obj[prop]=value;}
return obj;},getDataset:function(el)
{var i,dataset={};if(el.attributes){for(i=0;i<el.attributes.length;i++)
{var attrib=el.attributes[i];if(attrib.specified===true&&attrib.name.indexOf("data-")===0)
{dataset[attrib.name.slice(5)]=attrib.value;}}}
return dataset;},toggleState:function(el,state,prefix)
{var state0=prefix+"-state-0",state1=prefix+"-state-1";Dom.replaceClass(el,state?state0:state1,state?state1:state0);},openAjaxDialog:function(options)
{var o=options,dlgOptions={srcUrl:null},ajaxDialog;App.log("openAjaxDialog options: ",o);dlgOptions.srcUrl=o.srcHref?Dom.getAttribute(o.srcHref,"href"):o.srcUrl;dlgOptions.timeout=o.timeout?o.timeout:null;dlgOptions.events=options.events?options.events:{};if(o.successUrl){dlgOptions.events.onDialogSuccess=function(){window.location.href=o.successUrl;};}
ajaxDialog=new App.Ui.AjaxDialog(null,dlgOptions);ajaxDialog.show();return false;},insertTop:function(node)
{var elParent=Dom.get("ie")||document.body;elParent.insertBefore(node,elParent.firstChild);},generateDialogMarkup:function(options)
{var div=document.createElement("div"),i,id,buttons,sBoxIcon;options.title=options.title||"Note";options.buttons=options.buttons||[{label:"Close",cust:"dialog-close"}];options.width=options.width||400;sBoxIcon=options.icon?' ibox-icon-'+options.icon:'';buttons=[];for(i=0;i<options.buttons.length;i++){var btnDef=options.buttons[i],btnClass=(btnDef.cust||'');var isYellowButton=(options.buttons.length==1)?'uiIBtnYB ':'';buttons.push('<a href="#" class="uiIBtn uiIBtnGS '+isYellowButton+btnClass+'"><span>'+btnDef.label+'</span></a>');}
buttons=buttons.join("&nbsp;");div.className="dialog-width-"+options.width;div.style.display="none";div.innerHTML='<div class="hd">'+options.title+'</div>'+'<div class="bd">'+'<div class="ibox-rc ibox-dialog'+sBoxIcon+'">'+'<div class="ibox-hd"></div>'+'<div class="ibox-bd">'+
options.body+'</div>'+'<div class="ibox-ft"></div>'+'</div>'+'<div class="dialog-footer">'+buttons+'</div>'+'</div>';id=Dom.generateId(div);document.body.insertBefore(div,document.body.firstChild);return id;},fixTabViewHeight:function(el)
{var divs=Dom.getElementsByClassName("yui-content-child","div",el),maxheight=divs[0].offsetHeight,maxheightPx;if(!maxheight){return;}
Dom.batch(divs,function(div){maxheight=div.offsetHeight>maxheight?div.offsetHeight:maxheight;});maxheightPx=maxheight+"px";Dom.batch(divs,function(div){div.style.height=maxheightPx;});},toggle:function(el,display)
{el.style.display=display?"":"none";},closeWindow:function()
{if(YAHOO.env.ua.gecko==0){var win=window.open("","_self");win.close();}else{}}};})();(function(){App.Ui.EventDelegator=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,EventDelegator=App.Ui.EventDelegator,PREFIX_TAG="%",PREFIX_ID="#",ROOT_EVENT="@root";EventDelegator.prototype={init:function(elRoot,types)
{var i;this.listeners={};this.eventCache=[];this.elRoot=Dom.get(elRoot);if(Y.lang.isString(types)){types=[types];}
for(i=0;i<types.length;i++){this.eventCache.push([elRoot,types[i],this._handler]);Event.on(elRoot,types[i],this._handler,this,true);}},destroy:function()
{var i;while(this.eventCache.length){Event.removeListener.call(Event,this.eventCache.pop());}},onClass:function(name,callback,scope)
{this._debug(arguments);this._on(name,callback,scope);},on:function()
{this.onClass.apply(this,arguments);},onTag:function(name,callback,scope)
{this._debug(arguments);this._on(PREFIX_TAG+name.toUpperCase(),callback,scope);},onId:function(name,callback,scope)
{this._debug(arguments);if(!Dom.get(name)){App.warn("Warning: EventDelegator()::onId('%s') id is not present in document",name);}
this._on(PREFIX_ID+name,callback,scope);},onDefault:function(callback,scope)
{this._debug(arguments);this._on(ROOT_EVENT,callback,scope);},_on:function(name,callback,scope)
{this.listeners[name]={fn:callback,context:scope,re:new RegExp("(?:^|\\s)"+name+"(?:$|\\s)")};},_debug:function(args)
{var i;for(i=args.length-1;i>=0;i--){if(typeof(args[i])==="undefined"){App.warn("EventDelegator: WARNING: one of the supplied arguments is undefined.");}}},_handler:function(e)
{var elTarget=Event.getTarget(e);while(elTarget&&elTarget!==this.elRoot)
{var idEvent,tagEvent,classes,n;if(elTarget.id&&elTarget.id.length)
{idEvent=PREFIX_ID+elTarget.id;if(this.listeners[idEvent]&&this._fire(idEvent,e,elTarget)===false)
{Event.stopEvent(e);return false;}}
classes=elTarget.className.split(/\s+/);for(n=classes.length-1;n>=0;n--)
{if(this.listeners[classes[n]]&&this._fire(classes[n],e,elTarget)===false)
{Event.stopEvent(e);return false;}}
tagEvent=PREFIX_TAG+elTarget.nodeName.toUpperCase();if(this.listeners[tagEvent]&&this._fire(tagEvent,e,elTarget)===false)
{Event.stopEvent(e);return false;}
elTarget=elTarget.parentNode;}
if(elTarget===this.elRoot&&this.listeners[ROOT_EVENT]){if(this._fire(ROOT_EVENT,e,elTarget)===false)
{Event.stopEvent(e);return false;}}},_fire:function(name,e,matchedEl)
{var oListener=this.listeners[name];var context=Y.lang.isUndefined(oListener.context)?window:oListener.context;return oListener.fn.apply(context,[e,matchedEl]);}};})();(function(){App.Ui.EventDispatcher=App.Helper.createClass();var
Y=YAHOO,EventDispatcher=App.Ui.EventDispatcher;EventDispatcher.prototype={listeners:null,init:function()
{this.listeners={};},destroy:function()
{this.listeners={};},connect:function(name,fn,context)
{if(!this.listeners[name]){this.listeners[name]=[];}
this.listeners[name].push({fn:fn,scope:context||window});},disconnect:function(name,fn)
{var i,l,callables,s;if(!this.listeners[name]){return null;}
if(!fn){fn=true;}
callables=this.listeners[name];l=callables.length;for(i=l-1;i>-1;i--){s=callables[i];if(true===fn||s.fn===fn){delete s.fn;delete s.scope;callables.splice(i,1);}}
return l;},notify:function(name)
{var args=Array.prototype.slice.call(arguments,0),i,ret,subscriber;args.shift();callables=this.listeners[name]?this.listeners[name]:[];if(args.length===1&&Y.lang.isArray(args[0])){alert('EventDispatcher()  using obsolete notify() signature?');}
if(!callables.length){return null;}
for(i=0;i<callables.length;i++){subscriber=callables[i];ret=subscriber.fn.apply(subscriber.scope,args.length?args:[]);if(false===ret){break;}}
return(ret!==false);},hasListeners:function(name)
{if(!this.listeners[name]){return false;}
return this.listeners[name].length>0;}};})();(function(){var Event=YAHOO.util.Event,EventCache=App.Ui.EventCache=App.Helper.createClass();EventCache.prototype={sId:null,eCache:null,init:function(sId)
{this.sId=sId||'';this.eCache=[];},addEvent:function(element,sEventType,fn)
{Event.addListener(element,sEventType,fn);this.push(element,sEventType,fn);},addEvents:function(element,aEventTypes,fn)
{var i;for(i=0;i<aEventTypes.length;i++)
{this.addEvent(element,aEventTypes[i],fn);}},push:function(element,sEventType,handler){this.eCache.push({oElem:element,evType:sEventType,fn:handler});},destroy:function()
{if(this.eCache)
{for(var i=this.eCache.length-1;i>=0;i--){var evc=this.eCache[i];Event.removeListener(evc.oElem,evc.evType,evc.fn);}
this.eCache=[];}}};})();(function(){App.Ui.ShadeLayer=App.Helper.createClass();var
Y=YAHOO,Dom=Y.util.Dom,ShadeLayer=App.Ui.ShadeLayer,DEFAULT_COLOR='#000',DEFAULT_OPACITY=20,DEFAULT_ZINDEX=100;ShadeLayer.prototype={init:function(options)
{this.color=options.color||DEFAULT_COLOR;this.opacity=typeof(options.opacity)!=='undefined'?options.opacity:DEFAULT_OPACITY;this.opacity=Math.max(Math.min(this.opacity,100),0);this.isIE=!!Dom.get('ie');if(options.element)
{var offsets=Dom.getXY(options.element);this.pos={left:offsets[0],top:offsets[1]};this.size=this.getDimensions(options.element);this.element=options.element;}
else
{this.pos=options.pos;this.size=options.size;}
var elLayer=document.createElement("div");var layerStyles={display:'none',position:'absolute',top:this.pos.top+'px',left:this.pos.left+'px',zIndex:DEFAULT_ZINDEX,width:/%$/.test(this.size.width)?this.size.width:this.size.width+'px',height:/%$/.test(this.size.height)?this.size.height:this.size.height+'px'};if(!options.glass_mode){layerStyles.background=this.color;layerStyles.opacity=Math.round(this.opacity)/100;}
Dom.setStyles(elLayer,layerStyles);if(this.isIE){elLayer.style.filter='alpha(opacity='+this.opacity+')';}
this.elBody=document.getElementsByTagName("body")[0];this.elBody.insertBefore(elLayer,this.elBody.firstChild);this.elLayer=elLayer;},show:function()
{if(this.element){this.resize();}
Dom.setStyle(this.elLayer,"display","block");},hide:function()
{Dom.setStyle(this.elLayer,"display","none");},resize:function()
{if(!this.element){throw new Error('uiShadeLayer.resize() cannot resize without element');}
var newSize=this.getDimensions(this.element);if(newSize.width!=this.size.width||newSize.height!=this.size.height)
{this.size=newSize;Dom.setStyles(this.elLayer,{width:this.size.width+'px',height:this.size.height+'px'});}},visible:function()
{return this.elLayer.style.display!=="none";},destroy:function()
{if(this.elLayer){this.elBody.removeChild(this.elLayer);}
this.elLayer=null;},getLayer:function()
{return this.elLayer;},getDimensions:function(element)
{if(element===document.body)
{return{width:Dom.getViewportWidth(),height:Dom.getViewportHeight()};}
else
{var region=Dom.getRegion(element);return{width:region.width,height:region.height};}}};})();(function(){App.Ui.AjaxIndicator=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,AjaxIndicator=App.Ui.AjaxIndicator,DEFAULT_ZINDEX=101,DEFAULT_MESSAGE='Loading...';AjaxIndicator.prototype={init:function(options)
{this.container=options&&options.container?Dom.get(options.container):document.body;this.message=options.message?options.message:DEFAULT_MESSAGE;this.indicator=null;},destroy:function()
{if(this.indicator&&this.indicator.parentNode){document.body.removeChild(this.indicator);}
this.indicator=null;},show:function()
{if(!this.indicator){var pos=Dom.getXY(this.container);this.indicator=document.createElement('span');Dom.setStyles(this.indicator,{padding:'2px 10px',background:'red',color:'#fff',font:'13px/18px Arial, sans-serif',position:'absolute',left:pos[0]+'px',top:pos[1]+'px',zIndex:DEFAULT_ZINDEX,display:'block'});this.indicator.innerHTML=this.message;document.body.insertBefore(this.indicator,document.body.firstChild);}
this.indicator.style.display='block';},hide:function()
{if(this.indicator){this.indicator.style.display='none';}},getElement:function()
{return this.indicator;}};})();(function(){App.Ui.AjaxRequest=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,AjaxRequest=App.Ui.AjaxRequest,DEFAULT_TIMEOUT=20000;AjaxRequest.prototype={responseFilter:{onSuccess:function(){return true;},onFailure:function(){return true;}},init:function(url,options)
{var that=this,callback={},postdata;App.log('Ui.AjaxRequest.init()',options);options=Y.lang.merge({method:'GET',url:url},options||{});options.method=options.method.toUpperCase();callback.success=function(o){return that.handleSuccess(o,options.success,options.scope);};callback.failure=function(o){return that.handleFailure(o,options.failure,options.scope);};if(options.upload){callback.upload=options.upload;}
if(options.argument){callback.argument=options.argument;}
if(options.nocache){callback.cache=false;}
if(options.events){if(options.events.onSuccess||options.events.onFailure){App.warn("AjaxRequest() WARNING: options.events is deprecated! (for internal use)");}
callback.events=options.events;}
if(options.customevents){callback.customevents=options.customevents;}
if(options.scope){callback.scope=options.scope;}
callback.timeout=Y.lang.isNumber(options.timeout)?options.timeout:DEFAULT_TIMEOUT;if(options.form){var formObject=Dom.get(options.form);if(!formObject.nodeName||formObject.nodeName.toLowerCase()!=='form'){App.halt("AjaxRequest() 'form' is not a FORM element");}
Y.util.Connect.setForm(formObject);}
var requestUri=options.url,params=options.parameters;if(params)
{if(Y.lang.isString(params))
{var pos=params.indexOf("?");if(pos>=0){params=params.slice(pos+1);}}
else if(Y.lang.isObject(params))
{if(Y.lang.isObject(params.json)){params.json=Y.lang.JSON.stringify(params.json);}
params=App.Toolkit.toQueryString(params);}
else{App.halt("AjaxRequest() invalid typeof options.parameters");}
if(options.method==='GET')
{if(requestUri.indexOf("?")>=0){App.halt("AjaxRequest() Request url already contains parameters");}
requestUri=requestUri+"?"+params;}
else if(options.method==='POST')
{if(requestUri.indexOf("?")>=0){App.halt("AjaxRequest() POST request url contains query string (unsupported)");}
postdata=params;}}
this.connection=Y.util.Connect.asyncRequest(options.method,requestUri,callback,postdata);},isCallInProgress:function(o)
{return Y.util.Connect.isCallInProgress(this.connection);},handleSuccess:function(o,fn,scope)
{if(this.responseFilter.onSuccess(o)&&fn)
{if(o.responseText.length>0&&o.getResponseHeader&&o.getResponseHeader['Content-Type'].indexOf('application/json')>=0)
{try
{o.responseJSON=Y.lang.JSON.parse(o.responseText);}
catch(e)
{o.responseJSON=null;}}
if(typeof(o.responseJSON)!=="undefined"&&o.responseJSON!==null)
{var tron=new App.Helper.TRON(o.responseJSON);App.Helper.TRON.handleErrors(tron);}
fn.apply(scope||window,[o]);}},handleFailure:function(o,fn,scope)
{if(this.responseFilter.onFailure(o)&&fn)
{fn.apply(scope||window,[o]);}}};})();(function(){App.Ui.AjaxPanel=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,AjaxPanel=App.Ui.AjaxPanel;AjaxPanel.prototype={options:null,container:null,evtCache:null,ajaxRequest:null,eventDispatcher:null,eventDel:null,events:{},serializeForm:false,contentLoaded:false,oTRON:null,init:function(container,options)
{App.log('AjaxPanel.init() options %o ',options);options=!!options?options:{};this.options=options;this.options.form=(options.form&&options.form!==true)?options.form:true;this.options.bUseLayer=options.bUseLayer||true;this.options.bUseShading=options.bUseShading||false;this.options.initContent=options.initContent===true?true:false;this.contentLoaded=this.options.initContent===true?true:false;this.container=Dom.get(container);if(!this.container){App.halt("AjaxPanel.init() invalid container");}
this.evtCache=new App.Ui.EventCache();this.ajaxRequest=null;this.eventDel=new App.Ui.EventDelegator(this.container,"click");this.eventDel.on("dialog-submit",this.onPanelSubmit,this);this.eventDispatcher=new App.Ui.EventDispatcher();if(this.options.events){var events=this.options.events,eventName;for(eventName in events){this.eventDispatcher.connect(eventName,events[eventName]);}}
if(options.loadContent){this.prepareConnect(null,'get',options.loadContent);}
else{this.initContent();}},destroy:function()
{if(this.contentLoaded){this.eventDispatcher.notify('onContentDestroy');}
if(this.shadeLayer){this.shadeLayer.destroy();}
this.evtCache.destroy();this.eventDispatcher.destroy();},initContent:function()
{App.log('AjaxPanel.initContent()');var elForm=(this.serializeForm=this.getForm());if(elForm){this.evtCache.addEvent(elForm,'submit',Y.bind(this.submitFormEvent,this));App.initFormElements(elForm);}
if(this.options.autoScroll){this.autoScroll();}
if(this.options.autoFocus){this.autoFocus();}
if(this.contentLoaded){this.eventDispatcher.notify('onContentInit');}},replaceContent:function(sHtml)
{this.evtCache.destroy();if(this.contentLoaded){this.eventDispatcher.notify('onContentDestroy');}
this.container.innerHTML=sHtml;this.contentLoaded=true;this.oTRON=new App.Helper.TRON(this.container);App.Helper.TRON.handleErrors(this.oTRON);this.initContent();},getTron:function()
{return this.oTRON;},setForm:function(elForm)
{elForm=Dom.get(elForm);if(!elForm.nodeName||elForm.nodeName.toLowerCase()!=='form'){throw new Error("setForm() argument 0 is not a form element");}
this.serializeForm=elForm;},getForm:function()
{if(this.options.form===true)
{return this.container.getElementsByTagName('form')[0];}
else if(Y.lang.isString(this.options.form))
{var form=Dom.getElementsByClassName(this.options.form,'form',this.container)[0];if(!form){App.halt("AjaxPanel.getForm() form not found (by class name)");}
return form;}
return this.options.form;},submitFormEvent:function(e)
{var form,skipSubmit=false;App.log('AjaxPanel.submitFormEvent(%o) Form %o',e,Event.getTarget(e));if(this.eventDispatcher.hasListeners('onSubmitForm')){skipSubmit=(false===this.eventDispatcher.notify('onSubmitForm',e));}
if(!skipSubmit){form=this.getForm();this.setForm(form);this.send();}
Event.stopEvent(e);},onPanelSubmit:function(e,el)
{if(this.getForm()){this.submitFormEvent.call(this,e);}
return false;},get:function(oData)
{this.prepareConnect(oData,'get');},post:function(oData)
{this.prepareConnect(oData,'post');},send:function(oData)
{var form=this.getForm()||App.halt("AjaxPanel.send()  Requires a form");var method=form.getAttribute('method')||'post';this.prepareConnect(oData,method);},prepareConnect:function(oData,sMethod,sUrl)
{var url,form=false,connectObj={};if(oData){connectObj.parameters=oData;}
if(this.serializeForm!==false){form=connectObj.form=this.serializeForm;}
url=sUrl||this.options.post_url||(form?form.action:false);if(!url){App.halt('AjaxPanel.prepareConnect() need post_url and/or a FORM element');}
if(this.ajaxRequest&&this.ajaxRequest.isCallInProgress()){App.warn('Previous AjaxRequest still in progress (or bug?)');return;}
connectObj.url=url;connectObj.method=sMethod;this.connect(connectObj);},connect:function(oConnect)
{if(oConnect){this.connection=oConnect;}
if(!this.connection){App.halt('AjaxPanel.connect() No connection object.');}
var options={method:this.connection.method,form:this.connection.form,parameters:this.connection.parameters,nocache:true,timeout:this.options.timeout,success:this.ajaxOnSuccess,failure:this.ajaxOnFailure,customevents:{onStart:this.ajaxOnStart,onComplete:this.ajaxOnComplete},scope:this};this.ajaxRequest=new App.Ui.AjaxRequest(this.connection.url,options);},ajaxOnStart:function(eventType,args)
{if(this.options.bUseLayer){if(!this.shadeLayer){this.shadeLayer=new App.Ui.ShadeLayer({element:this.container,glass_mode:!this.options.bUseShading});}
this.shadeLayer.show();}
else{this.shadeLayer=null;}
this.ajaxIndicator=new App.Ui.AjaxIndicator({container:this.container,message:(App.env&&App.env.localize&&App.env.localize.AJAX_LOADING)});this.ajaxIndicator.show();},ajaxOnComplete:function(eventType,args)
{this.ajaxIndicator.destroy();if(this.shadeLayer){this.shadeLayer.hide();}},ajaxOnSuccess:function(oAjaxResponse)
{App.log('AjaxPanel.ajaxOnSuccess(%o)',oAjaxResponse);if(oAjaxResponse.getResponseHeader['Content-Type'].indexOf('application/json')>=0){this.oTRON=new App.Helper.TRON(oAjaxResponse.responseText);}
else{this.oTRON=false;}
this.eventDispatcher.notify('onResponse',oAjaxResponse);if(oAjaxResponse.getResponseHeader['Content-Type'].indexOf('text/html')===0&&oAjaxResponse.responseText.length)
{this.replaceContent(oAjaxResponse.responseText);}
this.ajaxRequest=null;},ajaxOnFailure:function(oAjaxResponse)
{App.log('AjaxPanel.ajaxOnFailure(%o)',oAjaxResponse);if(oAjaxResponse.status===-1)
{this.showErrorMessage('Oops! Timed out.');return;}
var sMessage='Oops! Error '+oAjaxResponse.status+' "'+oAjaxResponse.statusText+'".';this.showErrorMessage(sMessage);this.eventDispatcher.notify('onFailure',oAjaxResponse);this.ajaxRequest=null;},showErrorMessage:function(sMessage)
{this.ajaxErrorIndicator=new App.Ui.AjaxIndicator({container:this.container,message:sMessage+' <a href="#" style="font-weight:bold;color:yellow;">Retry</a> | <a href="#" style="font-weight:bold;color:yellow;">Close</a>'});this.ajaxErrorIndicator.show();var elMessage=this.ajaxErrorIndicator.getElement();var elRetryLink=elMessage.getElementsByTagName('a')[0];var elCloseLink=elMessage.getElementsByTagName('a')[1];var retry=function(oEvent){App.log('AjaxPanel.ajaxRetryEvent()');this.ajaxErrorIndicator.destroy();this.connect();};var close=function(oEvent){App.log('CLOSE()');this.ajaxErrorIndicator.destroy();};Event.on(elRetryLink,'click',retry,this,true);Event.on(elCloseLink,'click',close,this,true);App.log("this.ajaxErrorIndicator ",this.ajaxErrorIndicator);},autoScroll:function()
{var ypos=Dom.getY(this.container);window.scrollTo(0,ypos);},autoFocus:function()
{var input=Dom.getElementsByClassName("text","input",this.container)[0];if(input){App.Ui.AutoFocus(input);}}};})();(function(){App.Ui.AjaxDialog=App.Helper.createClass();YAHOO.widget.Panel.FOCUSABLE=[];var
Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,AjaxPanel=App.Ui.AjaxPanel,AjaxDialog=App.Ui.AjaxDialog,DIALOG_LOADING_W=300,DIALOG_LOADING_H=150,DIALOG_LOADING_CSS='AjaxDialogLoading',DIALOG_LOADING_HTML='<div class="AjaxDialogLoading">&nbsp;</div>',DIALOG_PADDING_W=20,DIALOG_PADDING_H=20,DEFAULT_ZINDEX=100,INVISIBLE_MASK="yui-invis-mask";AjaxDialog.STATUS_FAILED=0;AjaxDialog.STATUS_SUCCESS=1;AjaxDialog.STATUS_PROGRESS=2;AjaxDialog.prototype={options:null,eventDispatcher:null,events:{},eventDel:{},yPanel:null,ajaxPanel:null,contentDiv:null,init:function(container,options)
{var elDlg,dlgDimensions,that=this;options=!!options?options:{};App.log('AjaxDialog.init() and options %o',options);this.options=options;this.options.close=options.close===false?false:true;this.options.modal=options.modal===false?false:true;this.options.shadow=options.shadow===false?false:true;this.options.invisMask=options.invisMask===true?true:false;this.options.skin=options.skin||false;App.log('AjaxDialog.init() and this.options %o',this.options);if(options.useMarkup){if(!Y.lang.isString(container)){App.halt("AjaxDialog.init() container must be string id");}
var elContainer=Dom.get(container);elDlg=Dom.get(container).cloneNode(true);elDlg.setAttribute('id',null);App.Ui.Helper.insertTop(elDlg);dlgDimensions=['auto','auto'];if(/dialog-width-(\d+)/.test(elContainer.className)){dlgDimensions[0]=RegExp.$1+'px';}
if(/dialog-height-(\d+)/.test(elContainer.className)){dlgDimensions[1]=RegExp.$1+'px';}
this.container=elDlg;}
else
{elDlg=document.createElement('div');App.Ui.Helper.insertTop(elDlg);this.container=elDlg;dlgDimensions=[DIALOG_LOADING_W+'px',null];}
var yOptions={modal:this.options.modal,draggable:true,fixedcenter:false,close:this.options.close,width:dlgDimensions[0],height:dlgDimensions[1],constraintoviewport:true,underlay:this.options.shadow?"shadow":"none",visible:false,zIndex:DEFAULT_ZINDEX,effect:{effect:Y.widget.ContainerEffect.FADE,duration:0.2}};if(this.options.zIndex){yOptions.zIndex=this.options.zIndex;}
App.log("yOptions.zIndex ",yOptions.zIndex,DEFAULT_ZINDEX);this.yPanel=new Y.widget.Panel(elDlg,yOptions);if(options.srcUrl){this.yPanel.setBody(DIALOG_LOADING_HTML);this.contentDiv=Dom.getFirstChild(this.yPanel.body);}
else{this.contentDiv=this.container;this.contentDiv.style.display='block';}
this.yPanel.render();if(this.options.skin!==false){Dom.addClass(this.yPanel.element,this.options.skin);}
this.yPanel.hideEvent.subscribe(function(){that.onPanelClose();},this,true);this.eventDispatcher=new App.Ui.EventDispatcher();if(this.options.events){var events=this.options.events,eventName;for(eventName in events){this.eventDispatcher.connect(eventName,events[eventName]);}}
this.eventDel=new App.Ui.EventDelegator(this.container,"click");this.eventDel.on("dialog-success",function(){that.handleDialogStatus(AjaxDialog.STATUS_SUCCESS);return false;});this.eventDel.on("dialog-fail",function(){that.handleDialogStatus(AjaxDialog.STATUS_FAILED);return false;});this.eventDel.on("dialog-close",function(){that.onPanelClose(arguments);return false;});if(this.options.useMarkup){this.eventDispatcher.notify('onDialogInit');}},show:function()
{if(this.options.useMarkup){Dom.setStyle(this.container,'display','block');}
this.yPanel.center();if(this.options.invisMask)
{Dom.addClass(document.body,INVISIBLE_MASK);}
this.yPanel.show();if(this.options.srcUrl&&!this.ajaxPanel)
{this.ajaxPanel=new App.Ui.AjaxPanel(this.contentDiv,{post_url:this.options.srcUrl,initContent:false,bUseShading:false,timeout:this.options.timeout,events:{onContentInit:Y.bind(this.onPanelInit,this),onContentDestroy:Y.bind(this.onPanelDestroy,this),onResponse:Y.bind(this.onPanelResponse,this),onSubmitForm:Y.bind(this.onPanelSubmit,this)}});this.ajaxPanel.get();}},getContentDiv:function()
{return this.contentDiv;},on:function()
{this.eventDel.on.apply(this.eventDel,arguments);},onPanelResponse:function(o)
{App.log("onPanelResponse(%o)",o);this.eventDispatcher.notify('onDialogResponse',o);var tron=this.ajaxPanel.getTron();if(tron){this.handleTRONStatus(tron);}},onPanelInit:function()
{App.log('AjaxDialog::onPanelInit()');var tron=this.ajaxPanel.getTron();if(this.ajaxPanel.getForm()){this.ajaxPanel.options.post_url=false;}
Dom.removeClass(this.contentDiv,DIALOG_LOADING_CSS);if(this.handleTRONStatus(tron)){return;}
this.eventDispatcher.notify('onDialogInit',tron||false);var tv=tron.getReturnValues();if(tv.dialogWidth){if(!this.donelala){this.yPanel.cfg.setProperty('width',parseInt(tv.dialogWidth,10)+DIALOG_PADDING_W+'px');}else{this.donelala=true;}}
if(tv.dialogTitle){this.yPanel.setHeader(tv.dialogTitle);}
this.yPanel.center();},onPanelSubmit:function(e)
{App.log('AjaxDialog::onPanelSubmit()');return this.eventDispatcher.notify('onDialogSubmit',e);},handleTRONStatus:function(tron)
{var status=tron.getStatus(),dialogStatus;switch(status){case App.Helper.TRON.STATUS_FAILED:dialogStatus=AjaxDialog.STATUS_FAILED;break;case App.Helper.TRON.STATUS_PROGRESS:dialogStatus=AjaxDialog.STATUS_PROGRESS;break;case App.Helper.TRON.STATUS_SUCCESS:dialogStatus=AjaxDialog.STATUS_SUCCESS;break;default:App.warn('AjaxDialog::handleTRONStatus() invalid status');break;}
return this.handleDialogStatus(dialogStatus,tron);},handleDialogStatus:function(dialogStatus,tron)
{App.log('AjaxDialog.handleDialogStatus(%o)',dialogStatus);if(dialogStatus===AjaxDialog.STATUS_SUCCESS)
{this.eventDispatcher.notify('onDialogSuccess',tron||false);this.onPanelClose();return true;}
else if(dialogStatus===AjaxDialog.STATUS_FAILED)
{this.eventDispatcher.notify('onDialogFailed',tron||false);this.onPanelClose();return true;}
else if(dialogStatus===AjaxDialog.STATUS_PROGRESS)
{this.eventDispatcher.notify('onDialogProgress',tron||false);}
return false;},onPanelDestroy:function()
{this.eventDispatcher.notify('onDialogDestroy');},onPanelClose:function()
{if(arguments.length>0){a=arguments[0];e=a[0];el=a[1];if(Dom.hasClass(el,"reload")){setTimeout(function(){window.location.reload(true);},50);}}
this.destroy();},destroy:function()
{if(this.destroyed){return;}
else{this.destroyed=true;}
this.eventDispatcher.notify('onDialogDestroy');if(this.ajaxPanel){if(this.ajaxPanel.ajaxErrorIndicator){this.ajaxPanel.ajaxErrorIndicator.destroy();}
this.ajaxPanel.destroy();this.ajaxPanel=null;}
this.eventDel.destroy();this.yPanel.hide();this.yPanel.destroy();if(this.options.invisMask){Dom.removeClass(document.body,INVISIBLE_MASK);}}};})();(function(){var Y=YAHOO;var IFramePopup=App.Ui.IFramePopup=App.Helper.createClass();IFramePopup.prototype={panel:null,init:function(options)
{App.log('App.Ui.IFramePopup(%o)',arguments);this.options=options;},destroy:function()
{App.log('App.IFramePopup.destroy()');Y.lang.later(100,this,function(){App.log("DESTROY panel");this.panel.destroy();this.panel=null;});},show:function()
{App.log("App.IFramePopup.show()");if(!this.panel)
{var config={url:null,draggable:false,width:"895px",height:"600px",modal:true,zIndex:999,iframe:false,fixedcenter:true,autofillheight:"body",constraintoviewport:true,visible:false,monitorresize:false};this.panel=new Y.widget.Panel("resizablepanel",config);this.panel.hideEvent.subscribe(function()
{this.destroy();},this,true);this.panel.setHeader("&nbsp;");this.panel.setBody('<iframe src="'+this.options.url+'" class="iframe-style" >'+App.env.localize.IFRAME_NOSUPPORT+'</iframe>');this.panel.render(document.body);}
this.panel.show();}};})();(function(){App.Ui.Viewport=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom;App.Ui.Viewport.prototype={ANIM_SPEED:0.3,anim:null,init:function(elViewport,config)
{App.log("App.Ui.Viewport.init()");this.vpViewport=Dom.get(elViewport);this.vpContainer=Dom.getFirstChild(elViewport);this.position=config.defaultItem||0;this.itemWidth=config.itemWidth||false;this.fixme=config.fixme;this.vpItems=Dom.getElementsByClassName("vp-item","div",this.vpContainer);this.count=config.numItems||this.vpItems.length;this.redraw();},redraw:function()
{this.viewportWidth=this.vpViewport.offsetWidth;this.viewportHeight=this.vpViewport.offsetHeight;this.itemWidth=this.itemWidth||this.viewportWidth;this.vpContainer.style.width=(this.itemWidth*this.count)+"px";App.log("this.vpContainer.style.width ",this.vpContainer.style.width);Dom.batch(this.vpItems,function(el){el.style.width=this.itemWidth+"px";},this,true);if(this.fixme)
{var bodyEl=Dom.getAncestorByClassName(this.vpViewport,"body");if(bodyEl)
{switch(this.viewportWidth){case 580:var newHeight=210;break;case 260:var newHeight=107;break;default:var newHeight=210;}
bodyEl.style.height=(newHeight)+"px";}}
App.log("viewport ",this);},scrollTo:function(p)
{var that=this;var offset=p?-p*this.itemWidth:0;this.anim=new Y.util.Anim(this.vpContainer,{left:{to:offset,unit:"px"}},this.ANIM_SPEED,Y.util.Easing.easeOut);this.anim.animate();this.anim.onComplete.subscribe(function(){that.anim=null;});App.log("scrollTo ",this.anim);},jumpTo:function(p)
{var offset=p?-p*this.itemWidth:0;if(this.anim){this.anim.stop();this.anim=null;}
this.vpContainer.style.left=offset+"px";}};})();(function(){var AjaxFormList=App.Ui.AjaxFormList=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,AjaxPanel=App.Ui.AjaxPanel,AjaxPanelList=App.Ui.AjaxFormList;var CLASS_AJAX_FORM="AjaxForm";AjaxFormList.prototype={eventDel:null,panels:null,init:function(container,options)
{var that=this;options=options||{};this.formFactory=options.factory||"AjaxForm";this.elGroup=Dom.get(container);this.panelOptions=options;App.getGlobalED().on("add-new-link",this.addNewLink,this);App.getGlobalED().on("delete-link",this.deleteLink,this);var divs=Dom.getElementsByClassName(CLASS_AJAX_FORM,"div",this.elGroup);this.panels=[];Dom.batch(divs,function(el)
{var p=new App.Ui[that.formFactory](el,options);that.panels.push(p);});App.log("App.Ui.AjaxFormList() Initialized %d instances of App.Ui.%s.",this.panels.length,this.formFactory);},addNewLink:function(e,el)
{App.log("AjaxFormList.addNewLink()");var addNewLinkUrl=Dom.getAttribute(el,"href");var div=document.createElement('div');div.className=CLASS_AJAX_FORM;this.elGroup.appendChild(div);var that=this;var options=that.panelOptions;options.loadContent=addNewLinkUrl;options.autoScroll=true;options.autoFocus=true;function createPanel(){var pane=new App.Ui[that.formFactory](div,options);}
window.setTimeout(createPanel,50);return false;},deleteLink:function(e,el)
{App.log("AjaxFormList.deleteLink()");var href=Dom.getAttribute(el,"href"),ajaxDialog;ajaxDialog=new App.Ui.AjaxDialog(null,{srcUrl:href,events:{onDialogSuccess:function()
{window.location.reload(true);}}});ajaxDialog.show();return false;}};var AjaxForm=App.Ui.AjaxForm=App.Helper.createClass();App.Helper.extend(AjaxForm,AjaxPanel,{init:function(container,options)
{App.log("App.Ui.AjaxForm(%o, %o)",container,options);options=options||{};options.events=options.events||{};var listeners=["onContentInit","onContentDestroy","onResponse","onFailure","onSubmitForm"];for(i=0;i<listeners.length;i++){var listenerName=listeners[i];if(typeof(this[listenerName])==="function")
{options.events[listenerName]=Y.bind(this[listenerName],this);}}
AjaxForm.superclass.init.apply(this,arguments);this.container=container;},replaceContent:function()
{AjaxForm.superclass.replaceContent.apply(this,arguments);if(this.oTRON.isSuccess()){this.displayNotification(App.env.localize.AJAX_SUCCESS);}},displayNotification:function(msg)
{var elNote,that=this;if(this.noteEl){this.clearNotification();}
elNote=this.noteEl=document.createElement('div');elNote.innerHTML=msg;Dom.setStyles(elNote,{background:"#282",color:"#fff",font:"13px/18px Arial, sans-serif",padding:"2px 10px",position:"absolute",left:"0",top:"0"});this.container.style.position="relative";this.container.appendChild(elNote);if(Y.util.Anim)
{this.noteAnim=new YAHOO.util.Anim(elNote,{opacity:{"to":0}},1.5,YAHOO.util.Easing.easeIn);this.noteAnim.onComplete.subscribe(function(){var el=this.getEl();el.parentNode.removeChild(el);that.noteEl=null;});this.noteAnim.animate();}
else
{this.noteTO=window.setTimeout(function(){that.clearNotification();},1000);}},clearNotification:function()
{if(this.noteAnim){this.noteAnim.stop();this.noteAnim=null;}
if(this.noteEl){}}});})();(function(){App.Ui.DynInput=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,DYNINP_ITEM="dyninp-item",DYNINP_NEW="dyninp-new",DYNINP_TEMPLATE="dyninp-template",DYNINP_ITEM_ID="dyninp-id",DYNINP_ADD="dyninp-add",DYNINP_REMOVE="dyninp-remove",DYNINP_REMOVE_DATA="dyninp-remove-ids";App.Ui.DynInput.prototype={items:null,template:null,removedIds:null,init:function(parent)
{var els;this.items=[];this.template=null;this.removedIds={};this.parent=Dom.get(parent);els=Dom.batch(Dom.getElementsByClassName(DYNINP_ITEM,"*",this.parent),function(el){this.items.push(el);},this,true);els=Dom.getElementsByClassName(DYNINP_TEMPLATE,"*",this.parent)[0];this.template=els||App.alert("App.Ui.DynInput:: template item is missing");this.eventD=new App.Ui.EventDelegator(this.parent,"click");this.eventD.on(DYNINP_ADD,this.onAdd,this);this.eventD.on(DYNINP_REMOVE,this.onRemove,this);},onAdd:function(e,el)
{var newItem=this.addItem();var inputs,done=false;if(el){inputs=newItem.getElementsByTagName('input');Dom.batch(inputs,function(el,o){if(!done&&el.type==="text"&&!el.disabled){el.focus();done=true;}},this,true);}
return false;},addItem:function(contextEl)
{var newItem=this.template.cloneNode(true);Dom.removeClass(newItem,DYNINP_TEMPLATE);newItem.style.display='';if(contextEl){Dom.insertAfter(newItem,contextEl);}else{this.template.parentNode.insertBefore(newItem,this.template);}
App.log("Added item ",newItem);return newItem;},onRemove:function(e,el)
{this.removeItem(el);return false;},onRemoveItem:function(el){},removeItem:function(el)
{var item=this.getGroupElement(el);this.onRemoveItem(item);if(!this.isGroupNew(item))
{var id=this.getGroupId(item);this.updateRemovedIds(id);}
if(!item){return;}
item.parentNode.removeChild(item);},isGroupNew:function(elGroup)
{return(elGroup.className.indexOf(DYNINP_NEW)>=0);},getGroupId:function(el)
{var group=(el.className.indexOf(DYNINP_ITEM)>=0)?el:this.getGroupElement(el);var inputs=Dom.getElementsByClassName(DYNINP_ITEM_ID,'input',group);return inputs[0]?inputs[0].value:App.alert("DynInput(%s) - missing DYNINP_ITEM_ID field in group",this.parent.id||'');},getGroupElement:function(el)
{return Dom.getAncestorByClassName(el,DYNINP_ITEM);},updateRemovedIds:function(id)
{var sId;this.removedIds[id]=true;var ids=[];for(sId in this.removedIds){if(this.removedIds.hasOwnProperty(sId)){ids.push(sId);}}
if(!this.elRemoveData){this.elRemoveData=Dom.getElementsByClassName(DYNINP_REMOVE_DATA,'input',this.parent)[0];if(!this.elRemoveData){App.alert("DynInput() - missing DYNINP_REMOVE_DATA input");}}
this.elRemoveData.value=ids.join(",");App.log("DynInput(%s) removedIds: %o",this.parent.id||this.parent.nodeName,ids);}};})();(function(){var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event;App.Ui.AutoFocus=function(el)
{Event.onDOMReady(function()
{var tagName,elType;el=Y.lang.isString(el)?Dom.get(el):el;if(!el||typeof(el.focus)==="undefined"){return;}
elType=Dom.getAttribute(el,"type");tagName=el.tagName.toLowerCase();if((tagName==="input"&&elType==="text"&&/^\s*$/.test(el.value))||tagName==="select"||tagName==="textarea")
{el.focus();}});};})();(function(){App.Ui.DateSelection=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,DateSelection=App.Ui.DateSelection;DateSelection.CSS_SKIN="yui-datesel-dlg";DateSelection.inst=null;DateSelection.DATEPICKER_DLG_ID="datepicker-dlg";DateSelection.active=null;DateSelection.formatDate=function(d,fmt)
{function pad(n){return n<10?'0'+n:n;}
var parts=fmt.split('');var c;var s='';for(i=0;i<parts.length;i++){c=parts[i];switch(c){case'Y':s+=d.getFullYear();break;case'M':s+=pad(d.getMonth()+1);break;case'D':s+=pad(d.getDate());break;case'h':s+=pad(d.getHours());break;case'm':s+=pad(d.getMinutes());break;case's':s+=pad(d.getSeconds());break;default:s+=c;break;}}
return s;};DateSelection.parseDate=function(sDate,sFormat)
{var d=new Date();var fparts=sFormat.split(/[^YMDhms]/);var dparts=sDate.split(/[^0-9]/);d.setHours(0);d.setMinutes(0);d.setSeconds(0);for(i=0;i<fparts.length;i++){var c=fparts[i];var n=parseInt(dparts[i],10);switch(c){case'Y':d.setYear(n);break;case'M':d.setMonth(n-1);break;case'D':d.setDate(n);break;case'h':d.setHours(n);break;case'm':d.setMinutes(n);break;case's':d.setSeconds(n);break;default:break;}}
return d;};DateSelection.cleanUp=function(elRoot)
{var els=Dom.getElementsByClassName("date-selection","a",elRoot);for(i=0;i<els.length;i++){if(els[i]._datesel){els[i]._datesel.destroy();}}};DateSelection.prototype={dialog:null,calendar:null,rendered:false,init:function(options)
{App.log('App.Ui.DateSelection(%o)',options);options.zIndex=options.zIndex||101;this.dialog=this.createDialog(options);this.calendar=this.createCalendar(options,this.dialog);this.createClicky();this.contextEl=options.context;this.dialog.cfg.setProperty("context",[options.context,"tl","bl"]);},show:function()
{if(DateSelection.active){DateSelection.active.hide();}
if(!this.rendered){this.calendar.render();this.rendered=true;}
this.dialog.show();DateSelection.active=this;},hide:function()
{DateSelection.active=null;this.dialog.hide();},destroy:function()
{if(this.calendar){this.calendar.destroy();this.calendar=null;}
if(this.dialog){this.dialog.destroy();this.dialog=null;}},createDialog:function(options)
{var dlg_id="datesel-"+Dom.generateId();var dialog=new YAHOO.widget.Dialog(dlg_id,{visible:false,context:[options.context,"tl","tl"],draggable:false,close:true,zIndex:options.zIndex,width:"222px"});Dom.addClass(dialog.element,DateSelection.CSS_SKIN);dialog.setHeader('&nbsp;');dialog.setBody('<div></div>');dialog.render(document.body);dialog.showEvent.subscribe(function()
{if(true||YAHOO.env.ua.ie)
{dialog.fireEvent("changeContent");}},this,true);return dialog;},createCalendar:function(options,dialog)
{var dialogBody=Dom.getFirstChild(dialog.body);var calendar=new YAHOO.widget.Calendar(dialogBody,{iframe:false,hide_blank_weeks:true});calendar.cfg.setProperty("START_WEEKDAY",1);calendar.cfg.setProperty("MONTHS_LONG",App.env.localize.CAL_MONTHS);calendar.cfg.setProperty("WEEKDAYS_SHORT",App.env.localize.CAL_WEEKDAYS_SHORT);if(options.selected){this.setSelectedDate(options.selected);}
calendar.selectEvent.subscribe(function()
{this.hide();if(options.handler)
{var oDate=(calendar.getSelectedDates().length>0)?calendar.getSelectedDates()[0]:null;options.handler.apply(this,[oDate,this]);}},this,true);dialog.cancelEvent.subscribe(function(){this.hide();},this,true);calendar.renderEvent.subscribe(function()
{dialog.fireEvent("changeContent");},this,true);return calendar;},setSelectedDate:function(selected)
{App.log("DateSelection::setSelectedDate(%o)",selected);if(/(\d+)\/(\d+)\/(\d+)/.test(selected))
{var sDay=RegExp.$1;var sMonth=RegExp.$2;var sYear=RegExp.$3;var sSelected=[sMonth,sDay,sYear].join('/');var sPageDate=[sMonth,sYear].join('/');this.calendar.cfg.setProperty("selected",sSelected);this.calendar.cfg.setProperty("pagedate",sPageDate);this.rendered=false;}},createClicky:function()
{var that=this;if(!DateSelection.hasClicky)
{Event.on(document,"click",function(e)
{var ds=DateSelection.active;if(ds)
{var el=Event.getTarget(e);var dialogEl=ds.dialog.element;if(el!==dialogEl&&!Dom.isAncestor(dialogEl,el))
{ds.hide();}}},this,true);DateSelection.hasClicky=true;}}};})();(function(){App.Ui.DatePicker=App.Helper.createClass();var Y=YAHOO,Dom=Y.util.Dom,DateSelection=App.Ui.DateSelection,DatePicker=App.Ui.DatePicker;var DEFAULT_DATESAVE_FORMAT='Y-M-DTh:m:sZ';var DEFAULT_DATEVIEW_FORMAT='D/M/Y';DatePicker.DATEPICKER_GROUP="datepicker-group";DatePicker.newOnDateSelection=function(handler){var datePicker=function(e,el){App.log("DatePicker.onDateSelection(%o)",el);var datesel=el._datesel;if(!datesel){el._datesel=datesel=new App.Ui.DatePicker({context:el,handler:handler});}
datesel.updateSelectedDate();datesel.show();return false;};return datePicker;};DatePicker.onDateSelection=function(e,el)
{App.log("DatePicker.onDateSelection(%o)",el);var datesel=el._datesel;if(!datesel){el._datesel=datesel=new App.Ui.DatePicker({context:el,handler:DatePicker.defaultHandler});}
datesel.updateSelectedDate();datesel.show();return false;};DatePicker.defaultHandler=function(oDate,oDatePicker)
{App.log("DatePicker.defaultHandler(arguments %o)",arguments);var data=App.Ui.Helper.getDataset(this.getGroup());var dateSaveFormat=data['fmt-save']||DEFAULT_DATESAVE_FORMAT;var dateViewFormat=data['fmt-view']||DEFAULT_DATEVIEW_FORMAT;this.setElement("date-save",App.Ui.DateSelection.formatDate(oDate,dateSaveFormat));this.setElement("date-view",App.Ui.DateSelection.formatDate(oDate,dateViewFormat));};App.Helper.extend(DatePicker,DateSelection,{init:function(options)
{App.log('App.Ui.DatePicker(%o)',options);DatePicker.superclass.init.apply(this,arguments);this.elContext=options.context;},updateSelectedDate:function()
{var elDateSave=this.getElement('date-save');if(elDateSave.value!=='')
{var data=App.Ui.Helper.getDataset(this.getGroup());var sDateFormat=data['fmt-save']||DEFAULT_DATESAVE_FORMAT;var oSelDate=DateSelection.parseDate(elDateSave.value,sDateFormat);var sSelected=DateSelection.formatDate(oSelDate,"D/M/Y");this.setSelectedDate(sSelected);}},getGroup:function()
{var elGroup=this.elGroup?this.elGroup:(this.elGroup=Dom.getAncestorByClassName(this.elContext,DatePicker.DATEPICKER_GROUP));if(!elGroup){App.halt("App.Ui.DatePicker.getGroup() invalid datepicker-group");}
return elGroup;},getElement:function(classname)
{return Dom.getElementsByClassName(classname,"*",this.getGroup())[0];},setElement:function(classname,value)
{var el=this.getElement(classname);if(el)
{if(el.tagName.toUpperCase()==="INPUT")
{el.value=value;}
else
{el.innerHTML=value;}}}});})();(function(){var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event;App.Ui.maxLength={onDOMReady:function(rootEl){Event.onDOMReady(function(){App.Ui.maxLength.run(rootEl);},rootEl);},run:function(rootEl)
{rootEl=Y.lang.isString(rootEl)?Dom.get(rootEl):rootEl;if(Y.lang.isUndefined(rootEl)){rootEl=document;}
var matchEls=rootEl.getElementsByTagName('textarea');var totalEls=matchEls.length;if(totalEls>0){for(var i=0;i<totalEls;i++){var maxLength=App.Ui.Helper.getDataset(matchEls[i]).maxlength;if(YAHOO.lang.isUndefined(maxLength)){maxLength=App.Ui.Helper.getParams(matchEls[i],"textarea").maxlength;}
if(!YAHOO.lang.isUndefined(maxLength)){matchEls[i].maxLength=parseInt(maxLength,10);this._initEvents(matchEls[i]);}}}},_initEvents:function(el){YAHOO.util.Event.on(el,'keyup',this._handleChange,el,true);YAHOO.util.Event.on(el,'keydown',this._handleChange,el,true);},_handleChange:function(e,el){var curLength=el.value.length;var leftLength=el.maxLength-curLength;if(leftLength<0){el.value=el.value.substring(0,el.maxLength);}}};})();YAHOO.namespace('YAHOO.Hack').FixIESelectWidth=function()
{var oSelf=this;var YUE=YAHOO.util.Event;var YUD=YAHOO.util.Dom;var oTimer={};var oAnim={};var nTimerId=0;var dLastFocalItem;var ie7=!!(document.uniqueID&&typeof(XMLHttpRequest)!=='undefined');function init(el)
{el=el||this;if(el.tagName.toLowerCase()!='select'){throw Error('element ['+el.id+'] is not <select>');}
if(!YUD.hasClass(el.parentNode,'select-box')){throw Error('className select-box is not included for element ['+el.id+']');}
var oRs=el.runtimeStyle;var oPRs=el.parentNode.runtimeStyle;oPRs.fonSize=0;var sDisplay=el.parentNode.currentStyle.display.toLowerCase();if(sDisplay==''||sDisplay=='inline'||sDisplay=='inline-block'){oPRs.display='inline-block';oPRs.width=el.offsetWidth+'px';oPRs.height=el.offsetHeight+'px';oPRs.position='relative';oRs.position='absolute';oRs.top=0;oRs.left=0;}
var nStartWidth=el.offsetWidth;el.runtimeStyle.width='auto';var nEndWidth=el.offsetWidth;el.runtimeStyle.width=nStartWidth;if(nEndWidth>nStartWidth){el._timerId=(nTimerId+=1);el.selectedIndex=Math.max(0,el.selectedIndex);oTimer['_'+el._timerId]=setTimeout('void(0)',0);oAnim['A'+el._timerId]=setTimeout('void(0)',0);YUE.on(el,'mouseover',onMouseOver);YUE.on(document,'mousedown',onMouseDown,el,true);YUE.on(el,'change',collapseSelect,el,true);}}
function collapseSelect(e)
{status++;this.runtimeStyle.width='';}
function onMouseOver(e)
{var el=this;if(dLastFocalItem&&dLastFocalItem!=el){onMouseDown.call(dLastFocalItem,e);}
var sTimerId='_'+el._timerId;var sAniId='A'+el._timerId;clearTimeout(oTimer[sTimerId]);var onTween=function()
{clearTimeout(oAnim[sAniId]);if(Math.abs(nEndWidth-nStartWidth)>3){nStartWidth+=(nEndWidth-nStartWidth)/3;el.runtimeStyle.width=nStartWidth+'px';oAnim[sAniId]=setTimeout(onTween,0);}else{el.runtimeStyle.width='auto';el.selectedIndex=Math.max(0,el.selectedIndex);}};var nStartWidth=el.offsetWidth;el.runtimeStyle.width='auto';var nEndWidth=el.offsetWidth;clearTimeout(oAnim[sAniId]);onTween();el.focus();dLastFocalItem=el;}
function onMouseDown(e,el)
{el=(e.srcElement||e.target);if(el==this&&e.type!='mouseover')
{status++;YUE.stopEvent(e);return false;}
el=this;clearTimeout(oAnim['A'+el._timerId]);var sTimerId='_'+el._timerId;var doItLater=function(){el.runtimeStyle.width='';};if(e.type=='mouseover'){doItLater();}else{oTimer[sTimerId]=setTimeout(doItLater,100);}}
function constructor(sId)
{sId=[sId,''].join('');if(document.uniqueID&&window.createPopup)
{YUE.onAvailable(sId,init);return true;}
else{return false;}}
return constructor;};(function(){var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event;App.Ui.fixDropdowns={onDOMReady:function(rootEl)
{Event.onDOMReady(function(){App.Ui.fixDropdowns.run(rootEl);},rootEl);},run:function(rootEl)
{var fixVersion=App.env.FIX_IE_DROPDOWN_VERSION;if(YAHOO.env.ua.ie>fixVersion){return false;}
if(YAHOO.env.ua.ie>0){App.log("fixDropdowns activated");rootEl=Y.lang.isString(rootEl)?Dom.get(rootEl):rootEl;if(Y.lang.isUndefined(rootEl)){rootEl=document;}
var selectEls=rootEl.getElementsByTagName('select');var totalEls=selectEls.length;var className="select-box";for(var i=0;i<totalEls;i++){var spanNode=rootEl.createElement("span");var spanEl=YAHOO.util.Dom.insertBefore(spanNode,selectEls[i]);spanEl.appendChild(selectEls[i]);YAHOO.util.Dom.addClass(spanEl,className);var create=new YAHOO.Hack.FixIESelectWidth(selectEls[i].id);}}}};})();(function(){var Y=YAHOO,Dom=Y.util.Dom;App.Ui.CheckboxManager={IGNORE_ITEM:"cb-ignore",group:[],addGroup:function(el,options)
{App.log("addGroup ",el,options);var success=false;if(el){var tempID=false;if(Y.lang.isString(el)){tempID=el;}else if(el.id){tempID=el.id;}
var domEl=Dom.get(tempID);if(!domEl){App.log("ERROR: no DOM object with ID '"+el+"' exists! ");return false;}
this.group[tempID]={id:tempID,div:null,allChecked:false,options:{ignore:this.IGNORE_ITEM}};if(tempID){this.group[tempID].div=domEl;success=true;}}else{App.halt("Element ID string or DOM object missing, can't create");}
App.log("group element ",this.group[tempID]);if(options)this._handleOptions(tempID,options);this.saveState(tempID);return success;},_handleOptions:function(groupID,options)
{for(p in options)this.group[groupID].options[p]=options[p];App.log('this.options %o',this.group[groupID].options);},selectAll:function(groupID){this._changeBoxes(groupID,true);},deselectAll:function(groupID){this._changeBoxes(groupID,false);},toggleAll:function(groupID,toggleObj){if(!this._groupExists(groupID))return false;if(Y.lang.isUndefined(toggleObj)){var newValue=!this.group[groupID].allChecked;}else{if(!Y.lang.isUndefined(toggleObj.checked)){var newValue=toggleObj.checked;}}
if(!Y.lang.isUndefined(newValue)){this.group[groupID].allChecked=newValue;this._changeBoxes(groupID,newValue);}},_groupExists:function(groupID){var exists=!Y.lang.isUndefined(this.group[groupID]);if(!exists)exists=this.addGroup(groupID);return exists;},_changeBoxes:function(groupID,bChecked)
{if(!this._groupExists(groupID))return false;var boxes=this._getCheckboxes(groupID);for(i=0;i<boxes.length;i++){boxes[i].checked=bChecked;}
this.group[groupID].allChecked=bChecked;},_getCheckboxes:function(groupID)
{var query="#"+groupID+" input[type=checkbox]:not([class="+this.group[groupID].options.ignore+"])";var nodes=YAHOO.util.Selector.query(query);App.log("query: ",query);App.log("matching nodes: ",nodes);return nodes;},saveState:function(groupID)
{App.log("saveState ",groupID);if(!this._groupExists(groupID))return false;var boxes=this._getCheckboxes(groupID);this.group[groupID].boxes=[];for(i=0;i<boxes.length;i++){this.group[groupID].boxes[i]={checked:boxes[i].checked};}},restoreState:function(groupID)
{App.log("restoreState ",groupID);if(!this._groupExists(groupID)||this.group[groupID].boxes.length<1)return false;var boxes=this._getCheckboxes(groupID);for(i=0;i<boxes.length;i++){boxes[i].checked=this.group[groupID].boxes[i].checked;}}};})();(function(){var Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,PANEL_BORDER_W=36;App.Ui.ImageLightbox=function(conf)
{App.log("App.Ui.ImageLightbox(%o)",conf);this.conf=conf||{};this.conf.imageBase=App.env.assetsPath||App.warn("App.Ui.ImageLightbox(): assetsPath not defined");this.conf.imageBase+="scripts/ui/imagelightbox";this._init();this._initLightbox();this._initLoader();};App.Ui.ImageLightbox.CLASS_IMAGE_LIGHTBOX="image-lightbox";App.Ui.ImageLightbox.CLASS_GALLERY_LIGHTBOX="gallery-lightbox";App.Ui.ImageLightbox.prototype.destroy=function()
{App.log("*** App.Ui.ImageLightbox.destroy()");if(this.prevBtnCon)this.prevBtnCon.parentNode.removeChild(this.prevBtnCon);if(this.nextBtnCon)this.nextBtnCon.parentNode.removeChild(this.nextBtnCon);if(this.showImgPanel){this.showImgPanel.hide();this.showImgPanel.destroy();}
if(this.lightboxLoader){this.lightboxLoader.destroy();}};App.Ui.ImageLightbox.prototype._init=function()
{Dom.addClass(document.body,'yui-skin-sam');};App.Ui.ImageLightbox.prototype.show=function(options)
{this._options=options;this.conf.viewer=options.viewer||false;this.conf.imgsrc=options.url||"-url error-";this.conf.shareLinks=options.shareLinks||false;App.log("LIGHTBOX this.conf.shareLinks ",this.conf.shareLinks);while(this._imgHolder.firstChild){this._imgHolder.removeChild(this._imgHolder.firstChild);}
var image=document.createElement('img');this._imgHolder.appendChild(image);Event.on(image,'load',this.onImageLoad,{self:this,image:image,imgId:Dom.generateId()});this.lightboxLoader.show();image.src=this.conf.imgsrc;if(this.conf.viewer){App.log("> GALLERY VIEWER");}else{App.log("> STANDALONE VIEWER");}};App.Ui.ImageLightbox.prototype.onImageLoad=function(e,o)
{o.self.lightboxLoader.hide();while(o.self._resizeBtnCon.firstChild)
{o.self._resizeBtnCon.removeChild(o.self._resizeBtnCon.firstChild);}
Event.purgeElement(o.self.showImgPanel.header,false,'click');o.self.fullsizeWidth=o.image.width;o.self.fullsizeHeight=o.image.height;var imageWidth=o.self.fullsizeWidth;var imageHeight=o.self.fullsizeHeight;var viewPortWidth=Dom.getViewportWidth()-PANEL_BORDER_W;var viewPortHeight=Dom.getViewportHeight()-70;o.image.title="***"+o.self._options.title+"***";if(imageWidth>250&&imageHeight>250&&(imageWidth>viewPortWidth||imageHeight>viewPortHeight))
{var onBtnMaximumClick=function(e,o)
{o.image.width=o.self.fullsizeWidth;o.image.height=o.self.fullsizeHeight;o.self.showImgPanel.cfg.setProperty('width',(parseInt(o.self.fullsizeWidth,10)+PANEL_BORDER_W)+'px');o.self.showImgPanel.cfg.setProperty('x',5);o.self._setResizeButton('restore');o.self.showImgPanel.showState='maximum';};Event.on(o.self._btnMaximum,'click',onBtnMaximumClick,o);var onBtnRestoreClick=function(e,o)
{o.self._setResizeButton('maximum');o.self._autoFit(o.image,o.imgId);o.self.showImgPanel.showState='restore';};Event.on(o.self._btnRestore,'click',onBtnRestoreClick,o);var showImgPanelHeaderDblClickHandler=function(e,o)
{if(o.self.showImgPanel.showState=='maximum'){o.onBtnRestoreClick('dblclick',o);}
else{o.onBtnMaximumClick('dblclick',o);}};Event.on(o.self.showImgPanel.header,'dblclick',showImgPanelHeaderDblClickHandler,{self:o.self,image:o.image,imgId:o.imgId,onBtnMaximumClick:onBtnMaximumClick,onBtnRestoreClick:onBtnRestoreClick});o.self.showImgPanel.showState='restore';o.self._setResizeButton('maximum');}
var title=o.self._options.lightboxtitle||'&nbsp;';var rootNode=Dom.get(o.self.panelID+"_c");Dom.addClass(rootNode,'ig-overlay');o.self.showImgPanel.show();o.self._autoFit(o.image);if(o.self.conf.viewer){YAHOO.util.Event.removeListener(o.self.prevBtnCon);YAHOO.util.Event.removeListener(o.self.nextBtnCon);Event.on(o.self.prevBtnCon,'click',o.self.closeHandler,o.self,true);Event.on(o.self.nextBtnCon,'click',o.self.closeHandler,o.self,true);var temp=o.image.height/2-58+58;Dom.setStyle(o.self.prevBtnCon,'top',temp+'px');Dom.setStyle(o.self.nextBtnCon,'top',temp+'px');}else{Dom.setStyle(o.self.prevBtnCon,'display','none');Dom.setStyle(o.self.nextBtnCon,'display','none');}};App.Ui.ImageLightbox.prototype._autoFit=function(image)
{var iw=image.width;var ih=image.height;var vw=Dom.getViewportWidth()-PANEL_BORDER_W;var vh=Dom.getViewportHeight()-70-70;if(iw>=250||ih>=250)
{if(iw>vw||ih>vh)
{var ratioi=iw/ih;var ratiow=vw/vh;if(ratioi<=ratiow)
{image.height=vh;image.width=iw*(vh/ih);}
else
{image.width=vw;image.height=ih*(vw/iw);}}
this.showImgPanel.cfg.setProperty('width',(image.width+PANEL_BORDER_W)+'px');}
else
{this.showImgPanel.cfg.setProperty('width','250px');}
this.showImgPanel.center();};App.Ui.ImageLightbox.prototype._initLoader=function()
{if(!this.lightboxLoader){var lightboxLoader=new YAHOO.widget.Panel(this.panelID+'_lightboxLoader',{width:(220+PANEL_BORDER_W)+"px",fixedcenter:true,close:false,draggable:false,modal:true,visible:false});lightboxLoader.setHeader("Loading, please wait...");var progressBar=document.createElement('img');progressBar.src=this.conf.imageBase+'/progressBar.gif';lightboxLoader.setBody(progressBar);lightboxLoader.render(document.body);this.lightboxLoader=lightboxLoader;}};App.Ui.ImageLightbox.prototype._destroyNode=function(DOMnode)
{var delNode=Dom.get(DOMnode);if(delNode){document.body.removeChild(delNode);}};App.Ui.ImageLightbox.prototype._initLightbox=function()
{var showImgPanel;if(this.conf.viewer){this.panelID=Dom.generateId();}else{this.panelID='tcc_showImgPanel';this._destroyNode(this.panelID+"_lightboxLoader_c");this._destroyNode(this.panelID+"_lightboxLoader_mask");this._destroyNode(this.panelID+"_c");this._destroyNode(this.panelID+"_mask");}
this.showImgPanel=showImgPanel=new YAHOO.widget.Panel(this.panelID,{width:'400px',visible:false,draggable:true,underlay:"none",zIndex:100,modal:true});this.nextEvent=new YAHOO.util.CustomEvent("nextEvent",this);this.prevEvent=new YAHOO.util.CustomEvent("prevEvent",this);var imgHolder=document.createElement('div');imgHolder.id=this.panelID+'ImgHolder';Dom.setStyle(imgHolder,'text-align','center');showImgPanel.setBody(imgHolder);showImgPanel.setHeader('&nbsp;');showImgPanel.render(document.body);Event.on(showImgPanel.body,'click',this.closeHandler,this,true);Dom.setStyle(showImgPanel.body,'cursor','pointer');var showImgPanelMoveHandler=function(e,o){this.sizeMask();};showImgPanel.moveEvent.subscribe(showImgPanelMoveHandler);var showImgPanelElem=Dom.get(this.panelID);var resizeBtnCon=document.createElement('div');resizeBtnCon.id=this.panelID+'ResizeBtnCon';Dom.setStyle(resizeBtnCon,'position','absolute');Dom.setStyle(resizeBtnCon,'right','35px');Dom.setStyle(resizeBtnCon,'top','11px');App.log("this.conf ",this.conf);if(!this.prevBtnCon){this.prevBtnCon=document.createElement('div');this.prevBtnCon.id=Dom.generateId();Dom.addClass(this.prevBtnCon,'ig_button');Dom.setStyle(this.prevBtnCon,'position','absolute');Dom.setStyle(this.prevBtnCon,'left','-50px');Dom.setStyle(this.prevBtnCon,'top','60px');showImgPanelElem.appendChild(this.prevBtnCon);this.prevBtnCon.innerHTML='<a class="uiCBtn ig_prev ig_arrow" href="javascript:;"><span><span><u><em>?</em></u></span></span></a>';}
if(!this.nextBtnCon){this.nextBtnCon=document.createElement('div');this.nextBtnCon.id=Dom.generateId();Dom.addClass(this.nextBtnCon,'ig_button');Dom.setStyle(this.nextBtnCon,'position','absolute');Dom.setStyle(this.nextBtnCon,'right','-50px');Dom.setStyle(this.nextBtnCon,'top','60px');showImgPanelElem.appendChild(this.nextBtnCon);this.nextBtnCon.innerHTML='<a class="uiCBtn ig_next ig_arrow" href="javascript:;"><span><span><u><em>?</em></u></span></span></a>';}
App.log("this.conf.shareLinks ",this.conf.shareLinks,this.shareLinks);if(this.conf.shareLinks&&!this.shareLinks){App.log("SHOW FACEBOOK LINKS");this.shareLinks=document.createElement('div');var shareEl=Dom.get(this.conf.shareLinks);App.log("shareEl ",shareEl);this.shareLinks.id=this.conf.shareLinks+"_box";Dom.addClass(this.shareLinks,'m_share');showImgPanelElem.appendChild(this.shareLinks);this.shareLinks.innerHTML=shareEl.innerHTML;App.log("this.shareLinks ",this.shareLinks);}
var btnMaximum=document.createElement('img');btnMaximum.src=this.conf.imageBase+'/maximum.gif';var btnRestore=document.createElement('img');btnRestore.src=this.conf.imageBase+'/restore.gif';this._resizeBtnCon=resizeBtnCon;this._btnRestore=btnRestore;this._btnMaximum=btnMaximum;this._imgHolder=imgHolder;};App.Ui.ImageLightbox.prototype.closeHandler=function(e)
{Event.stopEvent(e);if(this.conf.viewer){var eventTarget=YAHOO.util.Event.getTarget(e);if(eventTarget.tagName.toLowerCase()!='div'){eventTarget=YAHOO.util.Dom.getAncestorByTagName(eventTarget,"div");}
var doEvent=null;if(eventTarget.id==this.prevBtnCon.id){doEvent=this.prevEvent;}else if(eventTarget.id==this.nextBtnCon.id){doEvent=this.nextEvent;}else{var mouseX=YAHOO.util.Event.getXY(e)[0];var clickX=mouseX-YAHOO.util.Dom.getX(eventTarget);var middle=eventTarget.offsetWidth/2;doEvent=(clickX<middle)?this.prevEvent:this.nextEvent;}
YAHOO.util.Event.removeListener(this.prevBtnCon);YAHOO.util.Event.removeListener(this.nextBtnCon);if(doEvent){this.showImgPanel.hide();this.dispatchEvent(doEvent);}}else{this.showImgPanel.hide();}};App.Ui.ImageLightbox.prototype.dispatchEvent=function(ev,data){if(YAHOO.lang.isUndefined(ev))return false;var data=data||{};data.imgsrc=this.conf.imgsrc;ev.fire(data);};App.Ui.ImageLightbox.prototype._setResizeButton=function(type)
{while(this._resizeBtnCon.firstChild)
{this._resizeBtnCon.removeChild(this._resizeBtnCon.firstChild);}
if(type=='maximum')
{this._resizeBtnCon.appendChild(this._btnMaximum);}
else
{this._resizeBtnCon.appendChild(this._btnRestore);}};})();YAHOO.namespace("deconcept");YAHOO.deconcept=YAHOO.deconcept||{};if(typeof YAHOO.deconcept.util=="undefined"||!YAHOO.deconcept.util){YAHOO.deconcept.util={};}if(typeof YAHOO.deconcept.SWFObjectUtil=="undefined"||!YAHOO.deconcept.SWFObjectUtil){YAHOO.deconcept.SWFObjectUtil={};}YAHOO.deconcept.SWFObject=function(E,C,K,F,H,J,L,G,A,D){if(!document.getElementById){return;}this.DETECT_KEY=D?D:"detectflash";this.skipDetect=YAHOO.deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(E){this.setAttribute("swf",E);}if(C){this.setAttribute("id",C);}if(K){this.setAttribute("width",K);}if(F){this.setAttribute("height",F);}if(H){this.setAttribute("version",new YAHOO.deconcept.PlayerVersion(H.toString().split(".")));}this.installedVer=YAHOO.deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){YAHOO.deconcept.SWFObject.doPrepUnload=true;}if(J){this.addParam("bgcolor",J);}var B=L?L:"high";this.addParam("quality",B);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var I=(G)?G:window.location;this.setAttribute("xiRedirectUrl",I);this.setAttribute("redirectUrl","");if(A){this.setAttribute("redirectUrl",A);}};YAHOO.deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true);},setAttribute:function(A,B){this.attributes[A]=B;},getAttribute:function(A){return this.attributes[A];},addParam:function(A,B){this.params[A]=B;},getParams:function(){return this.params;},addVariable:function(A,B){this.variables[A]=B;},getVariable:function(A){return this.variables[A];},getVariables:function(){return this.variables;},getVariablePairs:function(){var A=[];var B;var C=this.getVariables();for(B in C){if(C.hasOwnProperty(B)){A[A.length]=B+"="+C[B];}}return A;},getSWFHTML:function(){var D="";var C={};var A="";var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}D='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';D+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';C=this.getParams();for(A in C){if(C.hasOwnProperty(A)){D+=[A]+'="'+C[A]+'" ';}}B=this.getVariablePairs().join("&");if(B.length>0){D+='flashvars="'+B+'"';}D+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}D='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';D+='<param name="movie" value="'+this.getAttribute("swf")+'" />';C=this.getParams();for(A in C){if(C.hasOwnProperty(A)){D+='<param name="'+A+'" value="'+C[A]+'" />';}}B=this.getVariablePairs().join("&");if(B.length>0){D+='<param name="flashvars" value="'+B+'" />';}D+="</object>";}return D;},write:function(A){if(this.getAttribute("useExpressInstall")){var B=new YAHOO.deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(B)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof A=="string")?document.getElementById(A):A;C.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!==""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};YAHOO.deconcept.SWFObjectUtil.getPlayerVersion=function(){var D=null;var C=new YAHOO.deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){C=new YAHOO.deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=3;while(D){try{B++;D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+B);C=new YAHOO.deconcept.PlayerVersion([B,0,0]);}catch(E){D=null;}}}else{try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(E){try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");C=new YAHOO.deconcept.PlayerVersion([6,0,21]);D.AllowScriptAccess="always";}catch(E){if(C.major==6){return C;}}try{D=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(E){}}if(D!==null){C=new YAHOO.deconcept.PlayerVersion(D.GetVariable("$version").split(" ")[1].split(","));}}}return C;};YAHOO.deconcept.PlayerVersion=function(A){this.major=A[0]!==null?parseInt(A[0],0):0;this.minor=A[1]!==null?parseInt(A[1],0):0;this.rev=A[2]!==null?parseInt(A[2],0):0;};YAHOO.deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false;}if(this.major>A.major){return true;}if(this.minor<A.minor){return false;}if(this.minor>A.minor){return true;}if(this.rev<A.rev){return false;}return true;};YAHOO.deconcept.util={getRequestParameter:function(D){var C=document.location.search||document.location.hash;if(D===null){return C;}if(C){var B=C.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==D){return B[A].substring((B[A].indexOf("=")+1));}}}return"";}};YAHOO.deconcept.SWFObjectUtil.cleanupSWFs=function(){var C=document.getElementsByTagName("OBJECT");for(var B=C.length-1;B>=0;B--){C[B].style.display="none";for(var A in C[B]){if(typeof C[B][A]=="function"){C[B][A]=function(){};}}}};if(YAHOO.deconcept.SWFObject.doPrepUnload){if(!YAHOO.deconcept.unloadSet){YAHOO.deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",YAHOO.deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",YAHOO.deconcept.SWFObjectUtil.prepUnload);YAHOO.deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A];};}YAHOO.widget.FlashAdapter=function(E,A,B,C){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};B=B||{};this._id=B.id=B.id||YAHOO.util.Dom.generateId(null,"yuigen");B.version=B.version||"9.0.45";B.backgroundColor=B.backgroundColor||"#ffffff";this._attributes=B;this._swfURL=E;this._containerID=A;this._embedSWF(this._swfURL,this._containerID,B.id,B.version,B.backgroundColor,B.expressInstall,B.wmode,C);try{this.createEvent("contentReady");}catch(D){}};YAHOO.widget.FlashAdapter.owners=YAHOO.widget.FlashAdapter.owners||{};YAHOO.extend(YAHOO.widget.FlashAdapter,YAHOO.util.AttributeProvider,{_swfURL:null,_containerID:null,_swf:null,_id:null,_initialized:false,_attributes:null,toString:function(){return"FlashAdapter "+this._id;},destroy:function(){if(this._swf){var B=YAHOO.util.Dom.get(this._containerID);B.removeChild(this._swf);}var A=this._id;for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null;}}},_embedSWF:function(J,I,E,C,F,G,B,H){var D=new YAHOO.deconcept.SWFObject(J,E,"100%","100%",C,F);if(G){D.useExpressInstall(G);}D.addParam("allowScriptAccess","always");if(B){D.addParam("wmode",B);}D.addParam("menu","false");D.addVariable("allowedDomain",document.location.hostname);D.addVariable("YUISwfId",E);D.addVariable("YUIBridgeCallback","YAHOO.widget.FlashAdapter.eventHandler");if(H){D.addVariable("buttonSkin",H);}var A=YAHOO.util.Dom.get(I);var K=D.write(A);if(K){this._swf=YAHOO.util.Dom.get(E);YAHOO.widget.FlashAdapter.owners[E]=this;}else{}},_eventHandler:function(B){var A=B.type;switch(A){case"swfReady":this._loadHandler();return;case"log":return;}this.fireEvent(A,B);},_loadHandler:function(){this._initialized=false;this._initAttributes(this._attributes);this.setAttributes(this._attributes,true);this._initialized=true;this.fireEvent("contentReady");},set:function(A,B){this._attributes[A]=B;YAHOO.widget.FlashAdapter.superclass.set.call(this,A,B);},_initAttributes:function(A){this.getAttributeConfig("altText",{method:this._getAltText});this.setAttributeConfig("altText",{method:this._setAltText});this.getAttributeConfig("swfURL",{method:this._getSWFURL});},_getSWFURL:function(){return this._swfURL;},_getAltText:function(){return this._swf.getAltText();},_setAltText:function(A){return this._swf.setAltText(A);}});YAHOO.widget.FlashAdapter.eventHandler=function(A,B){if(!YAHOO.widget.FlashAdapter.owners[A]){setTimeout(function(){YAHOO.widget.FlashAdapter.eventHandler(A,B);},0);}else{YAHOO.widget.FlashAdapter.owners[A]._eventHandler(B);}};YAHOO.widget.FlashAdapter.proxyFunctionCount=0;YAHOO.widget.FlashAdapter.createProxyFunction=function(B){var A=YAHOO.widget.FlashAdapter.proxyFunctionCount;YAHOO.widget.FlashAdapter["proxyFunction"+A]=function(){return B.apply(null,arguments);};YAHOO.widget.FlashAdapter.proxyFunctionCount++;return"YAHOO.widget.FlashAdapter.proxyFunction"+A.toString();};YAHOO.widget.FlashAdapter.removeProxyFunction=function(A){if(!A||A.indexOf("YAHOO.widget.FlashAdapter.proxyFunction")<0){return;}A=A.substr(26);YAHOO.widget.FlashAdapter[A]=null;};YAHOO.widget.Uploader=function(A,B,D){var C="window";if(!(B)||(B&&D)){C="transparent";}YAHOO.widget.Uploader.superclass.constructor.call(this,YAHOO.widget.Uploader.SWFURL,A,{wmode:C},B);this.createEvent("mouseDown");this.createEvent("mouseUp");this.createEvent("rollOver");this.createEvent("rollOut");this.createEvent("click");this.createEvent("fileSelect");this.createEvent("uploadStart");this.createEvent("uploadProgress");this.createEvent("uploadCancel");this.createEvent("uploadComplete");this.createEvent("uploadCompleteData");this.createEvent("uploadError");};YAHOO.widget.Uploader.SWFURL="assets/uploader.swf";YAHOO.extend(YAHOO.widget.Uploader,YAHOO.widget.FlashAdapter,{upload:function(A,B,E,C,D){this._swf.upload(A,B,E,C,D);},uploadThese:function(B,A,E,C,D){this._swf.uploadThese(B,A,E,C,D);},uploadAll:function(A,D,B,C){this._swf.uploadAll(A,D,B,C);},cancel:function(A){this._swf.cancel(A);},clearFileList:function(){this._swf.clearFileList();},removeFile:function(A){this._swf.removeFile(A);},setAllowLogging:function(A){this._swf.setAllowLogging(A);},setSimUploadLimit:function(A){this._swf.setSimUploadLimit(A);},setAllowMultipleFiles:function(A){this._swf.setAllowMultipleFiles(A);},setFileFilters:function(A){this._swf.setFileFilters(A);},enable:function(){this._swf.enable();},disable:function(){this._swf.disable();}});YAHOO.register("uploader",YAHOO.widget.Uploader,{version:"@VERSION@",build:"@BUILD@"});if(typeof(App)=='undefined'||!App){throw new Error('App is not declared');}
var FLASHOK=false;(function(){App.Ui.Uploader=function(el)
{this.init.apply(this,arguments);}
var
Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event,Form=App.Form;App.Ui.Uploader.prototype={errors:false,uploader:null,fileList:null,totalBytes:0,totalFiles:0,dialogbox:null,uploadList:null,showButton:false,init:function(options)
{App.log('App.Ui.Uploader.init');this._handleOptions(options);this._initUploader();this._initButtonEvents();},_handleOptions:function(options)
{this.options={SWFholder:"uploaderOverlay",browseButton:"btBrowseUpload",uploadStatus:"uploaderStatus",uploadVariables:null,SWFURL:App.env.uploader.SWFURL,allowedURL:App.env.uploader.allowedURL,uploadURL:App.env.uploader.uploadURL,redirectURL:App.env.uploader.redirectURL,allowMultiple:true,allowedFiles:[{description:"Images",extensions:"*.jpg;*.png;*.gif"},{description:"Videos",extensions:"*.avi;*.mov;*.mpg"},{description:"Acrobat PDF",extensions:"*.pdf"}],onUploadFinished:function(){App.log("** PLEASE DEFINE A CALLBACK HANDLER TO REFRESH PAGE CONTENT AFTER *ALL* FILES HAVE BEEN UPLOADED **");}};for(p in options){this.options[p]=options[p];}
if(!this._isExistingID(this.options.browseButton)){App.log("browseButton: no DOM element with id "+this.options.browseButton);}
this.onUploadFinished=this.options.onUploadFinished;App.log('this.options %o',this.options);},msg:function(sTxt,showButton,showProgressBar)
{App.log("msg: "+sTxt);this.showButton=showButton;if(showButton){sTxt+='<div align="right" style="margin-top:0.5em;"><a class="uiIBtn uiIBtnGS" href="#" onclick="top.location.reload();return false;"><span>'+App.env.localize.UPLOAD_CLOSE+'</span></a></div>';}
if(showProgressBar)sTxt='<img src="'+App.env.assetsPath+'scripts/ui/imagelightbox/progressBar.gif" width="100%" height="19"><br />'+sTxt;var html='<p id="uploaderStatus">'+sTxt+'</p>';this.dialogbox.yPanel.setBody(html);},progressbarMsg:function(sTxt,showButton)
{this.msg(sTxt,showButton,true);},_isExistingID:function(el)
{var isValid=true;if(el&&Y.lang.isString(el)){var node=Dom.get(el);if(!node)isValid=false;}else isValid=false;return isValid;},destroy:function()
{App.log('uploader.destroy()');if(this.uploader){this.uploader.destroy();this.uploader=null;}},_initUploader:function()
{var uiLayer=YAHOO.util.Dom.getRegion(this.options.browseButton);var overlay=YAHOO.util.Dom.get(this.options.SWFholder);YAHOO.util.Dom.setStyle(overlay,'width',uiLayer.right-uiLayer.left+"px");YAHOO.util.Dom.setStyle(overlay,'height',uiLayer.bottom-uiLayer.top+15+"px");YAHOO.widget.Uploader.SWFURL=this.options.SWFURL;this.uploader=new YAHOO.widget.Uploader(this.options.SWFholder);this.uploader.addListener('contentReady',this.handleContentReady,this,true);setTimeout(this._noFlash,1000);},_noFlash:function(){if(!FLASHOK){Dom.setStyle(Dom.get("flashMissing"),"display","block");}},handleSecurityError:function(event)
{App.log("handleSecurityError: ",event);},onFileSelect:function(event)
{if('fileList'in event&&event.fileList!=null){var popupMarkup=App.Ui.Helper.generateDialogMarkup({title:App.env.localize.UPLOAD_UPLOADING_FILE,body:'<!-- will be replaced dynamically -->'});this.dialogbox=new App.Ui.AjaxDialog(popupMarkup,{useMarkup:true,events:{"onDialogDestroy":YAHOO.bind(this.cancelUploads,this)}});App.log("OPEN POPUP DIALOGUE ",this.dialogbox);this.dialogbox.yPanel.changeBodyEvent.subscribe(this._updateDialogHeight,this,true);this.fileList=event.fileList;var count=0;var totalSize=0;for(file in this.fileList){count++;totalSize+=parseInt(this.fileList[file].size,10);}
this._createUploadList();}
this.totalBytes=totalSize;this.totalFiles=count;this.checkUploadAllowed();},_createUploadList:function()
{App.log("_resetUploadList this.uploadList ",this.uploadList);this.uploadList=new Array();for(file in this.fileList){this.uploadList.push({"name":this.fileList[file].name,"size":parseInt(this.fileList[file].size,10)});}},_updateDialogHeight:function(e,content){var textNode=Dom.get("uploaderStatus");var textHeight=(textNode)?textNode.offsetHeight:0;var extraHeight=(this.showButton)?30:0;this.dialogbox.yPanel.cfg.setProperty("height",(textHeight+extraHeight+70)+"px");this.dialogbox.show();},handleClicked:function(event){this.clearFileList();},checkUploadAllowed:function(){this.options.uploadVariables.sizeInBytes=this.totalBytes;for(p in this.options.uploadVariables){if(p.indexOf("uploadedFiles")>-1)delete this.options.uploadVariables[p];}
App.log(this.totalFiles+" files for upload - this.options.uploadVariables ",this.options.uploadVariables);for(var i=0;i<this.totalFiles;i++){this.options.uploadVariables["uploadedFiles["+i+"].name"]=this.uploadList[i].name;this.options.uploadVariables["uploadedFiles["+i+"].size"]=this.uploadList[i].size;}
App.log("check server allowed upload ",this.options.allowedURL);this.ar=new App.Ui.AjaxRequest(this.options.allowedURL,{method:'post',success:YAHOO.bind(this.onServerCheck,this),failure:YAHOO.bind(this.onServerFailure,this),parameters:this.options.uploadVariables});},onServerCheck:function(o)
{App.log('onServerCheck handler! Response: %o Arguments: %o Scope: %s',o,o.argument);if(o.responseJSON&&o.responseJSON!==null){App.log("Received JSON data: %o",o.responseJSON);var json=o.responseJSON;if(json.status==1){this.uploadCount=0;this.startUpload();}else{this.msg(json.globalErrors.join("<br />"),true);}}
else if(o.responseJSON===null){App.log("JSON data could not be parsed");}
else{App.log("No JSON data response, or not application/json");}},onServerFailure:function(o)
{App.log('Failure! Response: %o Arguments: %o Scope: %s',o,o.argument);this.msg(App.env.localize.UPLOAD_SERVER_ERROR);},clearFileList:function()
{App.log("clearFileList ");if(this.uploader)this.uploader.clearFileList();this.uploadList=new Array();this.fileList=null;},uploadStart:function(event)
{App.log("uploadStart",event);this.uploadCount++;var filename=this.fileList[event.id].name;this.progressbarMsg(App.env.localize.UPLOAD_UPLOADING_FILE+" \""+filename+"\"");},handleContentReady:function(e){App.log("Uploader handleContentReady");FLASHOK=true;this.uploader.addListener('click',this.handleClicked,this,true);this.uploader.addListener('securityError',this.handleSecurityError,this,true);this.uploader.addListener('fileSelect',this.onFileSelect,this,true);this.uploader.addListener('uploadStart',this.uploadStart,this,true);this.uploader.addListener('uploadProgress',this.onUploadProgress,this,true);this.uploader.addListener('uploadComplete',this.onUploadComplete,this,true);this.uploader.addListener('uploadCompleteData',this.onUploadResponse,this,true);Dom.setStyle(Dom.get("flashMissing"),"display","none");var buttonNode=Dom.get(this.options.browseButton);Dom.removeClass(buttonNode,"disabled");App.log("removed disabled class");this.uploader.setAllowLogging(true);this.uploader.setAllowMultipleFiles(this.options.allowMultiple);var ff=this.options.allowedFiles;this.uploader.setFileFilters(ff);},onUploadProgress:function(event)
{App.log("onUploadProgress: ",event);var filename=this.fileList[event.id].name;var prog=Math.round(100*(event["bytesLoaded"]/event["bytesTotal"]));var feedback=(prog<100)?App.env.localize.UPLOAD_UPLOADING_FILE+" \""+filename+"\" ("+prog+"%)":App.env.localize.UPLOAD_PROCESSING_FILE+" \""+filename+"\"";this.progressbarMsg(feedback);},cancelUploads:function(){App.log("** cancelUploads ** ");this.uploader.cancel();},onUploadResponse:function(event)
{App.log("onUploadResponse: ",event.data);var json=YAHOO.lang.JSON.parse(event.data);if(json.status==0){App.log("Success = false | Cancel uploads");this.uploader.cancel();this.msg(json.globalErrors.join("<br />"),true);}else{App.log("upload successfull");if(this.uploadCount==this.totalFiles){App.log("--- This was last file in list");this.msg(App.env.localize.UPLOAD_FINISHED);if(this.options.redirectURL&&this.options.redirectURL!=""){top.location.href=this.options.redirectURL;}else{this.onUploadFinished(event.data);}}else{this.msg("");}}},onUploadComplete:function(event)
{App.log("onUploadComplete file has been uploaded ",event);},_initButtonEvents:function()
{if(this.options.uploadButton){App.log('add upload button');var bt=Dom.get(this.options.uploadButton);Event.on(bt,"click",this.onUploadButtonClick,this,true);}},startUpload:function()
{App.log("this.fileList: ",this.fileList);if(this.fileList!=null){this.uploader.setSimUploadLimit(1);App.log("uploading... %o (url=%s) vars=%o",this.fileList,this.options.uploadURL,this.options.uploadVariables);this.uploader.uploadAll(this.options.uploadURL,"POST",this.options.uploadVariables,"file");}},onUploadButtonClick:function(e)
{App.log("onUploadButtonClick");YAHOO.util.Event.stopEvent(e);this.startUpload();}};})();(function(){App.Ui.BrowseDialog=App.Helper.createClass();var
Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event;App.Ui.BrowseDialog.prototype={options:null,dialogBox:null,ED:null,init:function(options){options=!!options?options:{};App.log('App.Ui.BrowseDialog.init() and options %o',options);this._handleOptions(options);},_handleOptions:function(options)
{var uploaderCfg=(YAHOO.lang.hasOwnProperty(App.env,'uploader'))?App.env.uploader.cfg:false;this.options={url:App.env.theme.IMAGE_BROWSER_URL,itemClass:"browse-image",selectButton:"browse-select",allowMultiple:false,allowUpload:true,onselect:null,disabled:[],selected:[],uploader:uploaderCfg};for(p in options){this.options[p]=options[p];}
if(uploaderCfg===false&&this.options.allowUpload){App.log("*** ERROR: App.env.uploader.cfg config file not found!");this.options.allowUpload=false;}},show:function(){var url=this.options.url;var that=this;if(!this.dialogbox){this.dialogBox=new App.Ui.AjaxDialog(null,{srcUrl:url,zIndex:500000,events:{onDialogInit:Y.bind(that._initDialog,that,true),onDialogDestroy:Y.bind(that._closeDialog,that,true)}});}
this.dialogBox.show();},_initDialog:function()
{App.log("_initDialog");this._initDialogButtons();if(!this.ED){this.ED=new App.Ui.EventDelegator(this.dialogBox.yPanel.id,"click");if(this.options.allowMultiple){this.ED.on("browse-submit",Y.bind(this._onSubmit,this,true));this._showDisabled();}
this.ED.on(this.options.itemClass,Y.bind(this._onItemSelect,this,true));if(this.options.allowUpload){var uploaderCfg=App.env.uploader.cfg;for(p in uploaderCfg){if(!this.options.uploader[p])this.options.uploader[p]=uploaderCfg[p];}
this.options.uploader.onUploadFinished=Y.bind(this._onUploadFinished,this);this.uploader=new App.Ui.Uploader(this.options.uploader);App.log("initialized upload functionality with cfg ",this.options.uploader);}}},_showDisabled:function(){if(!this.options.allowMultiple)return;var els=Dom.getElementsByClassName(this.options.itemClass,"li",this.div);var totalEls=els.length;var totalDisabled=(Y.lang.isArray(this.options.disabled))?this.options.disabled.length:0;var totalSel=(Y.lang.isArray(this.options.selected))?this.options.selected.length:0;var btSelect=this.options.selectButton;if(totalEls-totalDisabled<=0){App.log("HIDE SELECT BUTTON");if(!Dom.hasClass(btSelect,"hidden"))Dom.addClass(btSelect,"hidden");}else{App.log("SHOW SELECT BUTTON");if(Dom.hasClass(btSelect,"hidden"))Dom.removeClass(btSelect,"hidden");}
if(totalDisabled>0||totalSel>0){for(var i=0;i<totalEls;i++){var d=App.Ui.Helper.getDataset(els[i]);var j=0,found=false;while(!found&&j<totalDisabled){if(d["media-id"]==this.options.disabled[j++]){Dom.addClass(els[i],"disabled");found=true;}}
var j=0,found=false;while(!found&&j<totalSel){if(d["media-id"]==this.options.selected[j++]){Dom.addClass(els[i],"selected");found=true;}}}};},_onUploadFinished:function()
{App.log("** uibrowsedialog _onUploadFinished refreshURL: ",this.options.uploader.refreshURL);var that=this;var ar=new App.Ui.AjaxRequest(this.options.uploader.refreshURL,{method:'get',success:function(o){App.log("loaded content... %o",this);if(o.responseText){var contentEl=Dom.get("browseitem");if(contentEl){contentEl.innerHTML=o.responseText;that._showDisabled();that.uploader.dialogbox.yPanel.destroy();}}}});},_closeDialog:function(e,el)
{App.log("** browseDialog received ajaxdialog close event ",e,el);Y.util.Event.stopEvent(e);if(!this.closing){this.destroy();}else{}},_onSubmit:function(e,el)
{App.log("Browse dialog_onSubmit ",e,el);Y.util.Event.stopEvent(e);var selectedEls=Dom.getElementsByClassName("selected","li",this.div);App.log("Selected dom elements: ",selectedEls);this.options.onselect(selectedEls);this.destroy();},_onItemSelect:function(e,el)
{Y.util.Event.stopEvent(e);if(Dom.hasClass(el,"disabled"))return;App.log("_onItemSelect clicked on ",el);if(this.options.allowMultiple){var d=App.Ui.Helper.getDataset(el);if(Dom.hasClass(el,"selected")){this.unselect(el);App.log("Removed from selected ",this.options.selected);}else{this.select(el);App.log("Add to selected ",this.options.selected);}}else{this.options.onselect(el);this.destroy();}},select:function(el)
{App.log("select ",el);Dom.addClass(el,"selected");var d=App.Ui.Helper.getDataset(el);this.options.selected.push(d['media-id']);},unselect:function(el)
{Dom.removeClass(el,"selected");var d=App.Ui.Helper.getDataset(el);var total=this.options.selected.length;for(var i=0;i<total;i++){if(this.options.selected[i]==d['media-id'])this.options.selected.splice(i,1);}},_initDialogButtons:function()
{App.log("_initDialogButtons");this.options.selectButton=Dom.get(this.options.selectButton);var btSelect=this.options.selectButton;if(btSelect&&this.options.allowMultiple){if(Dom.hasClass(btSelect,"hidden"))Dom.removeClass(btSelect,"hidden");}
var uploadHolder=Dom.get("DLG_uploaderContainer");App.log("uploadHolder ",uploadHolder,this.options.allowUpload);if(uploadHolder&&this.options.allowUpload){if(Dom.hasClass(uploadHolder,"hidden"))Dom.removeClass(uploadHolder,"hidden");}},destroy:function(){if(this.closing)return;this.closing=true;App.log('** App.Ui.BrowseDialog.destroy()');if(this.ED){this.ED.destroy();this.ED=null;}
if(this.uploader){this.uploader.destroy();this.uploader=null;}
if(this.dialogBox){this.dialogBox.destroy();this.dialogBox=null;}}};})();(function(){var
Y=YAHOO,Dom=Y.util.Dom,Event=Y.util.Event;App.Ui.toggle=function(el){var TOGGLE_GROUP="toggle-group";var containerEl=Dom.getAncestorByClassName(el,TOGGLE_GROUP);if(!containerEl)return false;var openEl=Dom.getElementsByClassName("more",null,containerEl);var closeEl=Dom.getElementsByClassName("less",null,containerEl);if(openEl.length==0)return false;var isLess=Dom.hasClass(openEl[0],"hidden");if(isLess){for(var i=0;i<openEl.length;i++)Dom.removeClass(openEl[i],"hidden");for(var i=0;i<closeEl.length;i++)Dom.addClass(closeEl[i],"hidden");}else{for(var i=0;i<openEl.length;i++)Dom.addClass(openEl[i],"hidden");for(var i=0;i<closeEl.length;i++)Dom.removeClass(closeEl[i],"hidden");}}})();if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
