var macbug = (navigator.userAgent.indexOf("Mac") > -1 && !document.all) ? true: false;

function goUrl(form) {
  var windowprops = "height=600,width=600,location=1,scrollbars=1,menubar=1,toolbar=1,resizable=1,status=1,directories=1";
  var URL = form.site.options[form.site.selectedIndex].value;
  popup = window.open(URL,"MenuPopup",windowprops);
}

function ppvpop(){
  newwin = window.open("http://www.directv.com/see/landing/gloriapop.htm", "winpopupprof","WIDTH=200 HEIGHT=300,scrollbars=no");
  newwin.focus();
}

function popup(url, scroll){
  var scrollable;
  scroll? scrollable=",scrollbars": scrollable="";
  newwin = window.open(url, "winpopup1","WIDTH=320,HEIGHT=350" + scrollable);
  newwin.focus();
}

function popupLearnMore(file){
  var url = "http://www.directv.com/DTVAPP/html/content/activation/"+file;
  scrollable=",scrollbars";
  newwin = window.open(url, "winpopup1","WIDTH=600,HEIGHT=350" + scrollable);
  newwin.focus();
}

function popup400(url, scroll){
  var scrollable;
  (scroll && macbug)? scrollable=",SCROLLBARS=yes": scrollable="";
  (scroll && !macbug)? scrollable=",SCROLLBARS": scrollable="";
  newwin = window.open(url, "winpopup2","WIDTH=320,HEIGHT=400" + scrollable);
  newwin.focus();
}

function popup_profile(){
  newwin = window.open("http://www.directv.com/user/profile.html", "winpopupprof","WIDTH=365,HEIGHT=280,scrollbars=no");
  newwin.focus();
}

function popupOffers(url, scroll){
  var scrollable;
  scroll? scrollable=",scrollbars": scrollable="";
  newwin = window.open(url, "winpopup10","WIDTH=392,HEIGHT=400" + scrollable);
  newwin.focus();
}

function popupReceivers(url, scroll){
  var scrollable;
  scroll? scrollable=",scrollbars": scrollable="";
  newwin = window.open(url, "winpopup10","WIDTH=380,HEIGHT=400" + scrollable);
  newwin.focus();
}

function popupSports(url){
  newwin = window.open(url, "winpopup3","WIDTH=780,HEIGHT=500,scrollbars,toolbar,menubar,resizable");
  newwin.focus();
}

//function popupJobs(url){
//  newwin = window.open(url, "winpopup3","WIDTH=600,HEIGHT=525,scrollbars,toolbar,menubar,resizable");
//  newwin.focus();
//}

function showRecruitSoft(url) {
  self.name = "main";
  newwin = window.open(url, "winpopup3","WIDTH=742,HEIGHT=650,scrollbars,toolbar,menubar,resizable");
  newwin.focus();
}

function goUrl(url){
  window.opener.location.href = url;
  window.close();
}

function popupDemo(url){
  newwin = window.open(url, "winpopup4","WIDTH=600,HEIGHT=350");
  newwin.focus();
}

function popupDemo(url, scroll){
  var scrollable;
  (scroll && macbug)? scrollable=",SCROLLBARS=yes": scrollable="";
  (scroll && !macbug)? scrollable=",SCROLLBARS": scrollable="";
  newwin = window.open(url, "winpopup5","WIDTH=620,HEIGHT=350" + scrollable);
  newwin.focus();
}

function popupDemoSize(url, scroll,widthHeight){
  var scrollable;
  (scroll && macbug)? scrollable=",SCROLLBARS=yes": scrollable="";
  (scroll && !macbug)? scrollable=",SCROLLBARS": scrollable="";
  newwin = window.open(url, "winpopup5",widthHeight + scrollable);
  newwin.focus();
}

function popup440(url, scroll){
  var scrollable;
  (scroll && macbug)? scrollable=",SCROLLBARS=yes": scrollable="";
  (scroll && !macbug)? scrollable=",SCROLLBARS": scrollable="";
  newwin = window.open(url, "winpopup6","WIDTH=440,HEIGHT=400" + scrollable);
  newwin.focus();
}

function popupExternal(url){
  newwin = window.open(url, "winpopup3","WIDTH=760,HEIGHT=450,scrollbars,");
  newwin.focus();
}

function popupSiteMap(url){
  newwin = window.open(url, "winpopup4","WIDTH=690,HEIGHT=520");
  newwin.focus();
}

function popupChannel(url, scroll){
  var scrollable;
  (scroll && macbug)? scrollable=",SCROLLBARS=yes": scrollable="";
  (scroll && !macbug)? scrollable=",SCROLLBARS": scrollable="";
  newwin = window.open(url, "winpopupch","WIDTH=470,HEIGHT=270" + scrollable);
  newwin.focus();
}

/*
clearStatusBar();
function clearStatusBar()
{
window.status = " ";
setTimeout("clearStatusBar()", 1);
}
*/

function WM_netscapeCssFix() {
  // This part was inspired by Matthew_Baird@wayfarer.com
  // It gets around another unfortunate bug whereby Netscape
  // fires a resize event when the scrollbars pop up. This
  // checks to make sure that the window's available size
  // has actually changed.
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape
  // in use contains the bug; if so, it records the window's
  // width and height and sets all resize events to be handled
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}

WM_netscapeCssFixCheckIn()

