// JavaScript routines for Wessex, Wales and Beyond tour company
// Copyright  © 2004 Mañana Software Ltd. All rights reserved.
var oColor;

function iniPage( id)
{
	var obj;
	obj = null;
	
	if ( document.getElementById)
		obj = document.getElementById(id);
	else if ( document.all)
		obj = document.all.item(id);
	else if ( document.layers)
	{
	}
	
	if ( obj != null)
		obj.style.display='none';
}

function doChanges(revert)
{
	var targ;
	var e;
	
	e = window.event || arguments.callee.caller.arguments[0];
	if ( e.target)
		targ = e.target;
	else if ( e.srcElement)
		targ = e.srcElement;
	if ( targ.nodeType == 3) // defeat Safari bug !?
		targ = targ.ParentNode;
		
	if ( !revert)
	{
		oColor = targ.style.color;
		targ.style.color = "#ffffcc";
//		targ.style.fontWeight="bold";
	}
	else
	{
		targ.style.color = oColor;
		targ.style.fontWeight="normal";
	}
}

function popUp( pageUrl, width, height, scroll)
{
	if ( window.screen)
	{
		lpos = (screen.width/2)-(width/2);
		hpos = (screen.height/2)-(height/2);
	}
	else
	{
		lpos = 1;
		hpos = 1;
	}
	
	eval( window.open( pageUrl, '', 'toolbar=0,scrollbars='+scroll+',location=0,status=0,menubar=0,resizeable=0,width='+width+',height='+height+',left='+lpos+',top='+hpos));
}

function newPopUp( pageUrl, type)
{
	if ( window.screen)
	{
		var imgBigger;
		var w, h;
		
		if ( type == 'L')
		{
			maxW = 800;
			maxH = 600;
		}
		else
		{
			maxW = 600;
			maxH = 800;
		}
		w = screen.availWidth - 100;
		h = screen.availHeight - 100;
		if ( w > maxW)
			w = maxW;
		if ( h > maxH)
			h = maxH;
	
		imgBigger = ( h < 800 || w < 600);
				
		lpos = (screen.availWidth/2)-(w/2);
		hpos = (screen.availHeight/2)-(h/2);
	}
	else
	{
		lpos = 1;
		hpos = 1;
		if ( type == 'L')
		{
			w = 800;
			h = 600;
		}
		else
		{
			h = 800;
			w = 600;
		}
	}
	var s;
	
	s = 'width=' + w + ',height=' + h + ',left=' +lpos +',top=' +hpos;
	s = s + 'toolbar=0,location=0,status=0,menubar=0';
	if ( imgBigger)
		s = s + ',scrollbars=yes,resizable=yes';

	eval( window.open( pageUrl, '', s));
}
