window.onload = init;

function init() {
  resizeIframe();
}

function resizeIframe() {
  if (navigator.appName == "Netscape" && document.getElementById("iframe")) {
    document.getElementById("iframe").height = window.screen.availHeight;
  }
}

function goBack() {
  history.go(-1);
}

function openWin(url,height,width) {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	if (!width)
	  width = 452;
	window.open(url,"_blank","fullscreen=0,width=" + width + ",height=" + height +",left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,location=0");
}

function openEmail(height,width) {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	if (!width)
	  width = 452;
	url = "e-mail-pop-up.aspx?link=" + document.location.href;
	window.open(url,"_blank","fullscreen=0,width=" + width + ",height=" + height +",left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,location=0");
}

function openWindow(url,name,width,height,top,left,center) {
  parameters = "fullscreen=0,toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=0,location=0"
  if (width)
    parameters += ",width=" + width
  if (height)
    parameters += ",height=" + height
  if (center) {
    //alert(navigator.appName);
    if (window.top.screenX) {
      x = window.top.screenX;
      y = window.top.screenY;
      w = window.top.outerWidth;
      h = window.top.outerHeight;
    } else {
      x = window.top.screenLeft;
      y = window.top.screenTop;
      w = window.top.document.body.offsetWidth;
      h = window.top.document.body.offsetHeight;
    }
    //alert(x + " " + w + "\n" + y + " " + h);
    left = Math.floor(x + ((w - width) / 2));
    top = Math.floor(y + ((h - height) / 2));
  }
  if (top)
    parameters += ",top=" + top;
  if (left)
    parameters += ",left=" + left;
  return window.open(url,name,parameters);
}


function printPage(isIframe) 
{
  if( document.getElementById( 'iframe' ) )
  {
     isIframe = true;
  }

  if (isIframe) 
  {
    parent.myIframe.focus();
    window.print();
  } 
  else 
  {
    window.print();
  }
}

function showHelp(id,height,width) {
	xpos = window.screenLeft+40;
	ypos = window.screenTop+40;
	if (!width)
	  width = 420;
	if (!height)
	  height = 300;
	window.open("/showhelp.asp?ID=" + id,"_blank","fullscreen=0,width=" + width + ",height=" + height +",left=" + xpos + ",top=" + ypos + ",toolbar=0,resizable=0,directories=0,status=0,menubar=0,scrollbars=1,location=0");
}