var oldBG;
var ErrorBackgroundColour = 'Red';
var ErrorTextColour = 'White';
	
function hiLiteRow(obj, cSpec)
{
	oldBG = obj.style.background
	obj.style.background = cSpec;
}

function normaliseRow(obj)
{
	//obj.style.background = '';
	obj.style.background = oldBG;
}

function showImage(url)
{
	var w = 600;
	var h = 360;
	var picWin = window.open(url,'picWin','width=' + w + ',height=' + h + ',scrollbars,resizable');
	picWin.moveTo(screen.width/2-w/2,screen.height/2-h/2);
	picWin.focus();
}

function showImage(url,w,h)
{
	var picWin = window.open(url,'picWin','width=' + w + ',height=' + h + ',scrollbars,resizable');
	picWin.moveTo(screen.width/2-w/2,screen.height/2-h/2);
	picWin.focus();
}

function doPriceGuide()
{
	var w = 720;
	var h = 450;
	var priceWin = window.open('priceGuide.asp','priceWin','width=' + w + ',height=' + h + ',scrollbars,resizable');
	priceWin.moveTo(screen.width/2-w/2,screen.height/2-h/2);
	priceWin.focus();
}

function validateContactForm(theForm)
{
	if (theForm.Name.value == '')
	{
		window.alert('Please fill in your name.');
		errataElement(theForm.Name);
		theForm.Name.focus();
		
		return false;
	}
	else
		deErrataElement(theForm.Name);
	
	if (theForm.Email.value == '')
	{
		window.alert('Please fill in your email address.');
		errataElement(theForm.Email);
		theForm.Email.focus();
		
		return false;
	}
	else
		deErrataElement(theForm.Email);
	
	return true;
}

function errataElement(theElement)
{
	theElement.style.background = ErrorBackgroundColour;
	theElement.style.color = ErrorTextColour;
}

function deErrataElement(theElement)
{
	theElement.style.background = '';
	theElement.style.color = '';
}


