/***************************************************************
* Pop-Up Version 4.0 H	
* © 1998-2001
* Anoxy Software
* All Rights Reserved
* You are not allowed to modify anything in this Script
****************************************************************
* To get your own copy visit: http://popup.jscentral.com
****************************************************************/

var slimb,slimr,trgtlay,hilay,pcsl,ecY,wox,woy,pmw,wlw,wlh,mdelaytimer,popanimtimer,popswitchtimer,popswotimer,popnpostimer,popnmem,popcmem,poplmem,popnwin,pophbar,popvbar,popMain;
var submenu = new Array();
submenu[0] = "popMain";
var posub = new Array();
var popamem = -1;
var poplevel = pdchk = 0;
var scc = 4;

function popsanim(lobj,cr,cw,lp,te){
lobjs = (te) ? document.getElementById(lobj).offsetHeight : document.getElementById(lobj).offsetWidth;
popsmcX = Math.floor(lobjs*(4-scc)/4);
popsmX = Math.floor(lobjs*scc/4);
if (scc>=0){
scc--;
document.getElementById(lobj).style.clip = (te) ? "rect("+(Math.abs(cr-1)*popsmX)+" "+document.getElementById(lobj).offsetWidth+" "+(cr*popsmcX+Math.abs(cr-1)*cw)+" 0)" : "rect(0 "+(Math.abs(cr-1)*popsmcX+cw)+" "+document.getElementById(lobj).offsetHeight+" "+(cr*popsmX)+")";
if (scc<3){
if (te)
document.getElementById(lobj).style.top = (cr==1) ? (lp+popsmX) : (lp-popsmX);
else
document.getElementById(lobj).style.left = (cr==1) ? (lp-popsmX) : (lp+popsmX);
}
popanimtimer = window.setTimeout('popsanim("'+lobj+'",'+cr+','+cw+','+lp+','+te+')',25);
}
else
scc = 4;
}

function popdsploff(s,e){
if (e)
if (e.originalTarget == "[object XULElement]")
return;
onsubop = false;
ptid = (e) ? e.target.id || e.target.parentNode.id || "" : "";
if (ptid.indexOf("menuItem")==0){
psnum = ptid.replace("menuItem","");
psnum = psnum.replace("arrow","");
if (pmact[psnum] >6)
onsubop = true;
}
if (!onsubop)
popsubctrl(0,s,0,0);
else
if (popanimenabled && pmact[psnum] == 9){
if (mdelaytimer)
clearTimeout(mdelaytimer);
if (e.target.parentNode.parentNode.id == "popHtr")
pophon2(1);
else
popmion2(1);
}
}

function popsubctrl(p1,p2,p3,p4){
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)
break;
else{
document.getElementById(submenu[x]).style.visibility = "hidden";
if (x>0)
submenu[x] = -1;
}
}
if (x-p3+p4<posub.length)
if (posub[x-p3+p4][0] != -1){
with(document.getElementById(posub[x-p3+p4][0])){
style.color = pmclr[3];
style.backgroundColor = pmclr[0];
}
if (document.images["menuItem"+posub[x-p3+p4][1]+"arrow"])
document.images["menuItem"+posub[x-p3+p4][1]+"arrow"].src = popaimg.src;
posub[x-p3+p4][0] = -1;
}
}
}

function setpopnpos(){
if (popnpostimer)
window.clearTimeout(popnpostimer)
popnpostimer = window.setTimeout('setpopnpos2()',1000);
}

function setpopnpos2(){
setpopvars();
popsubctrl(0,1,0,0);
popMain.style.left = poX;
}

function setpopvars(w){
wlw = window.innerWidth;
wlh = window.innerHeight;
popvbar = (document.height+16>window.innerHeight) ? 1 :0;
pophbar = (document.width+16>window.innerWidth) ? 1 : 0;
popsmf();
}

function popmidown(){
if (pmact[pcsl]<7)
setTimeout("popmidown2()",150);
}

function popmidown2(){
switch (eval(pmact[pcsl])){
case 1:
location.href = pmiurl[pcsl];
break;
case 2:
if (!popnwin || popnwin.closed)
popnwin = window.open(pmiurl[pcsl],null,popwinprops);
else
popnwin.location.href = pmiurl[pcsl];
break;
case 3:
if (top.frames[pmitfm[pcsl]])
top.frames[pmitfm[pcsl]].location.href = pmiurl[pcsl];
else
if (parent.frames[pmitfm[pcsl]])
parent.frames[pmitfm[pcsl]].location.href = pmiurl[pcsl];
break;
case 4:
location.hash = pmiurl[pcsl];
break;
case 5:
setTimeout('eval(pmiurl[pcsl])',100)
break;
case 6:
top.location.href = pmiurl[pcsl];
break;
}
}

function popmion(id,e){
pechk = popechk(e);
if (pechk==0 && pdchk==0){
if (popswotimer)
clearTimeout(popswotimer);
tpcsl = id.substring(8,id.length);
if (pmact[tpcsl] != 8){
if (popswitchtimer)
clearTimeout(popswitchtimer);
hilay = document.getElementById(id);
trgtlay = (hilay.parentNode.parentNode.id=="") ? hilay.parentNode.parentNode.parentNode.parentNode : hilay.parentNode.parentNode;
hilay.style.color = pmclr[2];
hilay.style.backgroundColor = pmclr[1];
pcsl = id.substring(8,id.length);
for (x=0; x<submenu.length; x++)
if(trgtlay.id == submenu[x]){
poplevel = x;
break;
}
popsubctrl(poplevel+1,poplevel+1,1,0);
if (poplevel==0)
popsubctrl(poplevel+1,poplevel+2,1,1);
if (pmact[pcsl] == 9)
if (poplevel==0)
pophon2(0);
else
popmion2(0);
}
}
}

function pophon2(pcv){
popamem = -1;
if (document.getElementById(pmiurl[pcsl]).style.visibility == "visible" && document.getElementById(pmiurl[pcsl]).style.clip != "rect(0pt 0pt 0pt 0pt)" && !(popnmem != pcsl && poplmem == poplevel))
return;
popsmsf();
smpx = (hilay.offsetLeft+wdp>slimr) ? ((slimr-wdp>wox) ? slimr-wdp : wox) : hilay.offsetLeft;
smpy = (popopendir == 0) ? hilay.offsetTop+trgtlay.offsetHeight+1 : hilay.offsetTop- hgp-1;
with(document.getElementById(pmiurl[pcsl]).style){
top = smpy;
left = smpx;
if (popanimenabled)
clip = "rect(0pt 0pt 0pt 0pt)";
else
visibility = "visible";
}
cr = popopendir;
cw = hgp;
if (popanimenabled){
if (popcmem == trgtlay.id && scc<4)
mdelaytimer = setTimeout('pophon2(0)',200);
else{
popcmem = pmiurl[pcsl];
scc = 4;
if (popanimtimer)
clearTimeout(popanimtimer);
if (pcv==0)
mdelaytimer = window.setTimeout('document.getElementById(pmiurl[pcsl]).style.visibility = "visible";popsanim(pmiurl[pcsl],cr,cw,smpy,true)',popdeltimermsec);
else{
document.getElementById(pmiurl[pcsl]).style.visibility = "visible";
popsanim(pmiurl[pcsl],cr,cw,smpy,true);
}
}
}
}

function popsmf(){
wox = window.pageXOffset;
woy = window.pageYOffset;
slimb = wlh+woy-(17*pophbar);
slimr = wlw+wox-(17*popvbar);
}

function popsmsf(){
popnmem = pcsl;
poplmem = poplevel;
popsmf();
submenu[(poplevel+1)] = pmiurl[pcsl];
posub[poplevel] = new Array(hilay.id,pcsl);
document.getElementById(pmiurl[pcsl]).style.zIndex = trgtlay.style.zIndex+1;
wdp = document.getElementById(pmiurl[pcsl]).offsetWidth;
hgp = document.getElementById(pmiurl[pcsl]).offsetHeight;
}

function popmion2(pcv){
document.images["menuItem"+pcsl+"arrow"].src = popoimg.src;
popamem = pcsl;
if (document.getElementById(pmiurl[pcsl]).style.visibility == "visible" && document.getElementById(pmiurl[pcsl]).style.clip != "rect(0pt 0pt 0pt 0pt)" && !(popnmem != pcsl && poplmem == poplevel))
return;
popsmsf();
popcorX = false;
smpx = trgtlay.offsetLeft+hilay.offsetWidth-2;
smpy = hilay.offsetTop-2;
if (smpx+wdp >= slimr){
smpx = trgtlay.offsetLeft-wdp+6;
popcorX = true;
}
if (smpy+hgp >= slimb)
smpy = smpy-hgp+hilay.offsetHeight;
if (smpx<wox)
smpx = trgtlay.offsetLeft+6;
if (smpy<woy)
smpy = woy;
with(document.getElementById(pmiurl[pcsl]).style){
top = smpy;
left = smpx;
if (popanimenabled)
clip = "rect(0pt 0pt 0pt 0pt)";
else
visibility = "visible";
}
cr = (popcorX) ? 0:1;
cw = (popcorX) ? 0:wdp;
if (popanimenabled){
if (popcmem == trgtlay.id && scc<4)
mdelaytimer = setTimeout('popmion2(0)',200);
else{
popcmem = pmiurl[pcsl];
scc = 4;
if (popanimtimer)
clearTimeout(popanimtimer);
document.getElementById(pmiurl[pcsl]).style.visibility = "visible";
if (pcv==0)
mdelaytimer = window.setTimeout('popsanim(pmiurl[pcsl],cr,cw,smpx,false)',popdeltimermsec);
else
popsanim(pmiurl[pcsl],cr,cw,smpx,false);
}
}
}

function popmioff(id,e){
pechk = popechk(e);
pnEl = (e.relatedTarget) ? ((e.relatedTarget.id == undefined) ? e.rangeParent.parentNode.id : e.relatedTarget.id) : null;
if(e.currentTarget.id == pnEl)
pdchk = 1;
else
pdchk = 0;
if (pechk==0 && pdchk==0){
if (popautoswitch)
popswotimer = setTimeout('popdsploff(1)',popsotimermsec);
deletehilay = true;
for (x=0; x<posub.length; x++)
if (posub[x][0] == id){
deletehilay = false;
popamem = -1;
if (popanimenabled)
popswitchtimer = setTimeout('pophhlay()',50);
break;
}
if (deletehilay){
with (document.getElementById(id)){
style.color = pmclr[3];
style.backgroundColor = pmclr[0];
}
if (popamem != -1){
if (document.images["menuItem"+popamem+"arrow"])
document.images["menuItem"+popamem+"arrow"].src = popaimg.src;
popamem = -1;
}
}
if (mdelaytimer)
clearTimeout(mdelaytimer);
}
}

function pophhlay(){
e = posub[poplevel][0];
if (e!=-1){
psnum = posub[poplevel][1];
if (document.getElementById(pmiurl[pcsl]).style.clip == "rect(0pt 0pt 0pt 0pt)"){
with (document.getElementById(e)){
style.color = pmclr[3];
style.backgroundColor = pmclr[0];
}
if (document.images["menuItem"+pcsl+"arrow"])
document.images["menuItem"+pcsl+"arrow"].src = popaimg.src
}
}
}

function popechk(e){
pfEl = (e.originalTarget) ? e.originalTarget.id : null;
ptEl = (e.relatedTarget) ? e.relatedTarget.id : null;
if((pfEl+"arrow" == ptEl) || (pfEl == ptEl+"arrow"))
return(1);
else
return(0);
}

function popcacnelso(){
if (popswotimer)
clearTimeout(popswotimer)
}
