var url='',vrs='';
var CONST_PANELORDER=1,CONST_PANELLIGHTBOX=2,CONST_FRAMEPARENT=-1,CONST_FRAMESELF=0,CONST_FRAMERESULTS=1,CONST_FRAMEBOTTOM=2,CONST_PAGETYPESEARCHRESULTS=1,CONST_PAGETYPELIGHTBOX=2,CONST_PAGETYPEGALLERY=8,CONST_BOOLEANAND=0,CONST_BOOLEANOR=1,CONST_BOOLEANNOT=2;
function addDOMLoadEvent(f){if(!window.__ADLE){var n=function(){if(arguments.callee.d)return;arguments.callee.d=true;if(window.__ADLET){clearInterval(window.__ADLET);window.__ADLET=null}for(var i=0;i<window.__ADLE.length;i++){window.__ADLE[i]()}window.__ADLE=null;document.onclick=null;};if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,false);/*@cc_on @*//*@if (@_win32)document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>");var s=document.getElementById("__ie_onload");s.onreadystatechange=function(){if(this.readyState=="complete")n()};/*@end @*/if(/WebKit/i.test(navigator.userAgent)){window.__ADLET=setInterval(function(){if(/loaded|complete/.test(document.readyState)){n()}},10)}window.onload=n;window.__ADLE=[]}window.__ADLE.push(f)}
if(!Array.prototype.push){Array.prototype.push=function(elem){this[this.length]=elem;}}
var EventManager={_registry:null,
Initialise:function(){if(this._registry==null)
{this._registry=[];
EventManager.Add(window,"unload",this.CleanUp);}},
Add:function(obj,type,fn,useCapture){this.Initialise();
if(typeof obj=="string")
obj=document.getElementById(obj);
if(obj==null||fn==null)
return 0;
if(obj.addEventListener)
{obj.addEventListener(type,fn,useCapture);
this._registry.push({obj:obj,type:type,fn:fn,useCapture:useCapture});
return 1;}
if(obj.attachEvent&&obj.attachEvent("on"+type,fn))
{this._registry.push({obj:obj,type:type,fn:fn,useCapture:0});
return 1;}
return 0;},
CleanUp:function(){for (var i=0;i<EventManager._registry.length;i++){with (EventManager._registry[i])
{if(obj.removeEventListener)
obj.removeEventListener(type,fn,useCapture);
else if(obj.detachEvent)
obj.detachEvent("on"+type,fn);}}
EventManager._registry=null;}};
var iA=infradoxApp,
infradoxApp={initialize:function(localeid,dll,session,template,pagetype,mid,sid,ml,sl,men){this.localeid=localeid;
this.dll=dll;
this.session=session;
this.template=template;
this.pagetype=pagetype;
this.mid=mid;
this.sid=sid;
this.men=men;
this._mainmenulabel=ml;
this._submenulabel=sl;
this._panelLBTpl='panel-lightbox.html';
this._panelOrTpl='panel-order.html';
this._LBTpl='lightbox.html';
this._OR1Tpl='orderstep1.html';
this.sysinf={init:0,os:"lin",brw:"any",ver:0,canlisten:1};},
putsysinfo:function(){if(this.sysinf.init) return;
var s,p,agt=navigator.userAgent.toLowerCase();
this.sysinf.os="lin";
if(agt.indexOf('win')!=-1) this.sysinf.os="win";
if(agt.indexOf('mac')!=-1) this.sysinf.os="mac";
if(this.sysinf.os=="mac"){p=agt.indexOf('safari/');
if(p!=-1){this.sysinf.brw="safari";
s=agt.substring(p+7);
this.sysinf.ver=parseInt(s);
if(this.sysinf.ver<=419) this.sysinf.canlisten=0;}}
this.sysinf.init=1;},
testCookie:function(n,v){var ok=0;
infradoxApp.eraseCookie(n);
infradoxApp.createCookie(n,v,1);
ok=(infradoxApp.readCookie(n)==v);
infradoxApp.eraseCookie(n);
return ok;},
createCookie:function(n,v,days){var expires="";
if(days){var date=new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires=";expires="+date.toGMTString();}
document.cookie=n+"="+v+expires+";path=/";},
readCookie:function(n){var nameEQ=n+"=",ca=document.cookie.split(';');
for(var i=0;i<ca.length;i++){var c=ca[i];
while(c.charAt(0)==' ') c=c.substring(1,c.length);
if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length);}
return null;},
eraseCookie:function(n){this.createCookie(n,"",-1);},
panelTemplate:function(pType){return ((pType==CONST_PANELLIGHTBOX)?this._panelLBTpl:this._panelOrTpl);},
lightboxTemplate:function(fulls){return (fulls?this._LBTpl:this.panelTemplate(CONST_PANELLIGHTBOX));},
localeName:function(){return cfg.locales[this.localeid].name;},
getTimeStamp:function(){var now=new Date(),s=now.getSeconds();
return (s+(s / 2)+(s * 3) * 31).toString()+'.'+s.toString();},
putInnerHtml:function(eName,m,dispAlert){var e=this.getElement(eName);
if(e){e.innerHTML=m;
} else if(dispAlert){alert(m);}},
getInnerText:function(e){return (document.getElementsByTagName("body")[0].innerText !=undefined)?e.innerText:e.textContent;},
completeURL:function(u){return this.dll+u+((u.indexOf('?')==-1)?'?':'&')+'si='+this.session+'&rnd='+this.getTimeStamp();},
completePostVars:function(v){return 'session='+this.session+((v!='')?'&':'')+v;},
getElement:function(eID,oDoc){var el=0;
if(document.getElementById){el=document.getElementById(eID);
}else{if(document.all) el=document.all[eID];}
if(!el){if(!oDoc) oDoc=document;
if(document.layers){if(oDoc.layers[eID]){el=oDoc.layers[eID];
}else{for(var x=0,y;!y&&x<oDoc.layers.length;x++){y=infradoxApp.getElement(eID,oDoc.layers[x].document);}
el=y;}}}
if(!el&&cfg.debug) alert('no '+eID);
return el;},
createDomElement:function(stng,pEl){var el=document.createElement(stng.type);
if(stng.src) el.src=stng.src;
if(stng.text) el.appendChild(document.createTextNode(stng.text));
if(stng.type=='A') el.style.cursor='pointer';
if(stng.id) el.id=stng.id;
if(stng.className) el.className=stng.className;
if(pEl) pEl.appendChild(el);
return el;},
getTplNamePart:function(){var t;
if(parent.resultspanel) t=parent.resultspanel.infradoxApp.template;
return (t)?t.replace('.html',''):'';},
loadParent:function(_url,nc){parent.location.href=nc?this.completeURL(_url):_url;},
loadLocation:function(_url,nc){self.location.href=nc?this.completeURL(_url):_url;},
loadBottom:function(_url,nc){parent.bottompanel.location.href=nc?this.completeURL(_url):_url;},
loadTarget:function(_url,nc,trg){_url=nc?this.completeURL(_url):_url;
var p=parent;
switch(trg){case CONST_FRAMEPARENT:p.location.href=_url;break;
case CONST_FRAMESELF:location.href=_url;break;
case CONST_FRAMERESULTS:p.resultspanel.location.href=_url;break;
case CONST_FRAMEBOTTOM:p.bottompanel.location.href=_url;break;}},
loadWindow:function(_url,nc,winT,winP){_url=nc?this.completeURL(_url):_url;
if(!winP) winP='toolbar=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=650';
windowTitle=window.open(_url,winT,winP);
windowTitle.focus();},
createAdminMessageDiv:function(aEl,msg){this.createDomElement({type:"DIV",className:"adminMsg",text:'Administrator message:'+msg},aEl);},
getMenuItem:function(id,main){var it=null,main=menu.main;
var mlen=main.length;
for(var j=0;j<mlen;j++){if(main[j].id==id){it=main[j];
break;}}
return it;},
getMainItemLabel:function(m){var it=this.getMenuItem(m);
return (it)?it.item:'none';},
getSubItemLabel:function(m,s){var l='',it=this.getMenuItem(m),sub,sublen;
if(it){sub=it.submenu;
sublen=sub.length;
for(var j=0;j<sublen;j++){if(sub[j].id==s){l=sub[j].item;
break;}}}
return l;},
showTrail:function(trail,handler){if(!cfg.trail.show) return;
var div=infradoxApp.getElement('breadCrumb');
if(!div) return;
div.innerHTML='';
var l,e,a,t=[],trxlen,sep=cfg.trail.separator;
trail=trail?trail:{main:1,mainaslink:0,sub:1,subaslink:0,extended:[]};
handler=handler?handler:null;
if(trail.main) t.push({caption:this._mainmenulabel,id:(trail.mainaslink)?'menu_'+this.mid:null});
if((trail.sub)&&this._submenulabel) t.push({caption:this._submenulabel,id:(trail.subaslink)?'submenu_'+this.mid+'_'+this.sid:null});
trxlen=trail.extended.length;
if(trxlen>0){for(var i=0;i<trxlen;i++){t.push({caption:trail.extended[i].label,id:trail.extended[i].linkid});}}
trxlen=t.length;
for(var i=0;i<trxlen;i++){if(t[i].id){a=this.createDomElement({type:"A",id:t[i].id,text:t[i].caption,className:"trail"});
a.onclick=function(){handler(this.id)};
div.appendChild(a);
}else{div.appendChild(document.createTextNode(t[i].caption));}
if(sep&&(i<(t.length-1))) div.appendChild(document.createTextNode(sep));}},
isMenu:function(id){return (id.substring(0,4)=='menu')||(id.substring(0,4)=='subm');},
loadingcontent:function(show){this.removeElementFromDoc('waitBox');
if(show){var e=this.createDomElement({type:"DIV",id:"waitBox"},document.body);
e.style.zIndex=200001;}},
collection:function(sectid,grpid,galid,glbid,nofrms,getUrl){var m=cfg.menu.gl.m,s=0,ml='',sl='',tpnl=parent.toppanel;
ml=(nofrms)?this.getMainItemLabel(m):tpnl.infradoxApp.getMainItemLabel(m);
s=cfg.menu.gl.s;
for(var i=0;i<cfg.topgallery.length;i++){if(cfg.topgallery[i]==sectid){s=i;
break;}}
sl=(nofrms)?infradoxApp.getSubItemLabel(m,s):tpnl.infradoxApp.getSubItemLabel(m,s);
url='go?a=disp&_m='+m+'&_s='+s+'&_ml='+ml+'&_sl='+sl+'&_tlid='+sectid+'&t=gl-loader.html&groupid='+grpid+'&galleryid='+galid+'&glbid='+glbid+'&page=1';
if(!getUrl){infradoxApp.loadParent(url,1);
}else{return url;}},
searchRefine:function(s){parent.toppanel.oSearch.settings.within=1;
this.searchWord(s);},
searchWord:function(s){var oSearch=parent.toppanel.oSearch;
oSearch.settings.words=[s];
oSearch.search(0);},
searchWords:function(s){this.searchWord(s);},
fixContainerWidth:function(cName,tagName,elWidth){var c=infradoxApp.getElement(cName);
if(!c) return;
var divs=this.getElementsByClassName(c,'div',tagName),totWidth=(divs.length*elWidth);
c.style.width=totWidth+'px';},
randomize_rnd:function(){var rtoday=new Date(),rs=rtoday.getTime();
rs=(rs*9301+49297) % 233280;
return rs/(233280.0);},
randomize:function(n){return Math.abs(Math.ceil(this.randomize_rnd()*n));},
randomphoto:function(placeholdername,photonames,photopath){var r,s,placeholder=infradoxApp.getElement(placeholdername);
if(!placeholder) return;
if((!photonames)||(photonames.length==0)) return;
if(!photopath) return;
r=(this.randomize(photonames.length)-1);
s=photopath+'/'+photonames[r]+'.jpg';
infradoxApp.createDomElement({type:"IMG",src:s},placeholder);},
allTrim:function(str){if(!str) return '';
return (str.replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,""));},
getElementsByClassName:function(oElm,sTagName,oCNms){var arrEls=(sTagName=="*"&&oElm.all)?oElm.all:oElm.getElementsByTagName(sTagName);
var arrRetEls=new Array(),arrRECN=new Array(),oEl,bMAll,olen,klen;
if(typeof oCNms=="object"){olen=oCNms.length;
for(var i=0;i<olen;i++){arrRECN.push(new RegExp("(^|\\s)"+oCNms[i].replace(/\-/g,"\\-")+"(\\s|$)"));}
}else{arrRECN.push(new RegExp("(^|\\s)"+oCNms.replace(/\-/g,"\\-")+"(\\s|$)"));}
olen=arrEls.length;
for(var j=0;j<olen;j++){oEl=arrEls[j];
bMAll=1;
klen=arrRECN.length;
for(var k=0;k<klen;k++){if(!arrRECN[k].test(oEl.className)){bMAll=0;
break;}}
if(bMAll) arrRetEls.push(oEl);}
return (arrRetEls);},
findPosOfElement:function(obj){var cl=ct=0;
if(obj.offsetParent){cl=obj.offsetLeft;
ct=obj.offsetTop;
while (obj=obj.offsetParent){cl+=obj.offsetLeft;
ct+=obj.offsetTop;}}
return [cl,ct];},
removeElementFromDoc:function(eId){var e=this.getElement(eId);
if(e){if(e.parentNode&&e.parentNode.removeChild){while (e.firstChild){e.removeChild(e.firstChild);}
e.parentNode.removeChild(e);}}},
removeElementChildren:function(eId){var e=this.getElement(eId);
if(e){while (e.firstChild){e.removeChild(e.firstChild);}}},
getPageYpos:function(){var y,de=document.documentElement;
y=self.pageYOffset||(de&&de.scrollTop)||document.body.scrollTop;
return(y);},
getPageSize:function(){var x,y,t1,t2;
var dbod=document.body;
t1=dbod.scrollHeight;
t2=dbod.offsetHeight;
if(t1>t2){x=dbod.scrollWidth;y=t1;
}else{x=dbod.offsetWidth;y=t2;}
return [x,y];},
getElementHeight:function(id){var h=0,e=this.getElement(id);
if(e) h=e.offsetHeight||e.style.pixelHeight;
return h;},
getElementWidth:function(id){var h=0,e=this.getElement(id);
if(e) h=e.offsetWidth||e.style.pixelWidth;
return h;},
windowHeight:function(){var de=document.documentElement;
return self.innerHeight||(de&&de.clientHeight)||document.body.clientHeight;},
windowWidth:function(){var de=document.documentElement;
return self.innerWidth||(de&&de.clientWidth)||document.body.clientWidth;},
changeOpacity:function(el,level){if(el.filters){el.style.filters="alpha(opacity="+level+")";
}else{if(el.style.opacity){el.style.opacity=(level/100);
}else{el.style.MozOpacity=(level/100);}}}}
infradoxPagination={initialize:function(sett){this._settings=sett;},
showpagination:function(){var sNav=this._settings.paginationtop(this._settings);
iA.putInnerHtml("topNav",sNav,0);
iA.putInnerHtml("botNav",sNav,0);}}
var infradoxState={ordercount:function(count){this.ordercount=count;},
initialize:function(){this.panel={orderUp:0,lightboxUp:0,autoUpOrder:0,autoUpLightbox:0};
this._PageNavigationFunction=null;
this.props;
this.lightboxCount;
this.maxLightboxes;
this.itemsInLightbox;
this.maxItemsInLightbox;
this.ordercount=(this.ordercount?this.ordercount:count);},
updatePanelStatus:function(){var bpanel=parent.bottompanel,h,p=this.panel;
p.orderUp=0;
p.lightboxUp=0;
if(bpanel){h=bpanel.location.href;
if(h.indexOf('panel-order')!=-1){p.orderUp=1;
} else if(h.indexOf('panel-lightbox')!=-1){p.lightboxUp=1;}}},
updateOrderMenuItemCount:function(action){var lbl,eMenu,panelApp;
if(!cfg.ordercount) return;
if(!this.ordercount) this.ordercount=0;
switch(action.action){case "put":
this.ordercount=action.count;break;
case "inc":
this.ordercount=this.ordercount+action.count;break;
case "dec":
this.ordercount=this.ordercount-action.count;break;}
if(this.ordercount<0) this.ordercount=0;
panelApp=parent.toppanel.infradoxApp;
eMenu=panelApp.getElement('menu_'+cfg.menu.or.m);
if(!eMenu) return;
lbl=panelApp.getMainItemLabel(cfg.menu.or.m);
eMenu.innerHTML=lbl+' ('+this.ordercount.toString()+')';},
putSettings:function(JSONsettings){this.settings=JSONsettings;},
getSettingByName:function(name){var r=null,custom=this.settings.custom;
var cl=custom.length;
for(var i=0;i<cl;i++){if(custom[i].name==name){r=custom[i];
break;}}
return r;},
toggleSetting:function(name){if(this.changeSetting(name)){if(this.props) this.page(this.props.data.page.no);}},
changeSetting:function(name){var o=this.getSettingByName(name);
if(!o){alert('unknown setting:'+name);
return 0;};
o.value=(o.value==1?0:1);
return 1;},
putPanelData:function(Stat,autoOPUp,autoLBUp){p=this.panel;
p.orderUp=(Stat==2);
p.lightboxUp=(Stat==1);
p.autoUpOrder=(autoOPUp==1);
p.autoUpLightbox=(autoLBUp==1);},
putLightboxData:function(lbCount,maxLB,inLB,maxInLB){this.lightboxCount=lbCount;
this.maxLightboxes=maxLB;
this.itemsInLightbox=inLB;
this.maxItemsInLightbox=maxInLB;},
putPageData:function(jData){this.props=jData;
this._PageNavigationFunction;},
scrolltoypos:function(){var pagesize=iA.getPageSize(),d=this.props.data;
if(d&&(d.ypos)&&(d.ypos<pagesize[1])){scroll(0,parseInt(d.ypos));}},
putPageNavigationCallback:function(f){this._PageNavigationFunction=f;},
previous:function(){var p=this.props.data.page;
this.page((p.no>0?p.no-1:1));},
next:function(){var p=this.props.data.page;
this.page((p.no<p.count?p.no+1:p.no));},
first:function(){this.page(1);},
last:function(){this.page(this.props.data.page.count);},
page:function(page){if(!this._PageNavigationFunction){url='go?a=disp&t='+iA.template+'&pt='+this.props.data.results.pagetype+'&ih=gopage_'+page+this.getStyleParams();
infradoxApp.loadLocation(url,1);
}else{this._PageNavigationFunction(page,this.getStyleParams());}},
changeViewStyle:function(ix){var d=this.props.data;
d.layout.style=ix;
this.page(d.page.no);},
changeViewStyleOption:function(ix){var d=this.props.data;
d.layout.option=ix;
this.page(d.page.no);},
getStyleParams:function(){var layout,s='',st=this.settings,p=this.props,cl;
if(st&&(st.custom.length>0)){cl=st.custom.length;
for(var i=0;i<cl;i++){s+='&'+st.custom[i].name+'='+st.custom[i].value;}}
if((p)&&(p.data)){layout=p.data.layout;
s='&lg='+layout.group+'&ls='+layout.style+'&so='+layout.option+s;}
return s;}}
var infradoxAction={executeSearch:function(oSearch,tp,within,ops,words,filters,auxp){var o=oSearch.settings;
o.targetparent=tp;
o.within=within;
o.operators=ops;
o.words=words;
if(filters) o.filterstring=filters;
if(auxp) o.auxparameters=auxp;
oSearch.search(1);},
itemPreview:function(ref,nr,pars){var t,pt,p,offset,pagey,pdat;
if((!ref)||(!nr)) return;
t=iA.getTplNamePart();
pt=iA.pagetype;
pagey=iA.getPageYpos();
pagey=pagey||0;
if(!pars) pars='';
if(pars!=''){if(pars.charAt(0)!='&') pars='&'+pars;}
p=infradoxState.getStyleParams()+pars;
pdat=infradoxState.props.data.page;
offset=((pdat.no-1)*pdat.slots)+nr;
url='go?a=disp&t=preview.html&nr='+offset+'&ir='+ref+'&_yp'+pt+'='+pagey+'&pt='+pt+p;
iA.loadLocation(url,1);},
hotOrder:function(id){var m=0,s=0,ml='',sl='',a=ms.orderhistory.split('_');
m=a[1];
ml=iA.getMainItemLabel(m);
if(a[0]=='submenu'){s=a[2];
sl=iA.getSubItemLabel(m,s);}
infradoxApp.loadParent('go?a=disp&_m='+m+'&_s='+s+'&_ml='+ml+'&_sl='+sl+'&hotorderid='+id+'&_men='+ms.orderhistory+'&t=orh-loader.html',1);},
addItemToOrderByIndex:function(index,fromLBPanel,dd,ddun){var media,y=0,tpanel=parent.toppanel,o;
if(!infradoxMedia.allowAction(index,'order')) return;
media=infradoxMedia.getMediaByIndex(index);
if(dd){if(!ddun){infradoxModal.confirm(500,90,sQuestionConfirmDirect1,function(){parent.toppanel.directFile(media.ref)},'101');
}else{tpanel.directFile(media.ref)}
return;};
url=infradoxApp.completeURL('go?a=disp&ih=GOORDERADDONE_'+media.ref);
if(cfg.ordercount){if(parent&&parent.toppanel) tpanel.infradoxState.updateOrderMenuItemCount({count:1,action:"inc"});}
if(fromLBPanel){infradoxModal.alert(400,60,sMessage_AddedToOrder);
parent.panelbanner.location.href=url+'&t=sr-bott-lban.html';
return;}
o=infradoxState.getSettingByName('_instorder');
if(o&&o.value==1){var amenu=ms.order.split('_');
url+='&t=or-loader.html&_m='+amenu[1]+'&_s=0&_men='+ms.order;
infradoxApp.loadParent(url,0);
return;}
this.loadModifiedOrder(url);},
addItemToLightboxByIndex:function(index){if(!infradoxMedia.allowAction(index,'lightbox')) return;
var media=infradoxMedia.getMediaByIndex(index);
if(media){if(!infradoxState.maxItemsInLightbox) return;
if(infradoxState.itemsInLightbox>=infradoxState.maxItemsInLightbox){infradoxModal.alert(500,100,sMessage_LightboxFull);
return;}
url=infradoxApp.completeURL('go?a=disp&pt=2&ih=GOLBADDONE_'+media.ref);
this.loadModifiedLightbox(url);};},
addItemsToOrderByRefs:function(refs,cnt){if(cfg.ordercount){if(parent&&parent.toppanel){parent.toppanel.infradoxState.updateOrderMenuItemCount({count:cnt,action:"inc"});}}
url=infradoxApp.completeURL('go?&a=disp&init=1&ih=goorderaddchecked&selectedmedia='+refs);
this.loadModifiedOrder(url);},
addItemsToLightboxByRefs:function(refs,cnt){if((infradoxState.itemsInLightbox+cnt)>infradoxState.maxItemsInLightbox){infradoxModal.alert(500,100,sMessage_LightboxFull);
return;}
url=infradoxApp.completeURL('go?&a=disp&init=1&ih=lbaddchecked&selectedmedia='+refs);
this.loadModifiedLightbox(url);},
loadModifiedLightbox:function(url){var tn,pt,o,botpanel=parent.bottompanel,banpanel=parent.panelbanner;
infradoxState.updatePanelStatus();
if(infradoxState.panel.lightboxUp){botpanel.location.href=url+'&t='+infradoxApp.panelTemplate(CONST_PANELLIGHTBOX);
}else{tn=infradoxApp.getTplNamePart();
pt=infradoxApp.pagetype;
if(tn=='preview'){if(infradoxState.panel.orderUp){banpanel.location.href=url+'&t=sr-bott-bban.html';
}else{botpanel.location.href=url+'&t=sr-bott-min.html';}
if(infradoxState.panel.autoUpLightbox){this.panelUp('lightbox');
}else{infradoxModal.alert(400,100,sMessage_AddedToLightbox);}
return;}
if(!infradoxState.panel.autoUpLightbox){url+=((!infradoxState.panel.orderUp&&!infradoxState.panel.lightboxUp)?'&t=sr-bott-min.html':'&t=sr-bott-bban.html');
botpanel.location.href=url;
o=infradoxState.getSettingByName('_a2lm');
if(o&&o.value) infradoxModal.confirm(400,100,sMessage_AddedToLightbox+'<br/>'+sMessage_HideFromNowOn,infradoxAction.modalConfirmationHandler,'lightboxAddItemMessages',2);
}else{switch(tn){case 'sr-body':url+='&t=sr-loader.html';break;
case 'gl-images':url+='&t=gl-loader.html&groupid='+infradoxGallery._parentid+'&galleryid='+infradoxGallery._id+'&glbid='+infradoxGallery._glbid+'&page='+infradoxState.props.data.page.no;break;}
url+='&_max=1';
iA.loadParent(url,0);}}},
loadModifiedOrder:function(url){var bpanel=parent.bottompanel,panelbanner=parent.panelbanner,tn,pt,o;
infradoxState.updatePanelStatus();
if(infradoxState.panel.orderUp){url+='&t='+infradoxApp.panelTemplate(CONST_PANELORDER);
bpanel.location.href=url;
}else{tn=infradoxApp.getTplNamePart();
pt=infradoxApp.pagetype;
if(tn=='preview'){if((pt==CONST_PAGETYPESEARCHRESULTS)||(pt==CONST_PAGETYPEGALLERY)){if(infradoxState.panel.lightboxUp){panelbanner.location.href=url+'&t=sr-bott-lban.html';
}else{bpanel.location.href=url+'&t=sr-bott-min.html';}
if(infradoxState.panel.autoUpOrder){this.panelUp('order');
return;}
infradoxModal.alert(400,100,sMessage_AddedToOrder);
} else if(pt==CONST_PAGETYPELIGHTBOX){bpanel.location.href=url+'&t=lb-bott-min.html';
infradoxModal.alert(400,100,sMessage_AddedToOrder);}
return;}
var sPnl=infradoxState.panel;
if(!sPnl.autoUpOrder){url+='&t=sr-bott-'+((!sPnl.orderUp&&!sPnl.lightboxUp)?'min':'lban')+'.html';
bpanel.location.href=url;
o=infradoxState.getSettingByName('_a2om');
if(o&&o.value) infradoxModal.confirm(400,100,sMessage_AddedToOrder+'<br />'+sMessage_HideFromNowOn,infradoxAction.modalConfirmationHandler,'orderAddItemMessages',2);
}else{switch(tn){case 'sr-body':url+='&t=sr-loader.html&_max=2';break;
case 'gl-images':url+='&t=gl-loader.html&groupid='+infradoxGallery._parentid+'&galleryid='+infradoxGallery._id+'&glbid='+infradoxGallery._glbid+'&page='+infradoxState.props.data.page.no+'&_max=2';break;
case 'lightbox':url+='&t=lb-loader.html&_maxlb=2';break;}
infradoxApp.loadParent(url,0);}}},
deleteFromLightboxPreview:function(index){var media=infradoxMedia.getMediaByIndex(index);
if(media){url='go?a=disp&pt=2&ih=GOLBREMOVEONE_'+media.ref+'&t=lightbox.html';
url+=infradoxState.getStyleParams()+'&page='+infradoxState.props.data.page.no+'&init=1&_yp2=0';
infradoxApp.loadLocation(url,1);}},
modalConfirmationHandler:function(id){var o,nam;
switch(id){case 'lightboxAddItemMessages':
nam='_a2lm';
break;
case 'orderAddItemMessages':
nam='_a2om';
break;}
o=infradoxState.getSettingByName(nam);
if(o) o.value=0;},
panelUp:function(panel){var t,p,panelID,offset,ref,pt,rpanel=parent.resultspanel,base='go?a=disp&pt=1&t=';
t=rpanel.infradoxApp.getTplNamePart();
p=rpanel.infradoxState.getStyleParams();
panelID=0;
switch(panel){case 'lightbox':panelID=1;break;
case 'order':panelID=2;break;}
switch(t){case 'sr-body':
infradoxApp.loadParent(base+'sr-loader.html&_max='+panelID+p,1);
break;
case 'lightbox':
infradoxApp.loadParent(base+'lb-loader.html&_maxlb='+panelID+p,1);
break;
case 'gl-images':
url=base+'gl-loader.html&_max='+panelID+p;
url+='&groupid='+rpanel.infradoxGallery._parentid+'&galleryid='+rpanel.infradoxGallery._id+'&glbid='+rpanel.infradoxGallery._glbid+'&page='+rpanel.infradoxState.props.data.page.no;
infradoxApp.loadParent(url,1);
break;
case 'preview':
offset=rpanel.infradoxPreview._offset;
ref=rpanel.infradoxPreview._ref;
pt=rpanel.infradoxApp.pagetype;
url='go?a=disp&t=';
switch(pt){case 1:
url+='sr-loader.html&_max=';
break;
case 2:
url+='lb-loader.html&_maxlb=';
break;
case 8:
url+='gl-loader.html'+rpanel.infradoxPreview._parameters+'&_max=';
break;}
if(url){url+=panelID+'&preview=1&nr='+offset+'&ir='+ref+'&pt='+pt+p;
infradoxApp.loadParent(url,1);}
break;
default:
alert('This function cannot be used here');}},
panelDown:function(){this.panelUp('_down_');},
changeTerritory:function(id,tname){infradoxApp.loadParent('go?a=disp&topic=0&t=tp-loader.html&msg=1&tpl=territory.html&ltr_id='+id+'&_countryname='+((tname)?tname:''),1);}}
var infradoxModal={initialize:function(){this._initialized=1;
this._modalConfirmationCallback=null;
this._messageObj=null;
this._yes='yes';
this._no='no';
this._cancel='cancel';
this._close='close';
this._title='infradox';
this._closeButtonHtml='<div style="position:absolute;top:3px;right:1px;cursor:pointer;" onclick="javascript:infradoxModal.close()"><img src="/images/infradox/dialog_btn_close_ff.gif"></div>';},
putCloseButtonHtml:function(html){this._closeButtonHtml='';},
putCommonLocales:function(yes,no,cancel,close,title){if(!this._initialized) this.initialize();
this._yes=yes;
this._no=no;
this._cancel=cancel;
this._close=close;
this._title=title;},
confirm:function(w,h,q,f,id,numberOfLines){this._modalConfirmationCallback=f;
this._modalConfirmationCallbackId=id;
var lineHeight=(numberOfLines?((h-44)/numberOfLines):h-44),s='<div class="modalDialog_alertBox" style="height:'+h+'px;width:'+w+'px;">'+'<div class="modalDialog_alertBar">'+this._title+'</div>'+'<div class="modalDialog_alertBody" style="line-height:'+lineHeight+'px;height:'+(h-44)+'px;width:'+w+'px;">'+q+'</div>'+'<div class="modalDialog_alertFooter"><a href="javascript:infradoxModal._confirm(1);">'+this._yes+'</a>&nbsp;&nbsp;<a href="javascript:infradoxModal._confirm(0);">'+this._no+'</a></div></div>';
this._createModalBox(w,h,s);},
alert:function(w,h,s,lh){if(!this.messageObj) this.messageObj=new DHTML_modalMessage();
var lineHeight=h-44;
if(lh&&(lh>1)){lineHeight=(lh?((h-44)/lh):h-44);}
var s='<div class="modalDialog_alertBox" style="height:'+h+'px;width:'+w+'px;">'+'<div class="modalDialog_alertBar">'+this._title+this._closeButtonHtml+'</div>'+'<div class="modalDialog_alertBody" style="line-height:'+lineHeight+'px;height:'+(h-44)+'px;width:'+w+'px;">'+s+	'</div>'+'<div class="modalDialog_alertFooter"><a href="javascript:infradoxModal.close();">'+this._close+'</a></div></div>';
this._createModalBox(w,h,s);},
close:function(){if(this._messageObj) this._messageObj.close();
this._messageObj=null;},
createModalBoxForContent:function(w,h){this._createModalBox(w,h,'<div style="padding:10px;"><img src="/images/24-1.gif" /></div>');},
loadModalBoxContentURL:function(urlString,fcallback){infradoxAjax.xmlHttpBusy=0;
infradoxAjax.getRequest(infradoxApp.completeURL(urlString),function(){infradoxModal._loadModalBoxContent(infradoxAjax.xmlHttp.responseText);
if(fcallback) fcallback();
});},
_loadModalBoxContent:function(s){this._messageObj.setHtmlContent(s);
this._messageObj.display();},
_createMsgObj:function(){if(!this._messageObj) this._messageObj=new DHTML_modalMessage();},
_createModalBox:function(w,h,s,transparancyclassname,hideshadow){this._createMsgObj();
var mo=this._messageObj;
if(transparancyclassname) mo.transparencyclassname=transparancyclassname;
var shadow=(hideshadow?0:1);
mo.setHtmlContent(s);
mo.setSize(w,h);
mo.setSource(0);
mo.setShadowDivVisible(shadow);
mo.display();},
_confirm:function(result){this._messageObj.close();
if(result) this._modalConfirmationCallback(this._modalConfirmationCallbackId);}}
var infradoxPageEmail={initialize:function(options){this._options=options;
iA.removeElementFromDoc('divPageLinkEmail');
infradoxModal.createModalBoxForContent(400,330);
infradoxModal.loadModalBoxContentURL('go?a=disp&t=pagelinkmailform.inc');},
sendPagelink:function(f){var o=this._options;
infradoxForm.initialize('formEmail','formMessageText','pagelinkAjax',infradoxPageEmail.submitPageEmail);
if(infradoxForm.validate(o.form,0)){f.ute.value=this._options.url;
if(o.prop1&&f.prop1) f.prop1.value=o.prop1;
if(o.prop2&&f.prop2) f.prop2.value=o.prop2;
if(o.prop3&&f.prop3) f.prop3.value=o.prop3;
infradoxForm.submit(o.form,infradoxApp.dll+'ih');}},
submitPageEmail:function(){iA.putInnerHtml('formMessageText','',0);
infradoxModal.alert(500,80,infradoxAjax.getJSONResponseMessage());}}
var infradoxLightboxEmail={initialize:function(options){this._options=options;
iA.removeElementFromDoc('divmodalemail');
infradoxModal.createModalBoxForContent(450,430);
infradoxModal.loadModalBoxContentURL('go?a=disp&t=lightbox-mailform.inc');},
sendlink:function(){var f,vars,msgtext;
f=parent.resultspanel.document.forms[this._options.formName];
if(!f){alert('no form');return;}
if(!f.to.value.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)||!f.from.value.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)){iA.putInnerHtml('errorMessages',sMessage_EnterValidEmail,1);
return;}
if(cfg.htmlmail){msgtext=f.message.value.replace(/(\r\n|[\r\n])/g,"<br />");}
msgtext=escape(msgtext);
vrs='ih=GOLBSENDEMAIL'+'&userlightboxes='+this._options.lightboxid+'&session='+infradoxApp.session+'&jsonresponse=1'+'&datasourcename=lightboxajaxsmtp&datasourcefile=lightboxajaxsmtp.map'+'&LbmRecipient='+f.to.value+'&LbmCCRecipient='+f.cc.value+'&LbmSender='+f.from.value+'&LbmSubject='+(f.subject?escape(f.subject.value):'')+'&LbmBody='+msgtext+'&lbmAllowCopy=1';
infradoxAjax.postRequest(infradoxApp.dll+'ih',vrs,function(){infradoxModal.alert(400,70,infradoxAjax.getJSONResponseMessage(infradoxAjax.xmlHttp.responseText));
});}}
var infradoxLogin={initialize:function(successCallback,scn,scr,scalert,msgdiv){this._successCallback=successCallback;
this._scn=(scn||'');
this._scr=((scr||0)&&this._scn);
this._scv=infradoxApp.randomize_rnd();
this._scalert=scalert;
this._msgdiv=(msgdiv?msgdiv:'loginMessageText');},
dialog:function(callback){if(!infradoxAjax.createXMLHttpRequest()){alert('Not supported. Please upgrade your browser');return;}
if(callback) this._successCallback=callback;
infradoxApp.removeElementFromDoc('divLoginLayer');
infradoxModal.createModalBoxForContent(300,150);
infradoxModal.loadModalBoxContentURL('go?a=disp&t=logindialog_ajax.inc');},
submit:function(f){var l,p;
if(this._scr){if(!infradoxApp.testCookie(this._scv,this._scv)){if(this._scalert){alert(cEnableCookies);
}else{infradoxApp.putInnerHtml(this._msgdiv,cEnableCookies);}
return;}}
if(!f){alert('form not found');return;}
l=f.login.value;
p=f.password.value;
if((l=='')||(p=='')){infradoxApp.putInnerHtml(this._msgdiv,sMessage_EnterLogin);
return;}
infradoxApp.putInnerHtml(this._msgdiv,'<img src="/images/24-1.gif" />');
var vars='LogSignInName='+l+'&LogPassword='+p+'&session='+infradoxApp.session+'&jsonresponse=1'+'&datasourcename=loginajax&datasourcefile=loginajax.map';
infradoxAjax.postRequest(infradoxApp.dll+'login?si='+infradoxApp.session+'&rnd='+infradoxApp.getTimeStamp(),vars,function(){infradoxAjax.setJSONResponseVars(infradoxAjax.xmlHttp.responseText);
if(!infradoxAjax.JSONResponseVars.Result){infradoxApp.putInnerHtml(infradoxLogin._msgdiv,infradoxAjax.JSONResponseVars.MessageText);
}else{infradoxLogin._successCallback();}
});},
successReload:function(){infradoxApp.loadParent(parent.location.href+'&logrnd='+infradoxApp.getTimeStamp(),0);}}
infradoxEnterKeysHandler=function(e,id,linkhandler){var f;
if(e&&e.which){e=e;
characterCode=e.which;
}else{if(window.event) e=event;
characterCode=e.keyCode;}
if(characterCode==13){if(id&&linkhandler){linkhandler(id);
}else{f=infradoxEnterKeyHandler._funcName+'(this)';
eval(f);}
if(window.event){window.event.cancelBubble=1;
window.event.returnValue=0;}
if(e&&e.stopPropagation&&e.preventDefault){e.stopPropagation();
e.preventDefault();}
return 0;
} else return 1;}
var infradoxEnterKeyHandler={initialize:function(funcName){this._funcName=funcName;},
listen:function(o){EventManager.Add(o,'keypress',infradoxEnterKeysHandler,0);},
relay:function(o,linkid,linkhandler){EventManager.Add(o,'keypress',function(e){infradoxEnterKeysHandler(e,linkid,linkhandler)},0);}}
var infradoxLinkHandler={initialize:function(funcName){this._initialized=1;
this._funcName=funcName;
this.methods={"handlers":[{"default":"","handler":null}]};
infradoxApp.putsysinfo();},
listen:function(lName){var e=document.getElementById(lName);
if(e){if(infradoxApp.sysinf.canlisten){EventManager.Add(e,'click',infradoxLinksHandler,0);
}else{e.onclick=function(){_infradoxLinksHandler(e);}};
}else{if(cfg.debug!=0) alert('no e for '+name);}},
_handlerExists:function(prefix){var hasHandler=0;
var handlers=this.methods.handlers;
for(var i=0;i<handlers.length;i++){hasHandler=(handlers[i].prefix==prefix);
if(hasHandler) break;}
return hasHandler;},
_addHandler:function(prefix,fH){var h={"prefix":"","handler":null};
h.prefix=prefix;
h.handler=fH;
this.methods.handlers[this.methods.handlers.length]=h;},
addListener:function(elementName,fH,eventName){if(!this._initialized) this.initialize();
if(fH) this.methods.handlers[0].handler=fH;
if(!eventName) eventName='click';
var e=document.getElementById(elementName);
if(e){if((e.tagName=='A')||(e.tagName=='a')) e.href="javascript:void(0);";
if(infradoxApp.sysinf.canlisten){EventManager.Add(e,eventName,infradoxLinksHandler,0);
}else{e.onclick=function(){_infradoxLinksHandler(this);}}}},
addListeners:function(cEl,prefix,elType,fH){if(!this._initialized) this.initialize();
var c=infradoxApp.getElement(cEl);
if(!c){return;}
var canlisten=infradoxApp.sysinf.canlisten,elems=c.getElementsByTagName(elType);
if(!elems){alert('no elements');return;}
if(!this._handlerExists(prefix)){this._addHandler(prefix,fH);}
var elLen=prefix.length,max=elems.length,e;
for(var i=0;i<max;i++){e=elems[i];
if(e.id.substring(0,elLen)==prefix){if((e.tagName=='A')||(e.tagName=='a')) e.href="javascript:void(0);";
if(canlisten){EventManager.Add(e,'click',infradoxLinksHandler,0);
}else{e.onclick=function(){_infradoxLinksHandler(this);}}}}}}
_infradoxLinksHandler=function(e){if((!e)||(!e.id)) return;
var f,handlers=infradoxLinkHandler.methods.handlers;
if(handlers.length==0){f=handlers[0].handler;
}else{for(var i=1;i<handlers.length;i++){if(handlers[i].prefix==e.id.substring(0,handlers[i].prefix.length)){f=handlers[i].handler;
break;}}
if(!f) f=handlers[0].handler;}
_cancelBubble(e);
if(f){f(e.id);
}else{f=infradoxLinkHandler._funcName+'(\''+e.id+'\')';
eval(f);}};
_cancelBubble=function(e){if(window.event){window.event.cancelBubble=1;
window.event.returnValue=0;}
if(e&&e.stopPropagation&&e.preventDefault){e.stopPropagation();
e.preventDefault();}};
infradoxLinksHandler=function(e){var el;
if(window.event&&window.event.srcElement) el=window.event.srcElement;
if(e&&e.target) el=e.target;
if(!el) return;
_cancelBubble(e);
_infradoxLinksHandler(el);};
function toggleLayer(wl){var s2;
if(document.getElementById){s2=document.getElementById(wl).style;
s2.display=s2.display?"":"block";
} else if(document.all){s2=document.all[wl].style;
s2.display=s2.display?"":"block";
} else if(document.layers){s2=document.layers[wl].style;
s2.display=s2.display?"":"block";}};
function hideLayer(wl){var s2;
if(document.getElementById){s2=document.getElementById(wl).style;
s2.display="";
} else if(document.all){s2=document.all[wl].style;
s2.display="";
} else if(document.layers){s2=document.layers[wl].style;
s2.display="";}};
function showLayer(wl){var s2;
if(document.getElementById){s2=document.getElementById(wl).style;
s2.display="block";
} else if(document.all){s2=document.all[wl].style;
s2.display="block";
} else if(document.layers){s2=document.layers[wl].style;
s2.display="block";}};
var infradoxAjax={createXMLHttpRequest:function(){try {this.xmlHttp=null;
if(!this.xmlHttp){if(window.ActiveXObject){this.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
} else if(window.XMLHttpRequest){this.xmlHttp=new XMLHttpRequest();}
}else{if(this.xmlHttp.readyState!=0){this.xmlHtpp.abort();
this.xmlHtpp=null;
this.createXMLHttpRequest();}}
return this.xmlHttp;
} catch(err){alert('an error occurred while trying to create the xhr object:'+err.text);
return 0;}},
postRequest:function(url,vars,fSuccess){if(this.xmlHttpBusy) return 0;
if(!this.createXMLHttpRequest()) return 0;
this._successCallback=fSuccess;
var x=this.xmlHttp;
x.open("POST",url,1);
x.onreadystatechange=infradoxAjax.onStateChangeResponse;
x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
x.send(vars);
return 1;},
getRequest:function(url,fSuccess){if(this.xmlHttpBusy) return 0;
if(!this.createXMLHttpRequest()) return 0;
this._successCallback=fSuccess;
var x=this.xmlHttp;
x.open("GET",url,1);
x.setRequestHeader("Cache-Control","no-cache");
x.setRequestHeader("Content-Type","text/xml;charset=iso-8859-1");
x.onreadystatechange=infradoxAjax.onStateChangeResponse;
x.send(null);
return 1;},
onStateChangeResponse:function(){if(!infradoxAjax) return;
var x=infradoxAjax.xmlHttp;
if(x){if(x.readyState==4){if(x.status==200){infradoxAjax._successCallback(x.responseText);
}else{alert('Error '+x.status);}
infradoxApp.loadingcontent(0);
infradoxAjax.xmlHttpBusy=0;}
}else{infradoxApp.loadingcontent(0);}},
showJSONResponseMessage:function(responseText){var oR=eval('('+responseText+')');
if(oR.Error){alert('Error:'+oR.ErrorText);
}else{alert(oR.MessageText);}},
setJSONResponseVars:function(responseText){this.JSONResponseVars=eval('('+responseText+')');},
getJSONResponseMessage:function(jsonResponse){if(jsonResponse) this.setJSONResponseVars(jsonResponse);
var r='',vrs=this.JSONResponseVars;
if(vrs.Error){r=((vrs.MessageText=='')?vrs.ErrorText:vrs.MessageText);
}else{r=vrs.MessageText;}
return r;}};
var timeid,timesubid,ResetMenuOnTimeout=(cfg.menutimeout),ResetMenuOnTimeoutMilisecs=cfg.menutimeout,hideSubmenuTimeout,iA=infradoxApp,infradoxMenu={init:function(m,handler,options){var e,mainLen,menuItem,s,activesubset,main;
this._options=options;
activesubset=0;
this._activemenu='menu_'+m.toString();
this._activesubmenu='';
this._showingsubmenufor='';
if(iA.men&&((iA.men.split('_')[0])=='submenu')){this._activesubmenu='submenu_'+infradoxApp.mid+'_'+iA.sid;}
e=infradoxApp.getElement('mainMenuContainer');
if(e) e.innerHTML='';
main=menu.main;
mainLen=main.length;
s='<ul id="mmenu">';
for(var i=0;i<mainLen;i++){if(!main[i].hide) s+=this.getLink(1,main[i].id,main[i].item);}
s+='</ul>';
e.innerHTML=s;
for(var i=0;i<mainLen;i++){if(!main[i].hide){s='menu_'+main[i].id.toString();
e=iA.getElement(s);
if(e.id==this._activemenu){e.className='active';
if(!this._options.submenus.hideactive) this.showsubmenu(main[i].id);}
this.bindevents(e,1);}}},
setActiveMenu:function(id){var am=id.split('_');
this._activemenu='menu_'+am[1];
if(am[0]=='submenu'){this._activesubmenu=id;}
this.reselectActive();},
getLink:function(main,id,label,mainid){if(this._options.usehref) label='<a href="#">'+label+'</a>';
var s=((main)?'<li id="menu_':'<li id="submenu_'+mainid.toString()+'_');
return s+id.toString()+'">'+label+'</li>';;},
getInfradoxApp:function(){var iApp=infradoxApp;
if(this._options.submenus.targetframe){var frmobj=this._options.submenus.targetframe;
if(frmobj) iApp=(frmobj.infradoxApp)?frmobj.infradoxApp:null;}
return iApp;},
showsubmenu:function(mainid){var s,tlen,base,sub,subs,sublen,main,e,doc,frmObj,mid,yPos,cEl,iApp,aPosition,m,tf;
iApp=this.getInfradoxApp();
if(!iApp) return;
this._showingsubmenufor='';
tf=this._options.submenus.targetframe;
if(tf){frmobj=tf;
cEl=iApp.getElement('subMenuContainer');
if(!cEl){doc=frmobj.document;
if(!doc){alert('no frmobj.document');return;}
e=doc.body;
if(!e){return;}
cEl=iApp.createDomElement({type:"DIV",id:"subMenuContainer"},e);}
}else{cEl=iApp.getElement('subMenuContainer');}
subs=this._options.submenus;
if(subs.alignwithmain){mid='menu_'+mainid.toString();
e=iA.getElement(mid);
aPosition=iA.findPosOfElement(e);
if(subs.leftmargin) aPosition[0]=aPosition[0]+subs.leftmargin;
cEl.style.left=aPosition[0]+'px';}
if(subs.targetframe){yPos=iApp.getPageYpos();
if(subs.adjusttoppix){yPos+=subs.adjusttoppix;
}else{yPos--;}
cEl.style.top=yPos+'px';}
cEl.innerHTML='';
main=menu.main;
sub=[];
tlen=main.length;
for(var j=0;j<tlen;j++){if(main[j].id==mainid){sub=main[j].submenu;
break;}}
if(sub.length==0){if(this._options.submenus.hideempty) cEl.style.display='none';
}else{s='<ul id="smenu">';
sublen=sub.length;
for(var i=0;i<sublen;i++){if(!sub[i].hide) s+=this.getLink(0,sub[i].id,sub[i].item,mainid);}
s+='</ul>';
cEl.innerHTML=s;
base='submenu_'+mainid.toString()+'_';
sublen=sub.length;
for(var i=0;i<sublen;i++){s=base+i.toString();
e=iApp.getElement(s);
if(e){if(e.id==this._activesubmenu) e.className='active';
this.bindevents(e,0);}}
cEl.style.display='inline';
this._showingsubmenufor=mainid;}
for(var i=0;i<tlen;i++){m='menu_'+main[i].id;
e=iA.getElement(m);
if(e){if(main[i].id==mainid){e.className=(this._activemenu==e.id)?'activeover':'over';
}else{e.className=(this._activemenu==e.id)?'active':'';}}}},
bindevents:function(e,bmainmenu){e.onclick=function(){menuHandler(this.id);};
e.onmouseover=function(){infradoxMenu.menuhover(this,'over',bmainmenu);};
e.onmouseout=function(){infradoxMenu.menuhover(this,'out',bmainmenu);};},
hidesubmenu:function(){var m,e;
if(timesubid) clearTimeout(timesubid);
iApp=this.getInfradoxApp();
if(!iApp) return;
cEl=iApp.getElement('subMenuContainer');
if(cEl) cEl.style.display='none';
if(this._showingsubmenufor){m='menu_'+this._showingsubmenufor;
e=iApp.getElement(m);
if(e) e.className=(this._activemenu==e.id)?'active':'';}
this._showingsubmenufor='';},
reselectActive:function(){if(timeid) clearTimeout(timeid);
if(this._activemenu.split('_')[1] !=this._activesubmenu) this.showsubmenu(this._activemenu.split('_')[1]);},
menuhover:function(e,state,main){if(timeid) clearTimeout(timeid);
var mainid,mainitem,selected=main?this._activemenu:this._activesubmenu,subs=this._options.submenus;
switch(state){case 'over':
e.className=(selected==e.id)?'activeover':'over';
if(main) this.showsubmenu(e.id.split('_')[1]);
if(subs.hideactive){if(timesubid) clearTimeout(timesubid);}
break;
case 'out':
if(!(main&&(this._showingsubmenufor==e.id.split('_')[1]))) e.className=(selected==e.id)?'active':'';
if((ResetMenuOnTimeout)&&(!subs.hideactive)){timeid=setTimeout(function(){infradoxMenu.reselectActive()
},ResetMenuOnTimeoutMilisecs);
} else if(subs.hideactive){if(timesubid) clearTimeout(timesubid);
timesubid=setTimeout(function(){clearTimeout(timesubid);infradoxMenu.hidesubmenu();
},infradoxMenu._options.submenus.hideactive);}
break;}}};
var droptimeid,iA=infradoxApp,
infradoxDropdown={addDropdown:function(dropdownid,dropdownsettings){if(!this._dropdowns) this._dropdowns=[];
this._dropdowns.push({id:dropdownid,settings:dropdownsettings});},
initialize:function(handler){var drop,itemsDiv,ul,li,dropId,txtEl,sett,drp=this._dropdowns;
if(!drp) return;
this._handler=handler;
for(var i=0;i<drp.length;i++){sett=drp[i].settings;
dropId=drp[i].id;
drop=iA.getElement(dropId);
drop.style.width=(sett.textWidth+sett.buttonWidth+10)+'px';
txtEl=iA.getElement(dropId+'Text');
txtEl.innerHTML=this.getSelectedOptionText(dropId,sett);
itemsDiv=iA.getElement(dropId+'_');
itemsDiv.style.width=(sett.textWidth+sett.buttonWidth+10)+'px';
drop.onclick=function(){infradoxDropdown.dropdown(this.id) };}},
selectOption:function(dropId,optionId){var index,bs;
index=this.getDropdown(dropId);
if(index<0) return;
bs=this._dropdowns[index].settings;
bs.selectedId=optionId;
this.getSelectedOptionText(dropId,bs,1);},
getSelectedOptionText:function(dropId,sett,selectText){var ul,li,txtEl,txtSel='';
ul=iA.getElement(dropId+'__');
li=ul.firstChild;
while(li){if(li.id==sett.selectedId){txtSel=li.innerHTML;
li.className='selected';
if(selectText){txtEl=iA.getElement(dropId+'Text');
txtEl.innerHTML=txtSel;}
break;}
li=li.nextSibling;}
return txtSel;},
getDropdown:function(id){var index=-1;
for(var i=0;i<this._dropdowns.length;i++){if(this._dropdowns[i].id==id){index=i;
break;}}
return index;},
optionHilite:function(e){e.className='over';},
optionLolite:function(e,settings){e.className=(e.id==settings.selectedId)?'selected':'normal';},
handleclick:function(e,dropId,o){this.closeup(dropId);
var txtEl=iA.getElement(dropId+'Text'),txtVal='';
if(o.selectedId!=e.id){o.selectedId=e.id;
txtVal=this.getSelectedOptionText(dropId,o);
txtEl.innerHTML=txtVal;
o.initialized=0;
this._handler(dropId,e.id,txtVal);}},
dropdown:function(id){var ix=this.getDropdown(id);
if(ix<0) return;
var iH,tl,iW,offset,dropId,boxst,leftOffset,dC,itemsDiv,timeout,ul,li,dds=this._dropdowns;
dropId=dds[ix].id;
boxst=dds[ix].settings;
if(boxst.preventdropdown) return;
dC=iA.getElement(dropId);
itemsDiv=iA.getElement(dropId+'_');
if(itemsDiv.style.display=='block'){this.closeup(dropId);
return 0;}
tl=dds.length;
for(var i=0;i<tl;i++){if(dds[i].id !=dropId){if(iA.getElement(dds[i].id+'_')) this.closeup(dds[i].id);}}
if(droptimeid) clearTimeout(droptimeid);
timeout=3500;
if(boxst.timeoutms!=null){timeout=boxst.timeoutms;}
if(timeout>0){droptimeid=setTimeout(function(){infradoxDropdown.closeup(dropId);},timeout);}
if(!dds[ix].settings.initialized){ul=iA.getElement(dropId+'__');
li=ul.firstChild;
boxst.listitemscount=ul.childNodes.length;
while(li){if((boxst.hidefromlist)&&(li.id==boxst.hidefromlist)){li.style.display='none';
}else{if(li.className!='dropdownseparator'){li.className=(li.id==boxst.selectedId)?'selected':'normal';
li.onmouseover=function(){infradoxDropdown.optionHilite(this)};
li.onmouseout=function(){infradoxDropdown.optionLolite(this,boxst)};
li.onclick=function(){infradoxDropdown.handleclick(this,dropId,boxst)};};}
li=li.nextSibling;}
dds[ix].settings.initialized=1;}
iH=dC.offsetHeight;
iW=dC.offsetWidth;
offset=iA.findPosOfElement(dC);
if(boxst.fixoffsettop) offset[1]=offset[1]+boxst.fixoffsettop;
if(boxst.fixoffsetleft) offset[0]=offset[0]+boxst.fixoffsetleft;
itemsDiv.style.top=offset[1]+(iH-1)+'px';
if(boxst.boxwidththreshold&&(boxst.listitemscount>boxst.boxwidththreshold)){var cols=Math.floor(Math.round((boxst.listitemscount / boxst.boxwidththreshold))) - 1;
if(cols<1) cols=1;
var boxwidth;
boxwidth=((cols==1)?dC.style.width:(cols*(boxst.textWidth+boxst.itempadding)));
if(boxst.boxwidthmax) if(boxwidth>boxst.boxwidthmax) boxwidth=boxst.boxwidthmax;
boxst.boxwidth=boxwidth;
if(boxst.expandright){leftOffset=offset[0];
}else{leftOffset=((cols==1)?offset[0]:((offset[0]+iW) - boxwidth - 2));}
itemsDiv.style.left=leftOffset+'px';
itemsDiv.style.width=(boxwidth.toString()).replace(/px/,'')+'px';
ul=iA.getElement(id+'__');
ul.style.width=(boxst.boxwidth.toString()).replace(/px/,'')+'px';
}else{itemsDiv.style.left=offset[0]+'px';}
itemsDiv.style.display='block';},
closeup:function(id){var iDiv=iA.getElement(id+'_');
iDiv.style.display='none';
if(droptimeid) clearTimeout(droptimeid);},
createOptions:function(containerULname,options,defaultId,defaultText){var li,p,jsondata,index,boxst,additem,ul=iA.getElement(containerULname);
ix=this.getDropdown(containerULname.replace(/_/g,''));
if(ix<0) return;
boxst=this._dropdowns[ix].settings;
if(defaultId&&defaultText){li=iA.createDomElement({type:"LI",id:defaultId,className:"normal",text:defaultText},ul);
if(boxst.itemwidth) li.style.width=boxst.itemwidth+'px';}
jsondata=(options&&(options.length>0)&&(options[0].id));
if(boxst.topoptions&&!boxst.defaultonly){for(var i=0;i<boxst.topoptions.options.length;i++){li=iA.createDomElement({type:"LI",id:boxst.topoptions.options[i].id,className:"normal",text:boxst.topoptions.options[i].name},ul);
if(boxst.itemwidth) li.style.width=boxst.itemwidth+'px';}
if(boxst.topoptions.separator){li=iA.createDomElement({type:"P",id:0,className:"dropdownseparator",text:""},ul);}}
for(var i=0;i<options.length;i++){additem=1;
if(boxst.defaultonly){additem=((jsondata)?options[i].id==defaultId:i.toString()==defaultId);}
if(additem){if(jsondata){li=iA.createDomElement({type:"LI",id:options[i].id,className:"normal",text:options[i].name},ul);
}else{li=iA.createDomElement({type:"LI",id:i.toString(),className:"normal",text:options[i]},ul);}
if(boxst.itemwidth) li.style.width=boxst.itemwidth+'px';}}},
populateDropdownCallback:function(dropdownId,data,getDataCallback,excludeId){var ix,boxst,li,ul;
ix=this.getDropdown(dropdownId);
if(ix<0) return;
boxst=this._dropdowns[ix].settings;
ul=iA.getElement(dropdownId+'__');
for(var i=0;i<data.length;i++){if(!(excludeId&&(data[i].id==excludeId))){li=iA.createDomElement({type:"LI",id:data[i].id.toString(),className:"normal",text:getDataCallback(i)},ul);
li.style.width=boxst.textWidth+'px';}}}};
var infradoxForm={initialize:function(formName,divErrors,datasourcename,fSubmitResponse,datasourcesubfolder){this._formName=formName;
this._divErrors=divErrors;
this._datasourcename=datasourcename;
this._datasourcefile=datasourcename+'.map';
this._submitResponse=fSubmitResponse;
this._datasourcesubfolder=datasourcesubfolder?datasourcesubfolder:'';},
initializeValidPassword:function(firstname,lastname,login){this._validPasswordInitialized=1;
this._firstname=firstname.toLowerCase();
this._lastname=lastname.toLowerCase();
this._login=login.toLowerCase();},
validPassword:function(s){var ok=0;
s=s.toLowerCase();
var ok=( ((s.match(/[a-z]/))||(s.match(/[@#$%&!*)(-+=^]/)))&&(s.match(/[0-9]/)) );
if(!ok) return 0;
if(this._validPasswordInitialized){if((this._firstname)&&(s.indexOf(this._firstname)!=-1)) return 0;
if((this._lastname)&&(s.indexOf(this._lastname)!=-1)) return 0;
if(s.indexOf(this._login)!=-1) return 0;}
return 1;},
putValidationClasses:function(classes){this._classes=classes;},
_updateFieldClass:function(id,state){if(!this._classes) return;
var e=infradoxApp.getElement(id);
if(!e) return;
var t=e.type;
if(!t) return;
var c=this._classes;
switch(t){case 'select-one':
e.className=c.select[state];
break;
case 'textarea':
e.className=c.textarea[state];
break;
default:
e.className=c.input[state];
break;}},
validate:function(j,showAllFieldErrors){var f=eval('document.'+this._formName);
if(!f){alert('form does not exist');
return;}
var _showAllFieldErrors=(showAllFieldErrors),oField,oControl,oCT,s,e,hasValue=0,isValid=1,arrErrors=new Array(),iA=infradoxApp;
iA.putInnerHtml(this._divErrors,'',1);
if(this._classes){for(var i=0;i<j.fields.length;i++){oField=j.fields[i];
if(!oField.ignore) this._updateFieldClass(oField.name,'_default');}}
for(var i=0;i<j.fields.length;i++){oField=j.fields[i];
if(!oField.ignore){isValid=1;
s='document.'+this._formName+'.'+oField.name+'.value';
sValue=eval(s);
oControl=iA.getElement(oField.name);
oCT=((oControl)?oControl.type:'text');
switch(oCT){case 'select-one':
if((oField.isBlank&&(oField.isBlank!=''))&&(sValue=='0')) sValue='';
break;
case 'text':
sValue=iA.allTrim(sValue);
break;
case 'textarea':
sValue=iA.allTrim(sValue);
break;}
if(oField.isBlank&&(oField.isBlank!='')&&(sValue=='')){isValid=0;
arrErrors[arrErrors.length]=oField.isBlank;
this._updateFieldClass(oField.name,'_error');}
if(isValid&&(oField.validation&&(oField.validation!='')&&oField.validationError)){switch(oField.validation){case 'email':isValid=sValue.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i);break;
case 'url':isValid=sValue.match(/^(https?|ftp):\/\/[A-Z0-9](\.?[A-Z0-9能謁[A-Z0-9_\-能謁*)*(\/([A-Z0-9能謁[A-Z0-9_\-\.能謁*)?)*(\?([A-Z0-9能謁[A-Z0-9_\-\.%\+=&能謁*)?)?$/i);break;
case 'text':isValid=1;break;
case 'password':isValid=this.validPassword(sValue);break;}
if(!isValid){arrErrors[arrErrors.length]=oField.validationError;
this._updateFieldClass(oField.name,'_error');
}else{this._updateFieldClass(oField.name,'_valid');}}
if(isValid&&(oField.lengthError&&(oField.lengthError!=''))){if((sValue.length<oField.minlen)||(sValue.length>oField.maxlen)){isValid=0;
this._updateFieldClass(oField.name,'_error');
arrErrors[arrErrors.length]=oField.lengthError;
}else{this._updateFieldClass(oField.name,'_valid');}}}}
if(arrErrors.length>0){var err;
if(_showAllFieldErrors){err=arrErrors.join();
while(err.indexOf(',')>-1) err=err.replace(',','<br/>');
}else{err=arrErrors[0];}
infradoxApp.putInnerHtml(this._divErrors,err,1);}
return (arrErrors.length==0);},
submit:function(j,postURL){if(infradoxAjax.xmlHttpBusy){alert('The request object is busy. Cannot post the form');
return 0;}
var vrs,sValue,oField,e,err=0,_params=[];
_params.push('session='+infradoxApp.session);
_params.push('jsonresponse=1');
_params.push('datasourcename='+this._datasourcename);
if(this._datasourcesubfolder!=''){_params.push('datasourcefixed=yes');
_params.push('datasourcefile='+this._datasourcesubfolder+'\\'+this._datasourcefile);
}else{_params.push('datasourcefile='+this._datasourcefile);}
for(var i=0;i<j.fields.length;i++){oField=j.fields[i];
if(oField.nopost!=1){e=(oField.ignore==1)?eval('document.'+this._formName+'.'+oField.name):infradoxApp.getElement(oField.name);
if(e){switch(e.type){case 'select-one':
sValue=e.options[e.selectedIndex].text;
break;
default:
sValue=e.value;
break;}
_params.push(oField.name+'='+escape(infradoxApp.allTrim(sValue)));
}else{e=eval('document.'+this._formName+'.'+oField.name);
if(e&&e.value){_params.push(oField.name+'='+escape(infradoxApp.allTrim(e.value)));
}else{alert('parameter error:'+oField.name);
err=1;
break;}}}}
if(!err){vrs=_params.join('&');
url=postURL+'?si='+infradoxApp.session+'&rnd='+infradoxApp.getTimeStamp();
infradoxAjax.postRequest(url,vrs,function(){infradoxAjax.setJSONResponseVars(infradoxAjax.xmlHttp.responseText);
infradoxForm._submitResponse();
});}},
putSelectBoxOptions:function(jdat,oSelect,sChooseTitle,defaultId,topoflist,topoflistseparator){var offSet=0;
var hasdefault=0;
if(sChooseTitle) oSelect.options[offSet++]=new Option(sChooseTitle,0);
if(topoflist){for(var x=0;x<topoflist.length;x++){oSelect.options[offSet++]=new Option(topoflist[x].name,topoflist[x].id);
if((defaultId)&&(topoflist[x].id==defaultId)){oSelect.options[offSet-1].selected=1;
hasdefault=1;}}
if(topoflistseparator){oSelect.options[offSet++]=new Option(topoflistseparator,0);}}
for(var i=0;i<jdat.data.length-1;i++){oSelect.options[offSet++]=new Option(jdat.data[i].name,jdat.data[i].id);
if(!hasdefault){if((defaultId)&&(jdat.data[i].id==defaultId)){oSelect.options[offSet-1].selected=1;
hasdefault=1;}}}},
selectBoxSelectOptionById:function(oSelect,id){for(var i=0;i<oSelect.length-1;i++){if(oSelect.options[i].value==id){oSelect.options[i].selected=1;
break;}}}};
var infradoxMedia={initialize:function(content,ski){this.content=content;
this.media=((this.content)?this.content.media:null);
ski=ski||0;
ski=ski||!cfg.indicators.on_initialize;
if(!ski) this.displayIndicators();},
addMedia:function(item){if(!this.content){this.content={media:[]};
this.media=this.content.media;}
this.media.push(item);},
getMediaByIndex:function(index){return (this.media[index]);},
getMediaRefByIndex:function(index){return (this.media[index].ref);},
getMediaTypeName:function(mediaTypeIndex){var mtName=sConstMediaPhoto;
switch(mediaTypeIndex){case 0:mtName=sConstMediaPhoto;break;
case 1:mtName=sConstMediaFootage;break;
case 2:mtName=sConstMediaPDF;break;
case 3:mtName=sConstMediaDocument;break;
case 4:mtName=sConstMediaAudio;break;
case 5:mtName=sConstMediaUnknown;break;}
return mtName;},
allowAction:function(index,actionName){var _media=this.getMediaByIndex(index);
if(!_media){infradoxModal.alert(500,100,'Cannot access media object');
return 0;}
if(_media.tb){infradoxModal.alert(500,100,sMessage_NotAvailableInTerritory);
return ((actionName=='order')?0:1);}
if(_media.br){infradoxModal.alert(500,100,sMessage_BlockedImage);
return ((actionName=='order')?0:1);}
if(_media.nb){infradoxModal.alert(500,100,sMessage_RestrictedImage);}
return 1;},
displayIndicators:function(divsettings,orderMedia){var ind,collections,restrictions,media,data,detail,s,htmldata,m,p,e,aText;
var btestcoll,btestrestr,btestmedia,bicons,btext,samediv_icons,samediv_text,divID,outputHtml;
if(!divsettings) var divsettings=cfg.indicators.divs;
if(!elementID) var elementID="ref";
ind=cfg.indicators;
p='<img src="/images/indicators/';
m='<img src="/images/media/16/';
collections=divsettings.collections;
restrictions=divsettings.restrictions;
media=(divsettings.media?divsettings.media:{icons:{display:0,container:"",div:"indicators_"}});
data=orderMedia?this.content.details:this.media;
if(!data) return;
btestcoll=((collections.icons.display)||(collections.text.display));
btestrestr=((restrictions.icons.display)||(restrictions.text.display));
btestmedia=(media.icons.display);
if(!btestcoll&&!btestrestr){return;}
bicons=(collections.icons.display||restrictions.icons.display||media.icons.display);
btext=(collections.text.display||restrictions.text.display);
samediv_icons=divsettings.iconsdiv;
samediv_text=divsettings.textdiv;
for(var i=0;i<data.length;i++){detail=data[i];
htmldata={c:{i:"",t:""},r:{i:"",t:""},m:{i:"",t:""} };
if(btestcoll){if(collections.icons.display){s='';
s+=(detail.rf?p+'royaltyfree.gif" title="'+ind.rf+'">':'');
s+=(!detail.rf?p+'rightsmanaged.gif" title="'+ind.rm+'">':'');
htmldata.c.i=s;}
if(collections.text.display) htmldata.c.t=(detail.rf?ind.rf:ind.rm);}
if(btestmedia){if(media.icons.display){s='';
if(ind.mticons[detail.mt]) s=m+'media_'+detail.mt.toString()+'.gif">';
htmldata.m.i=s;}}
if(btestrestr){if(restrictions.icons.display){s='';
s+=(detail.br?p+'blocked.gif" title="'+ind.br+'">':'');
s+=((detail.db&&!detail.br)?p+'blocked.gif" title="'+ind.br+'">':'');
s+=(detail.nb?p+'nonblockingrestriction.gif" title="'+ind.nb+'">':'');
s+=(detail.bi?p+'blockimmediatedelivery.gif" title="'+ind.bi+'">':'');
s+=(detail.tr?p+'blockedterritory.gif" title="'+ind.tr+'">':'');
htmldata.r.i=s;}
if(restrictions.text.display){aText=[];
if(detail.br) aText.push(ind.br);
if(detail.db&&!detail.br) aText.push(ind.br);
if(detail.nb) aText.push(ind.nb);
if(detail.bi) aText.push(ind.bi);
if(detail.tr) aText.push(ind.tr);
if((detail.contrestr)&&(detail.contrestr.text)){aText.push('<a href="javascript:infradoxMedia.displayrestrictions(\''+detail.ref+'\');">'+detail.contrestr.text+' ('+detail.contrestr.count+')</a>');}
if((aText.length==0)&&(restrictions.text.none)) aText.push(restrictions.text.none);
if(aText.length>0) htmldata.r.t=aText.join(restrictions.text.delimiter);}}
divID=orderMedia?detail.guid:detail.ref;
if(bicons){if(samediv_icons){outputHtml=htmldata.r.i+htmldata.c.i+htmldata.m.i;
if(outputHtml) infradoxApp.putInnerHtml(samediv_icons+divID,outputHtml);
}else{if(htmldata.r.i) infradoxApp.putInnerHtml(restrictions.icons.div+divID,htmldata.r.i);
if(htmldata.c.i) infradoxApp.putInnerHtml(collections.icons.div+divID,htmldata.c.i);
if(htmldata.m.i) infradoxApp.putInnerHtml(media.icons.div+divID,htmldata.m.i);}}
if(btext){if(samediv_text){outputHtml=htmldata.r.t+htmldata.c.t;
if(outputHtml){infradoxApp.putInnerHtml(samediv_text+divID,outputHtml);}
}else{if(htmldata.c.t) infradoxApp.putInnerHtml(collections.text.div+divID,htmldata.c.t);
if(collections.text.container){e=infradoxApp.getElement(collections.text.container+divID);
if(e) e.style.display=(htmldata.c.t?'block':'none');}
if(htmldata.r.t) infradoxApp.putInnerHtml(restrictions.text.div+divID,htmldata.r.t);
if(restrictions.text.container){e=infradoxApp.getElement(restrictions.text.container+divID);
if(e) e.style.display=(htmldata.r.t?'block':'none');}}}}},
displayrestrictions:function(ref){alert("restrictions can not be displayed right now");}};
function infradoxSuggest(oTextbox,oProvider){this.textbox=oTextbox;
this.provider=oProvider;
this.usertext=infradoxApp.allTrim(oTextbox.value);
this.suggestionsBox;
this.suggestionsData=null;
this.settings={minimumlength:3,
maximumsuggestions:30,
typeaheadtimeout:250,
title:"...",
width:300,height:10,
offsetX:1,offsetY:1,
classes:{container:"suggestionsBoxContainer",
bar:"suggestionsBoxBar",
panel:"suggestionsBoxPanel",
closebutton:"closeButton",
suggestionlolite:"suggestion",
suggestionhilite:"suggestionHilite"},
onclose:null,
enabled:0,
nosuggestionstext:"no suggestions",
nosuggestionshide:0,
alltrim:0,
showcount:0,
keepdata:0,
multiselect:0,
multilabel:""};
this.methods={onclicksuggestion:this.clickSuggestion,
onneedsuggestionbox:this.needSuggestionBox,
ongetsuggestionitem:null};
this.requestNumber=0;
this.timeoutId=null;
this.suggestions;
this.init();};
infradoxSuggest.prototype.applySettings=function(onBox,onClicked,enabled){this.methods.onneedsuggestionbox=onBox;
this.methods.onclicksuggestion=onClicked;
this.settings.enabled=enabled;};
infradoxSuggest.prototype.classes=function(containerClass,barClass,panelClass,closebuttonClass){var scls=this.settings.classes;
scls.container=containerClass;
scls.bar=barClass;
scls.panel=panelClass;
scls.closebutton=closebuttonClass;};
infradoxSuggest.prototype.init=function(){var oThis=this;
this.textbox.onkeyup=function(oEvent){if(!oEvent) oEvent=window.event;
oThis.handleKeyUp(oEvent);}};
infradoxSuggest.prototype.close=function(o){o.suggestionsBox.close();
o.suggestionsBox=null;};
infradoxSuggest.prototype.clickSuggestion=function(suggestionText,oControl,oBox){};
infradoxSuggest.prototype.needSuggestionBox=function(){};
infradoxSuggest.prototype.showSuggestions=function(sug){var s,classLolite,classHilite,_s,sHtml='';
var oControl=this.textbox,oThis=this,createBox=0,sett=this.settings,sugdata,panel,xdiv,boxDiv,oSugBox,clickSuggestion=this.methods.onclicksuggestion,needSuggestionBox=this.methods.onneedsuggestionbox;
sugdata=sug.data;
oSugBox=this.suggestionsBox;
if(!oSugBox&&!sugdata.length&&sett.nosuggestionshide) return;
createBox=(!oSugBox);
if(!createBox){createBox=(!oSugBox.existsondocument());}
if(createBox)  {oSugBox=null;
this.suggestionsBox=needSuggestionBox(oControl);
oSugBox=this.suggestionsBox;}
if(!oSugBox) return;
oSugBox.show();
panel=oSugBox.divBoxPanel;
while (panel.firstChild){panel.removeChild(panel.firstChild);}
if(!sugdata.length){if(sett.nosuggestionshide){this.close(this);
}else{xdiv=panel.innerHTML=sett.nosuggestionstext;}
return;}
classLolite=sett.classes.suggestionlolite;
classHilite=sett.classes.suggestionhilite;
sHtml='';
for(var i=0;i<sugdata.length;i++){_s=null;
if(this.methods.ongetsuggestionitem){sHtml+=this.methods.ongetsuggestionitem(sugdata[i]);
}else{s=sugdata[i].word;
if(this.showcount&&sugdata[i].count) s+=' ('+sugdata[i].count+')';
if(sett.multiselect){sHtml+='<div style="border:padding:0;margin:0;height:auto;float:left;width:96%"><input type="checkbox" style="float:left;padding:0;margin:0;height:1em;width:1em">';
sHtml+='<div class="suggestion" style="cursor:pointer;padding-left:2px;float:left;width:93%" id="'+sugdata[i].word+'">'+s+'</div></div>';
}else{sHtml+='<div class="suggestion" style="cursor:pointer;float:left;width:93%" id="'+sugdata[i].word+'">'+s+'</div>';}}}
panel.innerHTML=sHtml;
var alldivs=infradoxApp.getElementsByClassName(panel,'div','suggestion'),al=alldivs.length,el;
for(var xd=0;xd<al;xd++){el=alldivs[xd];
el.onmouseout=function(){this.className=classLolite};
el.onmouseover=function(){this.className=classHilite};
el.onmousedown=function(oEvent){clickSuggestion(this.id,oControl,oSugBox,oThis,0) };}
if(sett.multiselect&&oSugBox.divBoxFooter){oSugBox.divBoxFooter.style.display="block";
oSugBox.gobutton.onclick=function(){clickSuggestion("",oControl,oSugBox,oThis,1)};}
if(!sett.keepdata){sug=null;
}else{this.suggestionsData=sug;}};
infradoxSuggest.prototype.getSelected=function(fastphrase){var oSugBox=this.suggestionsBox;
var panel=oSugBox.divBoxPanel,result=[],e=panel.firstChild,inp,s;
while(e){if(e.tagName=="DIV"){inp=e.firstChild;
if(inp.type=="checkbox"){if(inp.checked) result.push(inp.nextSibling.id);}}
e=e.nextSibling;}
if(result.length>1){for(var i=0;i<result.length;i++){s=result[i];
if(s.indexOf(' ')>-1){if(fastphrase){result[i]='"'+s+'"';
}else{result[i]='('+s.replace(/ /g,' and ')+')';}}}}
return result;};
infradoxSuggest.prototype.suggest=function(s){this.suggestions=eval('('+s+')');
this.showSuggestions(this.suggestions);};
infradoxSuggest.prototype.handleKeyUp=function(oEvent){if(!oEvent) oEvent=window.event;
var k=oEvent.keyCode,oThis=this,ignore,s,c,sett=this.settings;
if(sett.enabled){ignore=(((k<32||k>=33)&&k<=46)||(k>=112&&k<=123));
if((!ignore)||(k==8)){s=this.textbox.value.replace(/^[\s\xA0]+/,"");
if(sett.alltrim) s=s.replace(/[\s\xA0]+$/,"");
if((s.length>=sett.minimumlength)&&(s!=this.usertext)){c=s.substring(0,1);
if( c.match(/^[A-Z._%-]/i)&&!s.match(/[*?]/i) ){this.usertext=s;
clearTimeout(this.timeoutId);
this.timeoutId=setTimeout( function(){oThis.provider.readSuggestions(oThis);
},this.settings.typeaheadtimeout );}
}else{this.usertext=s;}}}};
function infradoxSuggestionProvider(tpl){this.template=tpl;};
infradoxSuggestionProvider.prototype.readSuggestions=function(oCtrl){var url,vrs;
oCtrl.requestNumber=oCtrl.requestNumber+1;
vrs=infradoxApp.completePostVars('a=disp&ns=1&t='+this.template+'&usertext='+oCtrl.usertext+'&maxsuggestions='+oCtrl.settings.maximumsuggestions);
url=infradoxApp.completeURL('ih');
infradoxAjax.postRequest(url,vrs,function(){oCtrl.suggest(infradoxAjax.xmlHttp.responseText)});};
function infradoxBox(anchorElement){this.anchorElement=anchorElement;
this.id='';
this.divBoxContainer;
this.divBoxBar;
this.divBoxPanel;
this.divBoxFooter;
this.gobutton;
this.settings={width:300,height:10,
offsetX:1,offsetY:1,
title:"",
golabel:"go",
multilabel:" ",
classes:{container:"divBoxContainer",
bar:"divBoxBar",
panel:"divBoxPanel",
closebutton:"closebutton"}};
oThis=this;
this.methods={onclose:function(){oThis.close(oThis);}}};
infradoxBox.prototype.classes=function(containerClass,barClass,panelClass,closebuttonClass,footerClass){this.id=containerClass;
var scls=this.settings.classes;
scls.container=containerClass;
scls.bar=barClass;
scls.panel=panelClass;
scls.closebutton=closebuttonClass;
scls.footer=footerClass;};
infradoxBox.prototype.onclosequery=function(o){o.methods.onclose();};
infradoxBox.prototype.close=function(o){if(!divBoxContainer) return;
if(!divBoxContainer.id) return;
var e=infradoxApp.getElement(divBoxContainer.id);
if(e){while (e.firstChild){e.removeChild(e.firstChild);}
document.body.removeChild(e);}
return 0;};
infradoxBox.prototype.hide=function(o){divBoxContainer.style.display="";};
infradoxBox.prototype.create=function(show){var sett=this.settings;
var oThis=this,golink,img,f,spn;
divBoxContainer=document.createElement("div");
divBoxBar=document.createElement("div");
divBoxPanel=document.createElement("div");
this.divBoxFooter=null;
if(sett.classes.footer){divBoxFooter=infradoxApp.createDomElement({type:"div",className:sett.classes.footer});
divBoxFooter.style.width=sett.width+"px";
divBoxFooter.style.height=24+"px";
this.divBoxFooter=divBoxFooter;
spn=infradoxApp.createDomElement({type:"SPAN",id:"multilabel",text:sett.multilabel},divBoxFooter);
spn.style.cssFloat="left";
spn=infradoxApp.createDomElement({type:"SPAN"},divBoxFooter);
this.gobutton=infradoxApp.createDomElement({type:"A",text:sett.golabel,id:"multigo"},spn);}
if(this.divBoxFooter) divBoxFooter.style.display="none";
divBoxContainer.id=sett.classes.container;
divBoxContainer.className=sett.classes.container;
divBoxContainer.style.display="";
divBoxContainer.style.width=sett.width+"px";
divBoxContainer.style.overflow="hidden";
this.id=divBoxContainer.id;
divBoxBar.className=sett.classes.bar;
if(sett.title) divBoxBar.appendChild(document.createTextNode(sett.title));
divBoxPanel.className=sett.classes.panel;
divBoxPanel.style.cssFloat="left";
divBoxPanel.style.overflow="hidden";
divBoxPanel.style.width="100%";
divBoxContainer.appendChild(divBoxBar);
if(this.settings.classes.closebutton){img=document.createElement('img');
img.src="/images/infradox/dialog_btn_close_ff.gif";
img.className=sett.classes.closebutton;
f=this.onclosequery;
img.onmousedown=function(oEvent){f(oThis) };
divBoxBar.appendChild(img);}
divBoxContainer.appendChild(divBoxPanel);
if(this.divBoxFooter){divBoxContainer.appendChild(this.divBoxFooter)};
document.body.appendChild(divBoxContainer);
this.divBoxContainer=divBoxContainer;
this.divBoxBar=divBoxBar;
this.divBoxPanel=divBoxPanel;
if(show) this.show();};
infradoxBox.prototype.existsondocument=function(){var e=this.elementbyid(this.settings.classes.container);
return e?1:0;};
infradoxBox.prototype.reposition=function(e){this.anchorElement=e;};
infradoxBox.prototype.show=function(){var p=this.pos();
var x=p[0]+document.documentElement.scrollLeft,y=p[1]+document.documentElement.scrollTop;
divBoxContainer.style.left=x+this.settings.offsetX+"px";
divBoxContainer.style.top=y+this.settings.offsetY+"px";
divBoxContainer.style.display="block";};
infradoxBox.prototype.pos=function(){var curleft=0,curtop=0,obj=this.anchorElement;
if(obj.offsetParent){curleft=obj.offsetLeft;
curtop=obj.offsetTop;
while (obj=obj.offsetParent){curleft+=obj.offsetLeft;
curtop+=obj.offsetTop;}}
return [curleft,curtop];};
infradoxBox.prototype.elementbyid=function(eID,oDoc){if(document.getElementById) return document.getElementById(eID);
if(document.all) return document.all[eID];
if(!oDoc) oDoc=document;
if(document.layers){if(oDoc.layers[eID]) return oDoc.layers[eID];
for(var x=0,y;!y&&x<oDoc.layers.length;x++){y=this.elementbyid(eID,oDoc.layers[x].document);}
return y;}
return 0;};
infradoxBox.prototype.appendText=function(elementType,text){var e=document.createElement(elementType);
if(e){e.appendChild(document.createTextNode(text));
this.divBoxPanel.appendChild(e);}
return e;};
infradoxBox.prototype.addPanelItem=function(element){this.divBoxPanel.appendChild(element);};
infradoxBox.prototype.appendLink=function(linkClassName,linkText,fLinkClick){var a=document.createElement("a");
a.className=linkClassName;
a.appendChild(document.createTextNode(linkText));
a.style.cursor='pointer';
a.onclick=fLinkClick;
this.divBoxPanel.appendChild(a);
return a;};
infradoxBox.prototype.innerHtml=function(html){this.divBoxPanel.innerHTML=html;};
DHTML_modalMessage=function()
{var url,
htmlOfModalMessage,
divs_transparentDiv,
divs_content,
iframe,
layoutCss,
width,
height,
existingBodyOverFlowStyle,
dynContentObj,
cssClassOfMessageBox,
shadowDivVisible,
shadowOffset,
MSIE;
this.transparencyclassname='modalDialog_transparentDivs';
this.url='';
this.htmlOfModalMessage='';
this.layoutCss='modal-message.css';
this.height=200;
this.width=400;
this.cssClassOfMessageBox=0;
this.shadowDivVisible=1;
this.shadowOffset=5;
this.MSIE=0;
if(navigator.userAgent.indexOf('MSIE')>=0) this.MSIE=1;};
DHTML_modalMessage.prototype={setSource:function(urlOfSource)
{this.url=urlOfSource;}
,
setHtmlContent:function(newHtmlContent)
{this.htmlOfModalMessage=newHtmlContent;}
,
setSize:function(width,height)
{if(width)this.width=width;
if(height)this.height=height;}
,
setCssClassMessageBox:function(newCssClass)
{this.cssClassOfMessageBox=newCssClass;
var dc=this.divs_content;
if(dc){if(this.cssClassOfMessageBox)
dc.className=this.cssClassOfMessageBox;
else
dc.className='modalDialog_contentDiv';}}
,
setShadowOffset:function(newShadowOffset)
{this.shadowOffset=newShadowOffset;}
,
display:function()
{if(!this.divs_transparentDiv){this.__createDivs();}
this.divs_transparentDiv.style.display='block';
this.divs_content.style.display='block';
this.divs_shadow.style.display='block';
if(this.MSIE)this.iframe.style.display='block';
this.__resizeDivs();
window.refToThisModalBoxObj=this;
setTimeout('window.refToThisModalBoxObj.__resizeDivs()',150);
this.__insertContent();}
,
setShadowDivVisible:function(visible)
{this.shadowDivVisible=visible;}
,
close:function()
{this.divs_transparentDiv.style.display='none';
this.divs_content.style.display='none';
this.divs_shadow.style.display='none';
if(this.MSIE)this.iframe.style.display='none';}
,
addEvent:function(whichObject,eventType,fName,suffix)
{if(!suffix)suffix='';
if(whichObject.attachEvent){whichObject['e'+eventType+fName+suffix]=fName;
whichObject[eventType+fName+suffix]=function(){whichObject['e'+eventType+fName+suffix]( window.event );}
whichObject.attachEvent( 'on'+eventType,whichObject[eventType+fName+suffix] );
} else
whichObject.addEventListener(eventType,fName,0);}
,
__createDivs:function()
{this.divs_transparentDiv=document.createElement('DIV');
var tDiv=this.divs_transparentDiv;
tDiv.className=this.transparencyclassname;
tDiv.style.left='0px';
tDiv.style.top='0px';
document.body.appendChild(this.divs_transparentDiv);
this.divs_content=document.createElement('DIV');
tDiv=this.divs_content;
tDiv.className='modalDialog_contentDiv';
tDiv.id='DHTMLSuite_modalBox_contentDiv';
tDiv.style.zIndex=100000;
if(this.MSIE){this.iframe=document.createElement('<IFRAME src="about:blank" frameborder=0>');
this.iframe.style.zIndex=90000;
this.iframe.style.position='absolute';
document.body.appendChild(this.iframe);}
document.body.appendChild(this.divs_content);
this.divs_shadow=document.createElement('DIV');
tDiv=this.divs_shadow;
tDiv.className='modalDialog_contentDiv_shadow';
tDiv.style.zIndex=95000;
document.body.appendChild(tDiv);
window.refToModMessage=this;
this.addEvent(window,'scroll',function(e){window.refToModMessage.__repositionTransparentDiv() });
this.addEvent(window,'resize',function(e){window.refToModMessage.__repositionTransparentDiv() });}
,
__getBrowserSize:function()
{var bW=document.documentElement.clientWidth;
var bH=document.documentElement.clientHeight;
if(self.innerHeight){bW=self.innerWidth;
bH=self.innerHeight;
}  else if(document.documentElement&&document.documentElement.clientHeight){bW=document.documentElement.clientWidth;
bH=document.documentElement.clientHeight;
} else if(document.body){bW=document.body.clientWidth;
bH=document.body.clientHeight;}
return [bW,bH];}
,
__resizeDivs:function()
{var topOffset=Math.max(document.body.scrollTop,document.documentElement.scrollTop);
if(this.cssClassOfMessageBox)
this.divs_content.className=this.cssClassOfMessageBox;
else
this.divs_content.className='modalDialog_contentDiv';
if(!this.divs_transparentDiv)return;
var st=Math.max(document.body.scrollTop,document.documentElement.scrollTop),sl=Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
window.scrollTo(sl,st);
setTimeout('window.scrollTo('+sl+','+st+');',10);
this.__repositionTransparentDiv();
var brSize=this.__getBrowserSize(),
bW=brSize[0],
bH=brSize[1];
this.divs_content.style.width=this.width+'px';
this.divs_content.style.height=this.height+'px';
var tmpWidth=this.divs_content.offsetWidth,tmpHeight=this.divs_content.offsetHeight;
this.divs_content.style.left=Math.ceil((bW - tmpWidth) / 2)+'px';
this.divs_content.style.top=(Math.ceil((bH - tmpHeight) / 2)+topOffset)+'px';
if(parseInt(this.divs_content.style.top)<0)  this.divs_content.style.top=0+'px';
if(this.MSIE){this.iframe.style.left=this.divs_content.style.left;
this.iframe.style.top=this.divs_content.style.top;
this.iframe.style.width=this.divs_content.style.width;
this.iframe.style.height=this.divs_content.style.height;}
this.divs_shadow.style.left=(this.divs_content.style.left.replace('px','')/1+this.shadowOffset)+'px';
this.divs_shadow.style.top=(this.divs_content.style.top.replace('px','')/1+this.shadowOffset)+'px';
this.divs_shadow.style.height=tmpHeight+'px';
this.divs_shadow.style.width=tmpWidth+'px';
if(!this.shadowDivVisible)this.divs_shadow.style.display='none';}
,
__repositionTransparentDiv:function()
{this.divs_transparentDiv.style.top=Math.max(document.body.scrollTop,document.documentElement.scrollTop)+'px';
this.divs_transparentDiv.style.left=Math.max(document.body.scrollLeft,document.documentElement.scrollLeft)+'px';
var brSize=this.__getBrowserSize(),bW=brSize[0],bH=brSize[1];
this.divs_transparentDiv.style.width=bW+'px';
this.divs_transparentDiv.style.height=bH+'px';}
,
__insertContent:function()
{this.divs_content.innerHTML=this.htmlOfModalMessage;}};
