
	// Object "Locator" script
	// lifted from ImageReady
	function findObj(n, d) {
	 var p,i,x; if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
	 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
	x=d.forms[i][n];
	 for(i=0;!x&&d.layers&&i<d.layers.length;i++)
	x=findObj(n,d.layers[i].document); if(!x&&!document.layers)
	x=document.getElementById(n); return x;
	}
	
	var hidden = (document.layers) ? "hide" : "hidden";
  	var visible = (document.layers) ? "show" : "visible";
	// Object and Object Style Reference script
	// (c) copyright 2001 Braddock Graham
	// Scripts@IntuitionStudio.com
	// please leave the above 3 lines, thanks
	function getObjRef(objId)
	{
		if (document.layers) objRef = findObj(objId);
		else if(document.getElementById) objRef = eval("document.getElementById(\"" + objId + "\")");
		else if(document.all && !document.getElementById) objRef = eval("document." + objId);
		return objRef;
	}
	function getStyRef(objId)
	{
		if(document.layers) styRef = findObj(objId);
		else if(document.getElementById) styRef = eval("document.getElementById(\"" + objId + "\").style");
		else if(document.all && !document.getElementById) styRef = eval("document." + objId + ".style");
		return styRef;
	}
	
// **************** BEGIN -- Pop-Up Window Script
var activeWin = null;
function makeWin(url,name,features) 
{
	agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf('webtv') != -1) 
	{
		window.location.href = url;
	}
	else 
	{
   		if (features) 
		{
			activeWin = window.open(url,name,features);
		}
		else 
		{
			//alert('features is empty');
			features = 'height=550,width=620,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1';
			activeWin = window.open(url,name,features);
		}
		activeWin.focus();
	}
}
// **************** END -- Pop-Up Window Script


// PRINT Funtionality
var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function printPage(frame, arg) {
  if (frame == window) {
    printThis();
  } else {
    link = arg; // a global variable 
    printFrame(frame);
  }
  return false;
}

function printThis() {
  if (pr) { // NS4, IE5
    window.print();
  } else if (da && !mac) { // IE4 (Windows)
    vbPrintPage();
  } else { // other browsers
    if(mac) alert("Please press [ Command + P ] to print this page.")
   else if(!mac) alert("Sorry, your browser doesn't support this feature.");
  }
}

function printFrame(frame) {
  if (pr && da) { // IE5
    frame.focus();
    window.print();
    link.focus();
  } else if (pr) { // NS4
    frame.print();
  } else if (da && !mac) { // IE4 (Windows)
    frame.focus();
    setTimeout("vbPrintPage(); link.focus();", 100);
  } else { // other browsers
    if(mac) alert("Please press [ Command + P ] to print this page.")
   else if(!mac) alert("Sorry, your browser doesn't support this feature.");
  }
}

if (da && !pr && !mac) with (document) {
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

