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

function OpenPlayerPopUp(myskin, sessionid, ppid) {
  if (myskin=="")       myskin      = 1;
  if (ppid!=undefined)  ppidquery   = "&ppid="+ppid;
  else                  ppidquery   = "";
  url = 'uwphome_p.php?myskin=' + myskin + '&SID=' + sessionid + ppidquery;
  wname = "UWPPlayerWin" + myskin;
  wname=window.open(url,wname,'resizable=0,scrollbars=0,toolbar=0,location=0,menubar=0,status=1,width=435,height=380,top=0,left=0,screenX=0,screenY=0');
  wname.focus();
}


function ExtraWin (url,width,height) {
  if (width=="")  width  = 700
  if (height=="") height = 600;
  ttExtraWin=window.open(url,'ttExtraWin','resizable=1,scrollbars=1,toolbar=0,location=0,menubar=0,status=1,left=0,top=0,width='+width+',height='+height);
  ttExtraWin.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')", 100);
    else                 window.setTimeout("Resize(screen.availWidth,screen.availHeight,'center')", 100);
  }
  else {
    if (agent=="MSIE")       window.setTimeout("maxWindow(445,420,'none')", 100);
    else if (agent=="MSIE7") window.setTimeout("maxWindow(445,440,'none')", 100);
    else                     window.setTimeout("Resize(435,420,'none')", 100);
  }
}

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

function ChangeColor(newclassname) {
  document.getElementById("flashbody").className = newclassname;
}
