
function OpenSite(getquery, delay) {
  url = 'wphome.php' + getquery.split("&amp;").join("&");
  wname = "UWPHomeWin";
  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 OpenPlayerPopUp(myskin, getquery) {
  if (myskin=="")       myskin      = 1;
  url = 'wphome_p.php' + getquery.split("&amp;").join("&") + '&myskin=' + myskin;
  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 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,440,'none')", 300);
    else if (agent=="MSIE7") window.setTimeout("maxWindow(445,440,'none')", 300);
    else                     window.setTimeout("Resize(445,420,'none')", 300);
  }
}

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