
var Xoffset= -200;        // modify these values to ...  was -60
var Yoffset= 20;        // change the popup position.  was 20
var popwidth=0;       // popup width
var bcolor="darkgray";  // popup border color
var fcolor="black";     // popup font color
var fface="verdana";    // popup font face
var bak="beige";		//popup background color

// create content box
document.write("<DIV ID='pup'><\/DIV>");
// id browsers
var iex=(document.all);
var nav=(document.layers);
var old=(navigator.appName=="Netscape" && !document.layers && !document.getElementById);
var n_6=(window.sidebar);

// assign object
var skin;
if(nav) skin=document.pup;
if(iex) skin=pup.style;
if(n_6) skin=document.getElementById("pup").style;

// park modifier
var yyy=-100;
var xxx=-100

// capture pointer
if(nav)document.captureEvents(Event.MOUSEMOVE);
if(n_6) document.addEventListener("mousemove",get_mouse,true);
if(nav||iex)document.onmousemove=get_mouse;

// set dynamic coords
function get_mouse(e)
{
  var x,y;

  if(nav || n_6) x=e.pageX;
  if(iex) x=event.x+document.body.scrollLeft;

  if(nav || n_6) y=e.pageY;
  if(iex)
  {
    y=event.y;
    if(navigator.appVersion.indexOf("MSIE 4")==-1)
      y+=document.body.scrollTop;
  }

  if(iex || nav)
  {
    skin.top=yyy
    skin.left=xxx;
  }

  if(n_6)
  {
    skin.top= yyy+"px";
    skin.left=xxx+"px";
  }
  nudge(x);
}

// avoid edge overflow
function nudge(x)
{
  var extreme,overflow,temp;

  // right
  if(iex) extreme=(document.body.clientWidth-popwidth);
  if(n_6 || nav) extreme=(window.innerWidth-popwidth);

  if(parseInt(skin.left)>extreme)
  {
    overflow=parseInt(skin.left)-extreme;
    temp=parseInt(skin.left);
    temp-=overflow;
    if(nav || iex) skin.left=xxx;
    if(n_6)skin.left=xxx+"px";
  }

  // left
  if(parseInt(skin.left)<1)
  {
    overflow=parseInt(skin.left)-1;
    temp=parseInt(skin.left);
    temp-=overflow;
    if(nav || iex) skin.left=xxx;
    if(n_6)skin.left=xxx+"px";
  }
}

// write content & display
function popup(msg,popwidth,yoffset,xoffset)
{

  var content="<TABLE WIDTH='"+popwidth+"' BORDER='1' BORDERCOLOR="+bcolor+" CELLPADDING=2 CELLSPACING=0 "+"BGCOLOR="+bak+"><TD ALIGN='left' FONT COLOR="+fcolor+" FACE="+fface+" SIZE='2'>"+msg+"<\/TD><\/TABLE>";

  if(old)
  {
    alert(msg);
    return;
  }

  yyy=yoffset;
  xxx=xoffset;
  skin.width=popwidth;

  if(nav)
  {
    skin.document.open();
    skin.document.write(content);
    skin.document.close();
    skin.visibility="visible";
  }

  if(iex)
  {
    pup.innerHTML=content;
    skin.visibility="visible";
  }

  if(n_6)
  {
    document.getElementById("pup").innerHTML=content;
    skin.visibility="visible";
  }
}


// park content box
function kill()
{
  if(!old)
  {
    yyy=-1000;
    skin.visibility="hidden";
    skin.width=0;
  }
}




//new window for order form
function newWindow(birpup) {
birpupWindow = window.open(birpup,'birWin', 'width=630,height=500,top=40,left=40,status=no,menubar=no,scrollbars=yes,toolbar=no,resizable=yes, fullscreen=yes')
birpupWindow.focus()
}

function helpwindow(helpfile){

	/* initialize variables*/

	/* determine browser */
	var bName = navigator.appName;
	var bVer = parseFloat(navigator.appVersion);

	if (bName == "Netscape") 
		var helpWindow = window.open("http://www.canadianhealthfacilities.com/htmlhelp/" + helpfile, "CH12","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0,copyhistory=0,width=700,height=480, Left=50, top=150,");
	else  
		var helpWindow = window.open("http://www.canadianhealthfacilities.com/htmlhelp/" + helpfile, "CH12","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizeable=0,copyhistory=0,width=700,height=480, Left=50, top=150,");
}
