    var clubwin;
    function popupClubEdit(id) {
	var url = 'clubEdit.asp?id=' + id + '&popup=1';
	if (clubwin && clubwin.open && !clubwin.closed) {
	  //bring window to top and load page
	  clubwin.focus();
	  clubwin.location.href = url;
	} else {
	  //open window
	  var w = 295;
	  var h = 500;
	  var winx = 10;
	  var winy = 10;
	  clubwin = window.open(url, 'editwindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    var newsEditWindow;
    function popupNewsEdit(newsid) {
	var url = 'newsEdit.asp?id=' + newsid + '&popup=1';
	if (newsEditWindow && newsEditWindow.open && !newsEditWindow.closed) {
	  //bring window to top and load page
	  newsEditWindow.focus();
	  newsEditWindow.location.href = url;
	} else {
	  //open window
	  var w = 278;
	  var h = 435;
	  var winx = 10;
	  var winy = 10;
	  newsEditWindow = window.open(url, 'newsEditWindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    var playerEditWindow;
    function popupPlayerEdit(playerid) {
	var url = 'playeredit.asp?id=' + playerid + '&popup=1';
	if (playerEditWindow && playerEditWindow.open && !playerEditWindow.closed) {
	  //bring window to top and load page
	  playerEditWindow.focus();
	  playerEditWindow.location.href = url;
	} else {
	  //open window
	  var w = 295;
	  var h = 485;
	  var winx = 10;
	  var winy = 10;
	  playerEditWindow = window.open(url, 'playerEditWindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    var contactEditWindow;
    function popupcontactEdit(userid) {
	var url = 'useredit.asp?id=' + userid + '&popup=1';
	if (contactEditWindow && contactEditWindow.open && !contactEditWindow.closed) {
	  //bring window to top and load page
	  contactEditWindow.focus();
	  contactEditWindow.location.href = url;
	} else {
	  //open window
	  var w = 280;
	  var h = 600;
	  var winx = 10;
	  var winy = 10;
	  contactEditWindow = window.open(url, 'contactEditWindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    var htmlEditFromNewsWindow;
    function popupEditHtmlFromNews(fieldID, htmlID) {
	var theurl = '../_htmlEdit.asp?fieldID=' + fieldID + '&htmlID=' + htmlID + '&popup=1';
	if (htmlEditFromNewsWindow && htmlEditFromNewsWindow.open && !htmlEditFromNewsWindow.closed) {
	  //bring window to top and load page
	  htmlEditFromNewsWindow.focus();
	  htmlEditFromNewsWindow.location.href = theurl;
	} else {
	  //open edit window immediately to the right of this window
	  var w = 680;
	  var h = 565;
	  var winx = window.screenLeft+document.body.clientWidth+6;
	  var winy = window.screenTop-22;
	  htmlEditFromNewsWindow = window.open(theurl, 'htmlEditFromNewsWindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    var htmlEditWindow;
    function popupEditHtml(docURL) {
	var url = '../_htmlEdit.asp?docurl=' + docURL + '&popup=1';
	if (htmlEditWindow && htmlEditWindow.open && !htmlEditWindow.closed) {
	  //bring window to top and load page
	  htmlEditWindow.focus();
	  htmlEditWindow.location.href = url;
	} else {
	  //open edit window in top left corner
	  var w = 680;
	  var h = 610;
	  var winx = 30;	//window.screenLeft+document.body.clientWidth+6;
	  var winy = 30;	//window.screenTop-22;
	  htmlEditWindow = window.open(url, 'htmlEditWindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

      var eventEditWindow;
      function popupEventEdit(id, eventtypeidtoshow) {
	var url = 'eventEdit.asp?id=' + id + '&ft=' + eventtypeidtoshow + '&popup=1';
	if (eventEditWindow && eventEditWindow.open && !eventEditWindow.closed) {
	  //bring window to top and load page
	  eventEditWindow.focus();
	  eventEditWindow.location.href = url;
	} else {
	  //open window
	  var w = 330;
	  var h = 360;
	  var winx = getCookieOrSet('popup_event_edit_x', 10);
	  var winy = getCookieOrSet('popup_event_edit_y', 10);
	  eventEditWindow = window.open(url, 'eventEditWindowdow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
      }

      var editPagewin;
      function popupPageEdit(id, sectionid) {
	var url = 'pageEdit.asp?id=' + id + '&popup=1';
	if (editPagewin && editPagewin.open && !editPagewin.closed) {
	  //bring window to top and load page
	  editPagewin.focus();
	  editPagewin.location.href = url;
	} else {
	  //open window
	  var w = 246;
	  var h = 570;
	  var winx = 10;
	  var winy = 10;
	  editPagewin = window.open(url, 'editPagewindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
      }


    function initpage() {
	setTimeout('checkOpener()', 5000);
    }

    // if opener has closed, close this  window
    function checkOpener() {
	if (!opener || opener.closed)
	  window.close();
	Else
	 setTimeout('checkOpener()', 5000);
    }


      var yeareditwin;
      function popupYearEdit(yr) {
	var url = 'yearEdit.asp?yr=' + yr + '&popup=1';
	if (yeareditwin && yeareditwin.open && !yeareditwin.closed) {
	  //bring window to top and load page
	  yeareditwin.focus();
	  yeareditwin.location.href = url;
	} else {
	  //open window
	  var w = 295;
	  var h = 440;
	  var winx = 10;
	  var winy = 10;
	  yeareditwin = window.open(url, 'editwindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
      }

    var skinEditWindow;
    function popupSkinEdit(skinfile) {
	var url = 'cmPodSkinEdit.asp?f=' + skinfile;
	if (skinEditWindow && skinEditWindow.open && !skinEditWindow.closed) {
	  //bring window to top and load page
	  skinEditWindow.focus();
	  skinEditWindow.location.href = url;
	} else {
	  //open window
	  var w = 278;
	  var h = 420;
	  var winx = getCookieOrSet('popup_skin_edit_x', 10);
	  var winy = getCookieOrSet('popup_skin_edit_y', 10);
	  skinEditWindow = window.open(url, 'skinEditWindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    var settingEditWindow;
    function popupSettingEdit(id, valueType) {
	var url = 'settingsEdit.asp?id=' + id + '&vt=' + valueType;
	if (settingEditWindow && settingEditWindow.open && !settingEditWindow.closed) {
	  //bring window to top and load page
	  settingEditWindow.focus();
	  settingEditWindow.location.href = url;
	} else {
	  //open window
	  var w = 278;
	  var h = 180;
	  var winx = getCookieOrSet('popup_setting_edit_x', 10);
	  var winy = getCookieOrSet('popup_setting_edit_y', 10);
	  settingEditWindow = window.open(url, 'settingEditWindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    var leagueeditwin;
    function popupLeagueEdit(id) {
	var url = 'leagueEdit.asp?id=' + id + '&popup=1';
	if (leagueeditwin && leagueeditwin.open && !leagueeditwin.closed) {
	  //bring window to top and load page
	  leagueeditwin.focus();
	  leagueeditwin.location.href = url;
	} else {
	  //open window
	  var w = 285;
	  var h = 155;
	  var winx = 10;
	  var winy = 10;
	  leagueeditwin = window.open(url, 'leagueeditwindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }

    function getCookieOrSet(cookieName, val) {
	if (getCookieValue2(cookieName) != '')
	  return getCookieValue2(cookieName);
	else
	  return val;
    }

    function getCookieValue2(cookieName) {
      var search, cookieValue;
      cookieValue = "";
      search = cookieName + "=";
      offset = document.cookie.indexOf(search);
      if (offset != -1) {
        offset += search.length;
        end = document.cookie.indexOf(";", offset);
        if (end == -1)
          end = document.cookie.length;
          cookieValue = unescape(document.cookie.substring(offset, end));
      }
      return cookieValue;
    }

    var divisionWin;
      function popupdivEdit(id) {
	var url = 'divEdit.asp?id=' + id + '&popup=1';
	if (divisionWin && divisionWin.open && !divisionWin.closed) {
	  //bring window to top and load page
	  divisionWin.focus();
	  divisionWin.location.href = url;
	} else {
	  //open window
	  var w = 295;
	  var h = 200;
	  var winx = 10;
	  var winy = 10;
	  divisionWin = window.open(url, 'editwindow', 'scrollbars=no,toolbar=no,menubar=no,location=no,height=' + h + ',width=' + w + ',left=' + winx + ',top=' + winy);
	}
    }