
function OpenSite (ppid, delay, getquery) {
  url = 'flhome.php' + getquery.split("&amp;").join("&");
  wname = "ttHomeWin";
  var delay = delay * 1;
  window.setTimeout("wname=window.open(url,wname,'resizable=1,scrollbars=1,toolbar=0,location=0,menubar=0,status=1');wname.focus();", delay);
}

function ExtraWin (url,width,height) {
  if (width=="")  width  = 700
  if (height=="") height = 600;
  invenioExtraWin=window.open(url,'invenioExtraWin','resizable=1,scrollbars=1,toolbar=0,location=0,menubar=0,status=1,left=0,top=0,width='+width+',height='+height);
  invenioExtraWin.focus();
}

function maxWindow(width,height,position) {
  if (position == "center") {
    intAnchoScreen = screen.availWidth;
    intAltoScreen  = screen.availHeight;
    posX   = (intAnchoScreen - width) / 2;
    posY   = (intAltoScreen - height) / 2;
    window.moveTo(posX,posY);
  }
  if (document.all)  {
    top.window.resizeTo(width,height);
  }
  else if (document.layers||document.getElementById) {
    if (top.window.outerHeight<height||top.window.outerWidth<width) {
      top.window.outerHeight = height;
      top.window.outerWidth = width;
    }
  }
}

function Resize(width,height,position) {
  if (position == "center") {
    intAnchoScreen = screen.availWidth;
    intAltoScreen  = screen.availHeight;
    posX   = (intAnchoScreen - width) / 2;
    posY   = (intAltoScreen - height) / 2;
    window.moveTo(posX,posY);
  }
  window.resizeTo(width,height);
}

function InitWindow(agent,mode) {
  if (mode=="fullscreen") {
    if (agent=="MSIE")   window.setTimeout("maxWindow(screen.availWidth,screen.availHeight,'center')", 300);
    else                 window.setTimeout("Resize(screen.availWidth,screen.availHeight,'center')", 300);
  }
  else {
    if (agent=="MSIE")       window.setTimeout("maxWindow(445,420,'none')", 300);
    else if (agent=="MSIE7") window.setTimeout("maxWindow(445,440,'none')", 300);
    else                     window.setTimeout("Resize(435,420,'none')", 300);
  }
}

function ChangeStyle(elem,what,value) {
  document.getElementById("skinchoice").style.visibility = value;
}

function WinOpen(name){ 
	twinwavetext = window.open(name,"twinwavetext","width=680,height=440,menubar=0,locationbar=1;resizable=yes,status=1,scrollbars=1,screenX=0,screenY=0");
	setTimeout("twinwavetext.focus()",1000);
	twinwavetext.moveTo(screen.width/2-680/2,screen.height/2-560/2);
}


