/***************************************************************
* Pop-Up Version 3.5 Freeware	
* © 1998-2000 by
* Lefteris Haritou
* 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;
var slimr;
var trgtlay;
var tplay;
var hilay;
var csellaynum;
var mousex;
var mousey;
var ecX;
var ecY;
var popmXp;
var popmYp;
var clobj;
var mdelaytimer;
var popanimtimer;
var popswitchtimer;
var popswotimer;
var popnmem;
var poplmem;
var popcmem;
var popnwin;
var baselayer = new Array();
var bodylayer = new Array();
var submenu = new Array();
submenu[0] = "popmain";
var opensubm = new Array();
var bodyflayer;
var bodyhlayer;
var layerchange = false;
var popamem = -1;
var layernum = 0;
var poplevel = 0;
var pmchgt = 0;
var pmcwdt = 0;
var pmscwd = 0;
var cc = 4;
var scc = 4;
var dactiv = false;
var popmmvd = false;
var wlw = window.innerWidth;
var wlh = window.innerHeight;
var pmha = String.fromCharCode(104,116,116,112,58,47,47,112,111,112,117,112,46,106,115,99,101,110,116,114,97,108,46,99,111,109);
var pmhl = String.fromCharCode(67,108,105,99,107,32,104,101,114,101,32,116,111,32,99,114,101,97,116,101,32,121,111,117,114,32,111,119,110,32,109,101,110,117);
var pmh1 = String.fromCharCode(65,76,84,61,34);
var pmht = String.fromCharCode(77,101,110,117,32,99,114,101,97,116,101,100,60,66,82,62,119,105,116,104,32,80,111,112,45,85,112);

window.onresize = resz;

function resz(){
if (wlw != window.innerWidth || wlh != window.innerHeight)
location.reload();
}

function popminit(){
Popupml.clip.width = window.innerWidth;
Popupml.clip.height = window.innerHeight;
for (j=0 ; j<Popupml.document.layers.length; j++){
baselayer[j] = Popupml.document.layers[j];
bodylayer[j] = baselayer[j].document.layers[8];
if(pmact[j] == 9){
baselayer[j].bgColor = pmclr[0];
}
else
{
baselayer[j].bgColor = pmclr[5];
}
bodylayer[j].clip.width = pmmwds[j];
baselayer[j].clip.width = bodylayer[j].clip.width+4;
baselayer[j].clip.height = bodylayer[j].clip.height+4;
if (popautoswitch)
baselayer[j].onmouseout = popsomenu;
if (j == 0){
bodyhlayer = bodylayer[j].document.layers["menuHitem"];
bodyflayer = baselayer[j].document.layers["nndummyItem"];
bodyflayer.onmousedown = popmidown;
bodyflayer.onmouseout = popmioff;
with (bodyhlayer){
clip.width = bodylayer[j].clip.width;
bgColor = pmclr[5]; //menu bgcolor
document.open("text/html");
document.writeln('<Div Id="menuHitem1" style="position:absolute;width:'+pmmwds[0]+';color:'+pmclr[10]+';text-align:center;font-Family:Arial;font-size:16px;font-weight:bold;font-style:normal">Globaltalker Menu</Div><Div Id="menuHdummy" style="position:absolute"></Div>');
document.close();
clip.height=20;
}
}
brdrsettings = new Array(bodylayer[j].clip.width+1,1,pmclr[0],bodylayer[j].left-1,bodylayer[j].top-2,1,bodylayer[j].clip.height+4,pmclr[0],bodylayer[j].left-2,bodylayer[j].top-2,bodylayer[j].clip.width+1,1,pmclr[0],bodylayer[j].left-1,bodylayer[j].top+bodylayer[j].clip.height+1,1,bodylayer[j].clip.height+4,pmclr[0],bodylayer[j].left+bodylayer[j].clip.width+1,bodylayer[j].top-2,bodylayer[j].clip.width,1,pmclr[0],bodylayer[j].left,bodylayer[j].top-1,1,bodylayer[j].clip.height+2,pmclr[0],bodylayer[j].left-1,bodylayer[j].top-1,bodylayer[j].clip.width,1,pmclr[0],bodylayer[j].left,bodylayer[j].top+bodylayer[j].clip.height,1,bodylayer[j].clip.height+2,pmclr[0],bodylayer[j].left+bodylayer[j].clip.width,bodylayer[j].top-1);
brdrsettings2 = new Array(bodylayer[j].clip.width+1,1,pmclr[0],bodylayer[j].left-1,bodylayer[j].top-2,1,bodylayer[j].clip.height+4,pmclr[0],bodylayer[j].left-2,bodylayer[j].top-2,bodylayer[j].clip.width+1,1,pmclr[0],bodylayer[j].left-1,bodylayer[j].top+bodylayer[j].clip.height+1,1,bodylayer[j].clip.height+4,pmclr[0],bodylayer[j].left+bodylayer[j].clip.width+1,bodylayer[j].top-2,bodylayer[j].clip.width,1,pmclr[10],bodylayer[j].left,bodylayer[j].top-1,1,bodylayer[j].clip.height+2,pmclr[10],bodylayer[j].left-1,bodylayer[j].top-1,bodylayer[j].clip.width,1,pmclr[10],bodylayer[j].left,bodylayer[j].top+bodylayer[j].clip.height,1,bodylayer[j].clip.height+2,pmclr[10],bodylayer[j].left+bodylayer[j].clip.width,bodylayer[j].top-1);
for (z=0; z<8; z++){
with(baselayer[j]){
if(pmact[j] == 9){
document.layers[z].clip.width = brdrsettings[(z*5)];
document.layers[z].clip.height = brdrsettings[(z*5+1)];
document.layers[z].bgColor = brdrsettings[(z*5+2)];
document.layers[z].left = brdrsettings[(z*5+3)];
document.layers[z].top = brdrsettings[(z*5+4)];
}
else{
document.layers[z].clip.width = brdrsettings2[(z*5)];
document.layers[z].clip.height = brdrsettings2[(z*5+1)];
document.layers[z].bgColor = brdrsettings2[(z*5+2)];
document.layers[z].left = brdrsettings2[(z*5+3)];
document.layers[z].top = brdrsettings2[(z*5+4)];
}
}
}
//for separator
for (x=0; x<bodylayer[j].document.layers.length; x++){
if (bodylayer[j].document.layers[x].name.indexOf("menuSeparator") != -1){
with(bodylayer[j].document.layers[x]){
clip.height = 2;
clip.width = bodylayer[j].clip.width-6;
document.layers[0].clip.height = 1;
document.layers[0].clip.width = bodylayer[j].clip.width-6;
document.layers[0].bgColor = pmclr[0];
document.layers[1].clip.height = 1;
document.layers[1].clip.width = bodylayer[j].clip.width-6;
document.layers[1].bgColor = pmclr[11];
}
}
if (bodylayer[j].document.layers[x].name.indexOf("menuItem") != -1){
l = bodylayer[j].document.layers[x];
l.clip.width = bodylayer[j].clip.width;
l.onmouseover = popmion;
bodylayer[j].onmouseout = popmioff;
bodylayer[j].onmouseover = popmclay;
}
}
}
for (x=0; x<baselayer.length; x++)
baselayer[x].moveAbove(Popupml);
}

function popdspl(e){
popcorX = false;
popcorY = false;
if ((e.which == 1 && !poprclickenabled) || (e.which == 3 && poprclickenabled) || popimgenabled){
slimb = window.innerHeight+window.pageYOffset;
slimr = window.innerWidth+window.pageXOffset;
if(baselayer[0].visibility == "hide" || poprclickenabled){
bodyflayer.captureEvents(Event.MOUSEDOWN);
wdp = baselayer[0].clip.width;
hgp = baselayer[0].clip.height;
ecX = window.pageXOffset;
ecY = window.pageYOffset;
if (!popimgenabled){
mpx = e.pageX;
mpy = e.pageY;
}
if (mpx+wdp+(20*popvscrbar) >= slimr){
mpx = mpx-wdp;
popcorX = true;
}
if (mpy+hgp+(20*pophscrbar) >= slimb){
mpy = mpy-hgp;
popcorY = true;
}
ct = (popcorY) ? 0:1;
cr = (popcorX) ? 0:1;
ch = (popcorY) ? 0:baselayer[0].clip.height;
cw = (popcorX) ? 0:baselayer[0].clip.width;
pmchgt = baselayer[0].clip.height;
pmcwdt = baselayer[0].clip.width;
with(baselayer[0]){
top = mpy;
left = mpx;
if (popanimenabled){
clip.top = 0;
clip.left = 0;
clip.bottom = 0;
clip.right = 0;
}
visibility = "show";
}
popdsplh();
if (popanimenabled)
popanim(ct,cr,ch,cw,mpx,mpy);
}
else
if(!poprclickenabled)
popdsploff(0);
}
}

function popanim(ct,cr,ch,cw,lp,tp){
popmcX = pmcwdt*(4-cc)/4;
popmX = pmcwdt*cc/4;
popmcY = pmchgt*(4-cc)/4;
popmY = pmchgt*cc/4;
if (cc>=0){
cc--;
with (baselayer[0].clip){
top = ct*popmY;
right = Math.abs(cr-1)*popmcX+cw;
bottom = Math.abs(ct-1)*popmcY+ch;
left = cr*popmX;
}
if (cr==1)
baselayer[0].left = lp-popmX;
else
baselayer[0].left = lp+popmX;
if (ct==1)
baselayer[0].top =tp-popmY;
else
baselayer[0].top = tp+popmY;
window.setTimeout('popanim('+ct+','+cr+','+ch+','+cw+','+lp+','+tp+')',12);
}
else
cc = 4;
}

function popsanim(lobj,cr,cw,lp){
clobj = lobj;
popsmcX = pmscwd*(4-scc)/4;
popsmX = pmscwd*scc/4;
if (scc>=0){
scc--;
with (Popupml.document.layers[lobj].clip){
right = Math.abs(cr-1)*popsmcX+cw;
left = cr*popsmX;
}
if (cr==1)
Popupml.document.layers[lobj].left = lp-popsmX;
else
Popupml.document.layers[lobj].left = lp+popsmX;
popanimtimer = window.setTimeout('popsanim(this.clobj,'+cr+','+cw+','+lp+')',25);
}
else
scc = 4;
}

function popdsplh(){
with (bodyhlayer.document.layers["menuHdummy"]){
document.open("text/html");
document.writeln('<Img Src="'+popbasedir+'pop_spc.gif" WIDTH="'+pmmwds[0]+'" HEIGHT="32" BORDER="0" onmousedown="popdragstart(event);return false" onmouseup="popdragend()">');
document.close();
}
}

function popdsploff(s){
for (x=s; x<submenu.length; x++)
if (submenu[x] != -1){
Popupml.document.layers[submenu[x]].visibility = "hide";
if (x>0)
submenu[x] = -1;
}
for (x=0; x<opensubm.length; x++){
if (opensubm[x][0] != -1){
ostplay = bodylayer[opensubm[x][2]].document.layers[opensubm[x][0]];
ostplay.document.layers["menuItem"+opensubm[x][1]+"h"].visibility = "hide";
ostplay.bgColor = pmclr[0];
if (x==0)
bodyflayer.moveBelow(ostplay);
ostplay.document.layers["menuItem"+opensubm[x][1]+"arrow"].document.images["popmenuarrow"+opensubm[x][1]].src = popaimg.src;
opensubm[x][0] = -1;
}
}
if (popanimenabled){
window.clearTimeout(popanimtimer);
window.clearTimeout(mdelaytimer);
}
}

function popdragstart(e){
dactiv = true;
mousex = e.pageX-baselayer[0].left;
mousey = e.pageY-baselayer[0].top;
popmXp = baselayer[0].left;
popmYp = baselayer[0].top;
popdsploff(1);
}

function popredraw(){
if (baselayer[0].visibility=="show"){
pYvl = (window.pageYOffset-ecY)/10;
popYstep = (pYvl>0) ? Math.ceil(pYvl) : Math.floor(pYvl);
pXvl = (window.pageXOffset-ecX)/10;
popXstep = (pXvl>0) ? Math.ceil(pXvl) : Math.floor(pXvl);
if (popYstep!=0 || popXstep!=0){
for (x=0; x<submenu.length; x++){
if (submenu[x]!=-1 && popascrolltype>1 && popYstep!=0)
Popupml.document.layers[submenu[x]].top += popYstep;
if (submenu[x]!=-1 && popascrolltype!=2 && popXstep!=0)
Popupml.document.layers[submenu[x]].left += popXstep;
}
ecY += popYstep;
ecX += popXstep;
}
}
}

function popmove(e){
if (dactiv){
pmlp = e.pageX-mousex;
pmtp = e.pageY-mousey;
if (popsnapenabled){
if (pmlp+15+(16*popvscrbar)+baselayer[0].clip.width>window.innerWidth+window.pageXOffset)
pmlp = window.innerWidth+window.pageXOffset-baselayer[0].clip.width-(16*popvscrbar);
if (pmtp+15+(16*pophscrbar)+baselayer[0].clip.height>window.innerHeight+window.pageYOffset)
pmtp = window.innerHeight+window.pageYOffset-baselayer[0].clip.height+(16*pophscrbar);
if (pmlp-window.pageXOffset<15)
pmlp = window.pageXOffset;
if (pmtp-window.pageYOffset<15)
pmtp = window.pageYOffset;
}
with(baselayer[0]){
left = pmlp;
top = pmtp;
}
if (popmXp-baselayer[0].left != 0 || popmYp-baselayer[0].top != 0)
popmmvd = true;
}
}

function popdragend(){
dactiv = false;
//if (!popmmvd)
//popmidown(0)
//else
if (navigator.appVersion.indexOf("Linux") == -1)
popdsplh();
popmmvd = false;
}

function popmidown(e){
onsubop = 0;
if (e){
onsubop = pmact[csellaynum];
if (e.which == 1 && onsubop < 7)
setTimeout("popmidown2()",200);
}
else
if (e == 0)
setTimeout("window.open(pmha)",200);
if (onsubop < 7){
popmioff();
if (popfixedenabled)
popdsploff(1);
else
popdsploff(0);
}
}

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

function popmclay(e){
newpoplevel = true;
bodypl = e.target.name+"";
for (x=0; x<baselayer.length; x++)
if (baselayer[x].name+"i" == bodypl){
layernum = x;
break;
}
layerchange = true;
for (x=0; x<=submenu.length; x++)
if (baselayer[layernum].name == submenu[x]){
poplevel = x;
newpoplevel = false;
break;
}
if (newpoplevel)
poplevel++;
}

function popmion(e){
if (cc==4){
if (popsndenabled && Popupml.document.popsnd){
Popupml.document.popsnd.stop();
Popupml.document.popsnd.play();
}
if (trgtlay && !layerchange)
popmioff();
window.clearTimeout(popswotimer);
layerchange = false;
trgtlay = e.target.name;
tplay = bodylayer[layernum].document.layers[trgtlay];
with (bodyflayer){
top = tplay.top;
clip.height = tplay.clip.height;
clip.width = tplay.clip.width + 5;
visibility = "show";
moveAbove(tplay);
}
csellaynum = trgtlay.substring(8,trgtlay.length);
hilay = "menuItem"+csellaynum+"h";
tplay.document.layers[hilay].visibility = "show";
bodylayer[layernum].document.layers[trgtlay].bgColor = pmclr[1];
for (x=poplevel+1; x<submenu.length; x++){
if (submenu[x] != -1){
if (pmact[csellaynum] == 9 && pmiurl[csellaynum] == submenu[x] && submenu[(x-1)] != -1)
break;
else{
Popupml.document.layers[submenu[x]].visibility = "hide";
submenu[x] = -1;
}
}
if (opensubm[x-1][0] != -1){
ostplay = bodylayer[opensubm[x-1][2]].document.layers[opensubm[x-1][0]];
ostplay.document.layers["menuItem"+opensubm[x-1][1]+"h"].visibility = "hide";
ostplay.bgColor = pmclr[0];
ostplay.document.layers["menuItem"+opensubm[x-1][1]+"arrow"].document.images["popmenuarrow"+opensubm[x-1][1]].src = popaimg.src;
opensubm[x-1][0] = -1;
}
}
window.clearTimeout(popswitchtimer);
if (pmact[csellaynum] == 9)
popmion2(0);
}
}

function popmion2(pcv){
tplay.document.layers["menuItem"+csellaynum+"arrow"].document.images["popmenuarrow"+csellaynum].src = popoimg.src;
popamem = csellaynum;
if (Popupml.document.layers[pmiurl[csellaynum]].visibility == "show" && eval(Popupml.document.layers[pmiurl[csellaynum]].clip.width!=0) && !(popcmem != csellaynum && poplmem == poplevel))
return;
if (clobj == submenu[poplevel] && scc<4)
mdelaytimer = setTimeout ('popmion2()',200);
else{
popcmem = csellaynum;
poplmem = poplevel;
popcorX = false;
slimb = window.innerHeight+window.pageYOffset;
slimr = window.innerWidth+window.pageXOffset;
submenu[(poplevel+1)] = pmiurl[csellaynum];
opensubm[poplevel] = new Array(trgtlay,csellaynum,layernum);
popnmem = pmiurl[csellaynum];
popnmem = popnmem.substring(3,popnmem.length);
popnmem = popnmem.split("submain");
popnmem = popnmem[0];
pmscwd = eval(pmmwds[popnmem])+4;
wdp = pmscwd;
hgp = Popupml.document.layers[pmiurl[csellaynum]].clip.height;
mpx = baselayer[layernum].left+baselayer[layernum].clip.width-6;
mpy = baselayer[layernum].top+tplay.top-2;
if (mpx+wdp+(16*popvscrbar) >= slimr){
mpx = baselayer[layernum].left-wdp+6;
popcorX = true;
}
if (mpy+hgp+(16*pophscrbar) >= slimb)
mpy = mpy-hgp+tplay.clip.height+2;
if (mpy<0)
mpy = 0;
if (mpx<0)
mpx = baselayer[layernum].left+6;
with(Popupml.document.layers[pmiurl[csellaynum]]){
top = mpy;
left = mpx;
moveAbove(baselayer[layernum]);
if (popanimenabled){
clip.left = 0;
clip.right = 0;
}
visibility = "show";
}
if (popanimenabled){
window.clearTimeout(popanimtimer);
scc = 4;
cr = (popcorX) ? 0:1;
cw = (popcorX) ? 0:pmscwd;
if (pcv==0)
mdelaytimer=window.setTimeout('popsanim(pmiurl[csellaynum],cr,cw,mpx)',popdeltimermsec);
else
popsanim(pmiurl[csellaynum],cr,cw,mpx);
}
}
}

function popmioff(){
if (bodylayer[layernum].document.layers[trgtlay]){
deletehilay = true;
for (x=0; x<opensubm.length; x++)
if (opensubm[x][0] == trgtlay){
deletehilay = false;
popamem = -1;
if (popanimenabled){
window.clearTimeout(popswitchtimer);
popswitchtimer = window.setTimeout('pophhlay('+poplevel+')',50);
}
}
if (deletehilay){
tplay.document.layers[hilay].visibility = "hide";
if(pmact[layernum] == 9) {
tplay.bgColor = pmclr[0];
}
else {
tplay.bgColor = pmclr[5];
}
bodyflayer.moveBelow(tplay);
if (popamem!=-1){
tplay.document.layers["menuItem"+popamem+"arrow"].document.images["popmenuarrow"+popamem].src = popaimg.src;
popamem = -1;
}
}
window.clearTimeout(mdelaytimer);
}
}

function pophhlay(lvl){
if (opensubm[lvl])
if (Popupml.document.layers[pmiurl[opensubm[lvl][1]]].clip.right == 0){
ostplay = bodylayer[opensubm[lvl][2]].document.layers[opensubm[lvl][0]];
ostplay.document.layers["menuItem"+opensubm[lvl][1]+"h"].visibility = "hide";
ostplay.bgColor = pmclr[0];
bodyflayer.moveBelow(ostplay);
ostplay.document.layers["menuItem"+opensubm[lvl][1]+"arrow"].document.images["popmenuarrow"+opensubm[lvl][1]].src = popaimg.src;
opensubm[lvl][0] = -1;
}
}

function popsomenu(){
popswotimer = window.setTimeout('popdsploff(1)',popsotimermsec);
}
