//Find object function
function findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

//Set text of layers function
function setTextOfLayer(objName,x,newText) { //v4.01
  if ((obj=findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

//Add to favorites function
function addToFaves(){
	var is_4up = parseInt(navigator.appVersion);
	var is_mac   = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
	var is_ie   = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
	var thePage = location.href;
	if (thePage.lastIndexOf('#')!=-1)
		thePage = thePage.substring(0,thePage.lastIndexOf('#'));
	if (is_ie && is_4up && !is_mac) 
		window.external.AddFavorite(thePage,document.title);
	else if (is_ie || document.images)
		booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
	//booker_hp.focus();
	}
	
if (window.name=='booker_'){
	var pre_fix = document.images? '<BR>':'';
	document.write(pre_fix + '<P align="center">'
	+ 'Use the menu or ctrl/cmd-D now <BR>to bookmark the page then <BR>'
	+ '<A href="javascript:window.close();">close this window</A></p>'
	+ '<P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P><P>&nbsp;</P>');
	}

//Open browser window function
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//Print current page function
function printCurrentPage() {
alert("For best printing results, select the landscape option when printing.");
 window.focus();
 window.print();
 }
 
 //Zoom page (text size) function
var currentZoom = 100;

function setNewZoom(newZoom)
{
	if(newZoom >= 50 && newZoom <= 200)
	{
		if(currentZoom != newZoom )
		{
			currentZoom = newZoom;
			document.body.style.zoom=newZoom/100;
			//document.zoomList.zoomSelected.selectedIndex = (newZoom-50)/10;
		}
	}
}
function zoomIn()
{
	setNewZoom(currentZoom+10);
}
function zoomOut()
{
	setNewZoom(currentZoom-10);
}
function zoomChange(selObj)
{
	var newZoom = selObj.options[selObj.selectedIndex].value;
	setNewZoom(parseInt(newZoom));
}
