function printResize(){
 window.resizeTo('800', '600');
}
function getRandom(min, max)
{
   max++;   //add one to the max number specified so that the specified value can actually be returned
   range = max - min;
   now = new Date();
   seed = now.getSeconds();
   randomNumber = Math.random(seed);         //get a random number between 0 & 1
   randomNumber = randomNumber * range;      //convert this to a random number between 0 & range
   roundedNumber = Math.round(randomNumber); //round the number off to an integer (down if less than .5, up if greater than)
   if (roundedNumber == range)
      {roundedNumber = 0;}
   roundedNumber = roundedNumber + min;

   return roundedNumber
}

function showPopupOnce(popupTitle, chance, wUrl, wWindowName, wWidth, wHeight, wTop, wLeft, wDirectories, wLocation, wMenubar, wScrollbars, wStatus, wToolbar, wResizable) {

   if (chance<100)
   {
      num = getRandom(0, 100);
      if (num > chance) return false;
   }

	if (GetCookie("seenpopup" + popupTitle) == 'true') return true;

	var expires = new Date();
	expires.setTime(expires.getTime() + 3E11);

   SetCookie("seenpopup" + popupTitle, true, expires, "");
   openAnyWinTwo(wUrl, wWindowName, wWidth, wHeight, wTop, wLeft, wDirectories, wLocation, wMenubar, wScrollbars, wStatus, wToolbar, wResizable);

	return true;
}

function showPopup(chance, wUrl, wWindowName, wWidth, wHeight, wTop, wLeft, wDirectories, wLocation, wMenubar, wScrollbars, wStatus, wToolbar, wResizable) {

   if (chance<100)
   {
      num = getRandom(0, 100);
      if (num > chance) return false;
   }

   openAnyWinTwo(wUrl, wWindowName, wWidth, wHeight, wTop, wLeft, wDirectories, wLocation, wMenubar, wScrollbars, wStatus, wToolbar, wResizable);
	return true;
}

function SetChildOpenerNull(win)
{
  wind = eval(win);
  wind.opener = null;
}
function openInParent2(url)
{
   if(window.opener && !window.opener.closed){
      var parentWin = window.opener;
      parentWin.location.href = url;
      parentWin.focus();
      window.close();
   } else {
      now = new Date();
      var winName = 'window' + now.getHours() + now.getMinutes() + now.getSeconds();
      openAnyWinTwo(url,winName,800,600,0,0,0,1,1,1,1,1,1);
      window.close();
   }
}
function openAnyWinTwo (wUrl, wWindowName, wWidth, wHeight, wTop, wLeft, wDirectories, wLocation, wMenubar, wScrollbars, wStatus, wToolbar, wResizable)
{
var features= 'width='        + wWidth +
              ',height='      + wHeight +
              ',top='        + wTop +
              ',left='      + wLeft +
              ',directories=' + wDirectories +
              ',location='    + wLocation +
              ',menubar='     + wMenubar +
              ',scrollbars='  + wScrollbars +
              ',status='      + wStatus +
              ',toolbar='     + wToolbar +
              ',resizable='   + wResizable;
window.open (wUrl, wWindowName, features);
}

function openAnyWin (wUrl, wWindowName, wWidth, wHeight, wDirectories, wLocation, wMenubar, wScrollbars, wStatus, wToolbar, wResizable)
{
var features= 'width='        + wWidth +
              ',height='      + wHeight +
              ',directories=' + wDirectories +
              ',location='    + wLocation +
              ',menubar='     + wMenubar +
              ',scrollbars='  + wScrollbars +
              ',status='      + wStatus +
              ',toolbar='     + wToolbar +
              ',resizable='   + wResizable;
window.open (wUrl, wWindowName, features);
}
function writebannerimage(sitetype) {
  if (sitetype == "msf" || sitetype == "msd") {
    bannerurl = statichost + "/images/" + sitetype + "_banner.jpg";
    document.write("<img src='../scripts/%22%20+%20bannerurl%20+%20%22' border=\"0\" width=\"480\" height=\"101\">");
  } else if(sitetype == "nam") {
    bannerurl = statichost + "/images/" + sitetype + "_banner_37by306.gif";
    document.write("<IMG SRC='../scripts/%22%20+%20bannerurl%20+%20%22' border=\"0\" width=\"306\" height=\"37\">");
 }
}

function writeCurve(sitetype) {
   var curveImage = statichost + "/images/" + sitetype + "acd82wide.gif";
   var curveTile = statichost + "/images/" + sitetype + "acd82wide.gif";
   document.write("<td colspan=\"3\" background=\"" + curveTile + "\"><img src=\"" + curveImage + "\" alt=\"\" width=\"409\" height=\"6\"></img></td>");
}

function jumpto2(url) {
	if (url == "" || url == "no_jump") {
	   return;
	}
	top.location = url;
}

