//****** Advanced DHTML Popup Libraries Version # 1.66 ******

// Copyright (c) Digital Flow Software 2005-2006
// The present javascript code is property of Digital Flow Software.
// This code can only be used inside Internet/Intranet web sites located on *web servers*, as the outcome of a licensed Advanced DHTML Popup application only.
// This code *cannot* be used inside distributable implementations (such as demos, applications or CD-based webs), unless this implementation is licensed with an "Advanced DHTML Popup License for Distributed Applications".
// Any unauthorized use, reverse-engineering, alteration, transmission, transformation, facsimile, or copying of any means (electronic or not) is strictly prohibited and will be prosecuted.
// ***Removal of the present copyright notice is strictly prohibited***

var maxcpad,maxbwh,maxtbw,minheight,minwidth,moving=0,resizing=0,tryonce,tryagain,shf,def,rsh,dsh,bdf=0;
var fia=0,foa=100,bounceamount=0,dropdownpart=0,bouncepart=0,slideinpart=0,fadeinpart=0,fadeoutpart=0,tid1,tid2,tid3,tid4,bng;
var lhg=0,dmt=document,nbl='none',ibl='block',nvi='hidden',ivi='visible',sct,ResizeElement,TitleElement,ContentElement,adjustint,UpdateScrollInt,cntInt,gshadowsize;
function d(id){return dmt.getElementById(id)}
var w3=(d)?true:false;
var mie=(w3 && dmt.all)?true:false;
var ns=(w3 && !dmt.all)?true:false;
op=(navigator.userAgent.indexOf('Opera')!=-1);
window.onerror=function(){return true};
var xpos=new Array(),ypos=new Array(),pwidth=new Array,pheight=new Array,isshadowg=new Array,istitleg=new Array;
var cpadg=new Array(),bwhg=new Array(),tbwg=new Array();
MovexDiff=0;MoveyDiff=0;ResizexDiff=0;ResizeyDiff=0;z_index=10000;Mousex=0;Mousey=0;
function miebody(){return (dmt.compatMode && dmt.compatMode=="CSS1Compat")? dmt.documentElement:dmt.body}
if(dmt.compatMode=='CSS1Compat')sct=true;else sct=false;
function jumpstartns(){if(ns){self.resizeBy(1,1);self.resizeBy(-1,-1);}}
function mc(id,v,l){
if(l){
var t0=new Date();
t0.setTime(t0.getTime()+(l*1e3));
var tl=";expires="+t0.toGMTString();}
else var tl="";
dmt.cookie=id+"="+escape(v)+tl+"; path=/";}
function rc(id){
var idc=id+"=";
var a=document.cookie.split(';');
for(var i=0;i<a.length;i++){
var s=a[i];
while (s.charAt(0)==' ') s=s.substring(1,s.length);
if (s.indexOf(idc)==0) return unescape(s.substring(idc.length,s.length));
}return null;}
function cc(id){
if((rc(id.substring(0,id.length-2)+'_r'))!=loc)return;
if(!rc(id)){
show(id.substring(0,id.length-2));
clearTimeout(t);adpTimer(id.substring(0,id.length-2),'','','hide','','',shf);}
else{var t=setTimeout("cc('"+id+"')",1000);}}
function soh(id,bon,voh){d(id+'_border').style.display=bon;if(isshadowg[id])d(id+'_shadow').style.display=bon;d(id+'_rsize').style.display=bon;d(id+'_close').style.display=bon;d(id+'_innercontent').style.display=bon;d(id+'_title').style.display=bon;d(id+'_border').style.visibility=voh;if(isshadowg[id])d(id+'_shadow').style.visibility=voh;d(id+'_rsize').style.visibility=voh;d(id+'_close').style.visibility=voh;d(id+'_innercontent').style.visibility=voh;d(id+'_title').style.visibility=voh;}
function hide(id){clearTimeout(dsh);clearInterval(rsh);clearTimeout(tid3);clearTimeout(tid4);soh(id,nbl,nvi)}
function show(id){
if(bdf){rsh=setInterval("soh('"+id+"',ibl,ivi)",10);}
else{dsh=setTimeout("soh('"+id+"',ibl,ivi)",150);
}
if(mie){d(id+'_border').style.filter= "alpha(opacity=100)";d(id+'_shadow').style.filter="alpha(opacity=30)";}
else{d(id+'_border').style.MozOpacity=.99;d(id+'_shadow').style.MozOpacity=0.3;}}
function mousemove(evt){
Mousex=(mie)?event.clientX+miebody().scrollLeft:evt.pageX;
Mousey=(mie)?event.clientY+miebody().scrollTop:evt.pageY;
if(mie){window.event.cancelBubble = true;window.event.returnValue = false;}else evt.preventDefault();
if(mie&&!op)if(event.button!=1){moving=0;resizing=0;return true;}
if(moving)window.setTimeout("move()",10);if(resizing)window.setTimeout("resize(nEl)",10);
if(Mousex<=10 || Mousey<=window.pageYOffset+5 || Mousex>=window.innerWidth+window.pageXOffset-16 || Mousey>=window.innerHeight+window.pageYOffset-16){moving=0; resizing=0;return true;}
return false;
}
function move(){
var movex=Mousex+MovexDiff;
var movey=Mousey+MoveyDiff;
d(nEl+'_border').style.left=movex+'px';
d(nEl+'_shadow').style.left=movex+gshadowsize+'px';
d(nEl+'_border').style.top=movey+'px';
d(nEl+'_shadow').style.top=movey+gshadowsize+'px';
return false;
}
function stmr(){
if(moving)jumpstartns();
if(mie){
dmt.detachEvent('onmousemove', mousemove);
dmt.detachEvent('onmouseup', stmr);
}else{
document.removeEventListener("mousemove",mousemove,true);
        document.removeEventListener("mouseup",stmr,true);
}
moving=0;resizing=0;
}
function amre(evt){
if(mie){
dmt.attachEvent("onmousemove",mousemove);
dmt.attachEvent("onmouseup",stmr);
window.event.cancelBubble = true;
window.event.returnValue = false;
}else{
document.addEventListener("mousemove",mousemove,true);
document.addEventListener("mouseup",stmr,true);
evt.preventDefault();
}
Mousex=(mie)?event.clientX+miebody().scrollLeft:evt.pageX;
Mousey=(mie)?event.clientY+miebody().scrollTop:evt.pageY;
nEl=this.adpid;
if(this.id==this.adpid+'_title'||this.id==this.adpid+'_innercontent'){
moving=1;
MovexDiff=parseInt(d(this.adpid+'_border').style.left)-Mousex;
MoveyDiff=parseInt(d(this.adpid+'_border').style.top)-Mousey;
d(this.adpid+'_shadow').style.zIndex=++z_index;
d(this.adpid+'_border').style.zIndex=++z_index;
}else if(this.id==this.adpid+'_rsize'){
resizing=1;
ResizexDiff=parseInt(this.style.left)-Mousex;
ResizeyDiff=parseInt(this.style.top)-Mousey;
}}
function resize(id){
var resizex=Mousex+ResizexDiff+9;
var resizey=Mousey+ResizeyDiff+9;
d(nEl+'_rsize').style.left=Math.max(resizex-9,minwidth+2*bwhg[id]-9)+'px';
d(nEl+'_rsize').style.top=Math.max(resizey-9,minheight+2*bwhg[id]-9)+'px';
d(nEl+'_shadow').style.width=Math.max(resizex,minwidth+2*bwhg[id])+'px';
d(nEl+'_shadow').style.height=Math.max(resizey,minheight+2*bwhg[id])+'px';
d(nEl+'_border').style.width=Math.max(resizex,minwidth+2*bwhg[id])+'px';
d(nEl+'_border').style.height=Math.max(resizey,minheight+2*bwhg[id])+'px';
d(nEl+'_title').style.width=Math.max((resizex-2*bwhg[id]+((mie&&!sct)?0:-3)),(minwidth-((mie&&!sct)?0:3)))+'px';
d(nEl+'_innercontent').style.width=Math.max((resizex-2*bwhg[id]+((mie&&!sct)?0:-2*cpadg[id])),((mie&&!sct)?minwidth:minwidth-2*cpadg[id]))+'px';
d(nEl+'_innercontent').style.height=Math.max((resizey-2*bwhg[id]-tsp+((mie&&!sct)?0:-2*cpadg[id])),((mie&&!sct)?minheight-tsp:minheight-tsp-2*cpadg[id]))+'px';
d(nEl+'_close').style.left=Math.max(resizex-bwhg[id]-20,minwidth+bwhg[id]-20)+'px';
return false;}
function ctr(id){if(self.innerHeight){var pht=self.innerHeight;var pwh=self.innerWidth;var sht=self.pageYOffset;var slt=self.pageXOffset;}else if(dmt.documentElement && sct){var pht=dmt.documentElement.offsetHeight;var pwh=dmt.documentElement.offsetWidth;var sht=dmt.documentElement.scrollTop;var slt=dmt.documentElement.scrollLeft;}else if(document.body){var pht=dmt.body.offsetHeight;var pwh=dmt.body.offsetWidth;var sht=dmt.body.scrollTop;var slt=dmt.body.scrollLeft;}var cth=(pht/2)-((mie)?10:8)-((pheight[id]+2*bwhg[id]+2*tbwg[id])/2)+sht;var ctw=(pwh/2)-((mie)?10:8)-((pwidth[id]+2*bwhg[id]+2*tbwg[id])/2)+slt;d(id+'_border').style.top=(cth)+'px';d(id+'_shadow').style.top=(cth+gshadowsize)+'px';d(id+'_border').style.left=(ctw)+'px';d(id+'_shadow').style.left=(ctw+gshadowsize)+'px';}
function NewElement(id,x,y,w,h,bgColour){
var adiv=dmt.createElement('div');
adiv.setAttribute('id',id);
adiv.style.backgroundColor=bgColour;
adiv.style.display='none';
adiv.style.padding='0px 0px 0px 0px';
adiv.style.position='absolute';
adiv.style.left=x+'px';
adiv.style.top=y+'px';
adiv.style.width=w+'px';
adiv.style.height=h+'px';
return adiv;}
function adp(adpid,text,titletext){
minheight=50;minwidth=50;maxcpad=15;maxbwh=15;maxtbw=5;x=125;y=10;w=415;h=410;
shadowcolor="#0F0F0F";isvisible=1;innercontentfont="bold 11pt MS Sans Serif";innertextcolor="#FFFFFF";innerbgcolor="#000000";
titletextcolor="#FFFFFF";titlecolor="#672F14";bordercolor="#000000";isresizeable= 1 ;onceonly= 0 ;
ismovable= 1 ;adpshowfor=0;isdropin=0;isslidein=0;isfadein= 0 ;
isfadeout= 0 ;canclose= 1 ;istitle= 1 ;isshadow=0;cpad=8;
bwh=1;tbw=3;cnt=1;issrcollbars= 0 ;adpdelayfor=1;
shadowsize=0;isupdatescroll=0;ispcc= 0 ;tro= 5 ;tra= 6 ;rn= 1 ;bnc= 0 ;cnm= 0 ;
issp=0;plt=0;
w=Math.max(w,minwidth);
h=Math.max(h,minheight);
bwhg[adpid]=Math.min(bwh,maxbwh);
cpad=Math.min(cpad,maxcpad);pcc=ispcc;shf=adpshowfor;def=adpdelayfor;
tbw=Math.min(tbw,maxtbw);gshadowsize=shadowsize;tbw=0;bng=bnc;
istitleg[adpid]=istitle;isshadowg[adpid]=isshadow;
xpos[adpid]=x;ypos[adpid]=y;pwidth[adpid]=w;pheight[adpid]=h;
cpadg[adpid]=cpad;tbwg[adpid]=tbw;tryonce=tro;tryagain=tra;
if(istitleg[adpid])tsp=20;else tsp=0;
if(!w3)return;
if(Math.floor(Math.random()*rn)!=0)return;
loc=window.location.href;
if(issp){var sp=rc(adpid+'_sp');if(sp) return;else mc(adpid+'_sp',true,plt);}
if(onceonly)if(ac1(adpid))return;
if(cnt){xpos[adpid]=0;ypos[adpid]=-2*pheight[adpid];cntInt=setTimeout("ctr('"+ adpid +"')",175);}
var shadow=new NewElement(adpid+'_shadow',xpos[adpid]+gshadowsize,ypos[adpid]+gshadowsize,w+2*bwhg[adpid]+2*tbw,h+2*bwhg[adpid]+2*tbw,shadowcolor);
if(mie)shadow.style.filter="alpha(opacity=30)";else shadow.style.MozOpacity=.3;
var border=new NewElement(adpid+'_border',xpos[adpid],ypos[adpid],w+2*bwhg[adpid]+((mie)?2*tbw:0),h+2*bwhg[adpid]+((mie)?2*tbw:0),bordercolor);
border.style.borderStyle="outset";
border.style.borderWidth=tbw;
border.style.borderColor=bordercolor;
border.style.zIndex=++z_index;
var title=new NewElement(adpid+'_title',bwhg[adpid],bwhg[adpid],w-((mie&&!sct)?0:3),20,titlecolor);
title.style.overflow="hidden";
title.style.borderStyle="solid";
title.style.borderWidth="0px";
title.style.borderColor="";
title.style.padding="0px 0px 0px 3px";
title.innerHTML='<span style="position:absolute; top:1px; font:bold 9pt arial; color:'+titletextcolor+'; height:15px; overflow:hidden; clip-height:16px;">'+titletext+'</span>';
if(istitle){
var innercontent=new NewElement(adpid+'_innercontent',bwhg[adpid],bwhg[adpid]+20,w-((mie&&!sct)?0:2*cpad),h-lhg-20-((mie&&!sct)?0:2*cpad),innerbgcolor);
}else{
var innercontent=new NewElement(adpid+'_innercontent',bwhg[adpid],bwhg[adpid],w-((mie&&!sct)?0:2*cpad),h-lhg-((mie&&!sct)?0:2*cpad),innerbgcolor);
}
innercontent.style.borderColor="";
innercontent.style.borderStyle="inset";
innercontent.style.borderWidth="0px";
if(issrcollbars){
innercontent.style.overflow="auto";
}else{
innercontent.style.overflow="hidden";
}
innercontent.style.padding=cpad+'px';
innercontent.style.font=innercontentfont;
innercontent.style.color=innertextcolor;
innercontent.innerHTML=text;
var rsize=new NewElement(adpid+'_rsize',w+2*bwhg[adpid]-9,h+2*bwhg[adpid]-9,9,9,'');
var close=new NewElement(adpid+'_close',w+bwhg[adpid]-20,bwhg[adpid],20,20,'');
border.appendChild(close);border.appendChild(rsize);border.appendChild(title);border.appendChild(innercontent);dmt.body.appendChild(border);dmt.body.appendChild(shadow);
if(isresizeable){rsize.innerHTML='<img src="resize.gif" width="9" height="9">';rsize.style.cursor='move';rsize.style.zIndex=++z_index;}
if(canclose){close.innerHTML='<img src="close.gif" width="20" height="20">';close.style.zIndex=++z_index;}
rEl=d(adpid+'_rsize');tEl=d(adpid+'_title');cEl=d(adpid+'_innercontent');rEl.adpid=adpid;tEl.adpid=adpid;cEl.adpid=adpid;
if(isresizeable)rEl.onmousedown=amre;
if(ismovable){tEl.style.cursor="pointer";tEl.onmousedown=amre;if(cnm){cEl.style.cursor="pointer";cEl.onmousedown=amre;}}
d(adpid+'_close').onclick=new Function("hide('"+ adpid +"');");
if(isupdatescroll){UpdateScrollInt=setInterval("UpdateScroll('"+ adpid +"',xpos['"+ adpid +"'],ypos['"+ adpid +"'])", 100);}
}
function adpTimer(id,fid1,fid2,fid3,fid4,int1,int2){
id="'" + id + "'";
clearTimeout(tid1);clearTimeout(tid2);clearTimeout(tid3);clearTimeout(tid4);
tstr1='' + fid1 + '(' + id + ')';
tstr2='' + fid2 + '(' + id + ')';
tstr3='' + fid3 + '(' + id + ')';
tstr4='' + fid4 + '(' + id + ')';
tid1=setTimeout(tstr1,1000*int1);
tid2=setTimeout(tstr2,1000*int1);
tid3=setTimeout(tstr3,1000*(int1+int2));
tid4=setTimeout(tstr4,1000*(int1+int2));
}
