/***************************************************************
* Pop-Up Version 4.7 Pro
* © 1998-2004
* Anoxy Software
* All Rights Reserved
* You are not allowed to modify anything in this Script
****************************************************************
* To get your own copy visit: http://www.anoxy.com
****************************************************************/

var slimb,slimr,trgtlay,hilay,pcsl,mousex,mousey,wlw,wlh,wox,woy,ecX,ecY,pdb,spdb,popmXp,popmYp,pwdp,phgp,clobj,mdelaytimer,popanimtimer,popswitchtimer,popswotimer,popnpostimer,popmacrestimer,popdescrtimer,popnmem,popcmem,poplmem,popnwin,pmaclm,pmactm,clrnum,ieMacver,popXURLV;
var submenu = new Array();
var pmpimg = new Array();
submenu[0] = "popMain";
var posub = new Array();
var popamem = popmacrsz = -1;
var poplevel = 0;
var cc = scc = 4;
var dactiv = false;
var ismac = (navigator.appVersion.indexOf("Macintosh")==-1) ? false : true;
var Pmpat = /\D/g;
if (ismac){
ieMacver = navigator.userAgent.split(";");
ieMacver = eval(ieMacver[1].replace("MSIE ",""));
}
var pmha = "";
var pmhl = String.fromCharCode(84,105,116,108,101,61,34,67,114,101,100,105,116,69,110,103,105,110,101,46,78,101,116,34);
var pmht = String.fromCharCode(67,114,101,100,105,116,32,82,101,112,111,114,116,32,69,110,103,105,110,101);
var pmsf = String.fromCharCode(82,44,69,69,68,87,76,73,69,83,70,0,78,50,69,79,83,83);

function popdsploff(s){
onsubop = false;
if (event)
if (event.srcElement)
if (event.srcElement.id.indexOf("menuItem")==0){
psnum = event.srcElement.id.replace("menuItem","");
psnum = psnum.replace("arrow","");
if (pmact[psnum]>6)
onsubop = true;
}
if (!onsubop){
if (hilay && popfilterenabled)
if (hilay.filters.length>0)
hilay.filters[0].Stop();
popsubctrl(0,s,0);
}
else
if (popanimenabled && pmact[psnum] == 9){
clearTimeout(mdelaytimer);
popmion2(1);
}
}

function popsubctrl(p1,p2,p3){
for (x=p1; x<submenu.length; x++){
if (x>=p2)
if (submenu[x] != -1){
if (pmact[pcsl] == 9 && pmiurl[pcsl] == submenu[x] && submenu[(x-1)] != -1 && p3==1 && posub[(x-1)][1]==pcsl)
break;
else{
document.all[submenu[x]].style.visibility = "hidden";
if (x>0)
submenu[x] = -1;
}
}
if (x-p3<posub.length)
if (posub[x-p3][0] != -1){
clrnum = popclrindx[document.all[posub[x-p3][0]].parentElement.parentElement.id.replace(Pmpat,"")] || 0;
with(document.all[posub[x-p3][0]]){
style.color = pmclr[clrnum][3];
style.backgroundColor = pmclr[clrnum][0];
}
document.images["menuItem"+posub[x-p3][1]+"arrow"].src = popaimg[clrnum].src;
posub[x-p3][0] = -1;
if (pmpimg[posub[x-p3][1]] && pmpimg[posub[x-p3][1]]!=-1){
document.all[cf5+posub[x-p3][1]+"img"].src = pmpimg[posub[x-p3][1]];
pmpimg[posub[x-p3][1]] = -1;
}
}
}
}

function popredraw(){
if (popMain.style.visibility=="visible" && !dactiv){
pYvl = (ecY-popMain.style.pixelTop+spdb.scrollTop)/10;
popYstep = (pYvl>0) ? Math.ceil(pYvl) : Math.floor(pYvl);
pXvl = (ecX-popMain.style.pixelLeft+ spdb.scrollLeft)/10;
popXstep = (pXvl>0) ? Math.ceil(pXvl) : Math.floor(pXvl);
if (popYstep!=0 || popXstep!=0){
clearTimeout(popmacrestimer);
for (x=0; x<submenu.length; x++){
if (submenu[x]!=-1 && popascrolltype>1)
document.all[submenu[x]].style.pixelTop += popYstep;
if (submenu[x]!=-1 && popascrolltype!=2)
document.all[submenu[x]].style.pixelLeft += popXstep;
}
if (ismac && ieMacver<5.1)
popmacrestimer = setTimeout('window.resizeBy(0,popmacrsz);popmacrsz = -popmacrsz',800);
}
}
}

function setpopnpos(){
if (!ismac || ieMacver>=5.1){
window.clearTimeout(popnpostimer)
popnpostimer = window.setTimeout('setpopnpos2()',200);
}
else
popsmf();
}

function setpopnpos2(){
popsmf();
if (popMain.offsetTop+phgp>slimb || popMain.offsetLeft+pwdp>slimr){
popdsploff(1);
if (popMain.offsetTop+phgp>slimb)
popMain.style.top = (slimb-phgp>woy) ? slimb - phgp : woy;
ecY = popMain.style.pixelTop-woy;
if (popMain.offsetLeft+pwdp>slimr)
popMain.style.left = (slimr-pwdp>wox) ? slimr - pwdp : wox;
ecX = popMain.style.pixelLeft-wox;
}
}

function popmidown(e,k){
if (e != 0){
if (event.button==1){
pmclkitm = k;
if (pmact[pcsl]<7)
setTimeout("popmidown2(pmclkitm)",150);
}
}
else
if(pmha!=""){
if (pmha.indexOf("javascript:") == 0)
setTimeout("eval(pmha.substring(11,pmha.length))",150);
else
setTimeout("location.href=pmha",150);
if (popfixedenabled==0)
popdsploff(0);
}
}

function popmidown2(e){
popXURLV = popXURLV || "";
switch (eval(pmact[pcsl])){
case 1:
location.href = pmiurl[pcsl]+popXURLV;
break;
case 2:
if (!popnwin || popnwin.closed)
popnwin = window.open(pmiurl[pcsl]+popXURLV,null,popwinprops);
else
popnwin.location.href = pmiurl[pcsl]+popXURLV;
break;
case 3:
tgfr = top.frames[pmitfm[pcsl]] || parent.frames[pmitfm[pcsl]] || document.frames[pmitfm[pcsl]] || "0";
if (tgfr!=0)
tgfr.location.href = pmiurl[pcsl]+popXURLV;
break;
case 4:
location.hash = pmiurl[pcsl];
break;
case 5:
setTimeout('eval(pmiurl[pcsl])',100)
break;
case 6:
top.location.href = pmiurl[pcsl]+popXURLV;
break;
}
popmioff(e,0)
}

function popmion(e){
if (cc==4){
pechk = popechk();
if (pechk==0){
pcsl = e.substring(8,e.length);
clearTimeout(popswotimer);
if (pmact[pcsl] != 8){
clearTimeout(popswitchtimer);
trgtlay = document.all[e];
while (!trgtlay.id.match("pop") || trgtlay.id.match("aini") && trgtlay.parentElement)
trgtlay = trgtlay.parentElement;
clrnum = popclrindx[trgtlay.id.replace(Pmpat,"")] || 0;
for (x=0; x<submenu.length; x++)
if(trgtlay.id == submenu[x]){
poplevel = x;
break;
}
if (popsndenabled && !ismac)
if (popsnd.readyState == 4){
popsnd.CurrentPosition = 0;
popsnd.Play();
}
if (hilay && popfilterenabled)
if (hilay.filters.length>0)
hilay.filters[0].Stop();
hilay = document.all[e];
if (popfilterenabled){
hilay.style.filter = filtertype1;
if (hilay.filters.length==0)
hilay.style.filter = filtertype2;
if (hilay.filters.length>0)
hilay.filters[0].Apply();
}
hilay.style.color = pmclr[clrnum][2];
if (popfilterenabled && hilay.filters.length>0)
hilay.filters[0].Play(filtertime);
hilay.style.backgroundColor = pmclr[clrnum][1];
if (pmsbtxt[pcsl])
window.status = unescape(pmsbtxt[pcsl]);
if (pmoimg[pcsl]){
if (!pmpimg[pcsl] || pmpimg[pcsl]==-1)
pmpimg[pcsl] = document.images[cf5+pcsl+"img"].src;
document.images[cf5+pcsl+"img"].src = pmoimg[pcsl].src;
}
popsubctrl(poplevel+1,poplevel+1,1);
if (pmact[pcsl] == 9)
popmion2(0);
}
}
}
}

function popsmf(){
wox = spdb.scrollLeft;
woy = spdb.scrollTop;
wlw = pdb.clientWidth;
wlh = pdb.clientHeight;
slimb = wlh+woy;
slimr = wlw+wox;
}

function popmion2(pcv){
if (document.all[pmiurl[pcsl]].style.visibility == "visible" && document.all[pmiurl[pcsl]].style.clip != "rect(0px 0px 0px 0px)" && !(popnmem != pcsl && poplmem == poplevel))
return;
document.images["menuItem"+pcsl+"arrow"].src = popoimg[clrnum].src;
popamem = pcsl;
popnmem = pcsl;
poplmem = poplevel;
popcorX = false;
popsmf();
submenu[(poplevel+1)] = pmiurl[pcsl];
posub[poplevel] = new Array(hilay.id,pcsl,poplevel);
document.all[pmiurl[pcsl]].style.zIndex = trgtlay.style.zIndex+1;
wdp = document.all[pmiurl[pcsl]].offsetWidth;
hgp = document.all[pmiurl[pcsl]].offsetHeight;
smpx = trgtlay.offsetLeft+trgtlay.offsetWidth+pmaclm-6;
smpy = trgtlay.offsetTop+hilay.offsetTop+pmactm;
if (smpx+wdp >= slimr){
smpx = trgtlay.offsetLeft+(trgtlay.offsetWidth - hilay.offsetWidth)-wdp+2+pmaclm;
popcorX = true;
}
if (smpy+hgp >= slimb)
smpy = smpy-hgp+hilay.offsetHeight;
if (smpx<wox)
smpx = trgtlay.offsetLeft+6+pmaclm;
if (smpy<woy)
smpy = woy;
with(document.all[pmiurl[pcsl]].style){
top = smpy;
left = smpx;
if (popanimenabled)
clip = "rect(0 0 0 0)";
visibility = "visible";
}
cr = (popcorX) ? 0:1;
cw = (popcorX) ? 0:document.all[pmiurl[pcsl]].offsetWidth;
if (popanimenabled){
if (popcmem == trgtlay.id && scc<4)
mdelaytimer = setTimeout('popmion2(0)',200);
else{
popcmem = pmiurl[pcsl];
scc = 4;
clearTimeout(popanimtimer);
if (pcv==0)
mdelaytimer = setTimeout('popsanim(pmiurl[pcsl],cr,cw,smpx)',popdeltimermsec);
else
popsanim(pmiurl[pcsl],cr,cw,smpx);
}
}
if (ismac && ieMacver<5.1)
setTimeout('window.resizeBy(0,popmacrsz);popmacrsz = -popmacrsz',500);
}

function popmioff(e,k){
pechk = (k==0) ? k : popechk();
if (pechk==0){
deletehilay = true;
if (popautoswitch)
popswotimer = setTimeout('popdsploff(1)',popsotimermsec);
for (x=0; x<posub.length; x++)
if (posub[x][0] == e && k!=0){
deletehilay = false;
popamem = -1;
if (popanimenabled)
popswitchtimer = setTimeout('pophhlay()',100);
break;
}
if (pmsbtxt[pcsl])
window.status = "";
if (deletehilay){
clrnum = popclrindx[document.all[e].parentElement.parentElement.id.replace(Pmpat,"")] || 0;
with (document.all[e]){
style.color = pmclr[clrnum][3];
style.backgroundColor = pmclr[clrnum][0];
}
if (pmpimg[pcsl]){
if (pmpimg[pcsl]!=-1)
document.all[cf5+pcsl+"img"].src = pmpimg[pcsl];
pmpimg[pcsl] = -1;
}
}
clearTimeout(mdelaytimer);
}
}

function pophhlay(){
e = posub[poplevel][0];
if (e!=-1){
psnum = posub[poplevel][1];
if (document.all[pmiurl[psnum]].style.clip == "rect(0px 0px 0px 0px)"){
clrnum = popclrindx[document.all[e].parentElement.parentElement.id.replace(Pmpat,"")] || 0;
with (document.all[e]){
style.color = pmclr[clrnum][3];
style.backgroundColor = pmclr[clrnum][0];
}
document.images["menuItem"+psnum+"arrow"].src = popaimg[clrnum].src;
}
}
}

function popechk(){
pfEl = event.fromElement;
ptEl = event.toElement;
if (pfEl != null && ptEl != null)
if ((pfEl.id+"arrow" == ptEl.id) || (pfEl.id == ptEl.id+"arrow") || (pfEl.id+"img" == ptEl.id) || (pfEl.id == ptEl.id+"img"))
return(1);
else
return(0);
}

function popcacnelso(){
clearTimeout(popswotimer);
}
