var autoclose = true

function popup(urlPop,windowH,windowW){

s = "width="+windowW+",height="+windowH,"scrollbars=no,toolbar=no";
var beIE = document.all?true:false
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);
if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    NFW.blur()
    window.focus()       
    var frameString="<html><head><title></title></head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0 style='margin: 0; padding: 0;' >"+
"<frame name='top' src='"+urlPop+"' scrolling=no status=no>"+
"<frame name='bottom' src='about:blank' scrolling='no'>"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(urlPop,"popFrameless",s)
    NFW.blur()
    window.focus() 
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }   
  NFW.focus()   
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}

function sPopup(urlPop,windowH,windowW){

s = "width="+windowW+",height="+windowH,"scrollbars=yes,toolbar=no";
var beIE = document.all?true:false
var windowX = (screen.width/2)-(windowW/2);
var windowY = (screen.height/2)-(windowH/2);
if (beIE){
    NFW = window.open("","popFrameless","fullscreen,"+s)
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
    NFW.blur()
    window.focus()       
    var frameString="<html><head><title></title></head>"+
"<frameset rows='*,0' framespacing=0 border=0 frameborder=0 style='margin: 0; padding: 0;' >"+
"<frame name='top' src='"+urlPop+"' scrollbars=yes status=no>"+
"<frame name='bottom' src='about:blank' >"+
"</frameset>"+
"</html>"
    NFW.document.open();
    NFW.document.write(frameString)
    NFW.document.close()
  } else {
    NFW=window.open(urlPop,"popFrameless","scrollbars,"+s)
    NFW.blur()
    window.focus() 
    NFW.resizeTo(windowW,windowH)
    NFW.moveTo(windowX,windowY)
  }   
  NFW.focus()   
  if (autoclose){
    window.onunload = function(){NFW.close()}
  }
}

// xPopup - jm

var thisPop='';
var floatOffset=0;

if (/Mozilla\/5\.0/.test(navigator.userAgent))
    document.write('<script type="text/javascript" src="mozInnerHTML.js"></script>');

function xPopup(an, height, width) {
    var href = an.href;
    var boxdiv = document.getElementById(href);
    if (boxdiv != null) {
        if (boxdiv.style.display=='none') { move_box(an, boxdiv); boxdiv.style.display='block';}
        else boxdiv.style.display='none';
        return false;
    }
    boxdiv = document.createElement('div');
    boxdiv.setAttribute('id', href);
    boxdiv.style.display = 'block';
    boxdiv.style.position = 'absolute';
    boxdiv.style.width = width + 'px';
    boxdiv.style.height = height + 'px';
    boxdiv.style.border = 'solid';
    boxdiv.style.backgroundColor = '#fff';
    var cBt = document.createElement('table');
    var cBtb = document.createElement('tbody');
    var cBtr = document.createElement('tr');
    var cBtd = document.createElement('td');
    var cBtda = document.createElement('a');
    cBtda.setAttribute('href','javascript:history.go(0)');
    cBtda.setAttribute('onclick','var dg=document.getElementById("'+href+'"); dg.style.display="none"; dg.src=" "; document.body.removeChild(dg);');
    cBtda.innerHTML="<img src='img/closeBox.gif' alt='Close' title='Close' border='0'>";
    cBt.width=width+'px';
    cBtd.align='right';
    cBtd.style.paddingTop='7px';
    cBtd.style.paddingRight='7px';
    cBtd.appendChild(cBtda);
    cBtr.appendChild(cBtd);
    cBtb.appendChild(cBtr);
    cBt.appendChild(cBtb);

    var contents = document.createElement('iframe');
    contents.scrolling = 'no';
    contents.frameBorder = '0';
    contents.style.width = width + 'px';
    contents.style.height = height + 'px';
    contents.src = href;

    boxdiv.appendChild(cBt);
    boxdiv.appendChild(contents);
    document.body.appendChild(boxdiv);
    changeOpac(0,href);
    move_box(an, boxdiv);
    opac(href,0,100);
    thisPop=href;
    return false;
}

function move_box(an, box) {
    var obj = an;
    var cleft=((screen.width/2)-(box.offsetWidth/2));
    var ctop=(window.screen.height/2)-(box.offsetHeight/2);
    box.style.left = cleft + 'px';
    floatOffset=(box.offsetHeight/5);
    box.style.top = (floatOffset +document.body.scrollTop)+ 'px';
}

function opac(id, opacStart, opacEnd) { // automatic opacity fadein
  var speed=10;
  var timer = 0;
  if (opacStart<opacEnd) {
    for (i=opacStart; i<= opacEnd; i++) {
      setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));
      timer++;
    }
  }
}

function changeOpac(opacity, id) {
  var object = document.getElementById(id).style;
  try{object.opacity= (opacity/100);} catch (e) {}
  try{object.MozOpacity= (opacity/100);} catch (e) {}
  try{object.KhtmlOpacity= (opacity/100);} catch (e) {}
  try{object.filter = "alpha(opacity="+opacity+")";} catch (e) {}
}

function resetPos()
   {try{document.getElementById(thisPop).style.top=(floatOffset+document.body.scrollTop)+'px';} catch(e){}}
window.onscroll=resetPos;