function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		searchbutton_over = newImage("/images/searchbutton-over.jpg");
		preloadFlag = true;
	}
}


/*
Clear the postal code text field on focus
*/
function clearfield()
	{
	document.forms.search.PC.value='';
	}
	
	/*
Validate the search form entries for postal code and subject
*/

function validate()
	{
	var zip = document.forms.search.PC.value;  
	var subject = document.forms.search.sub.value;
	var flag_zip = false;
	var flag_sub = false;
	document.getElementById('error1').innerHTML = '';
	document.getElementById('error2').innerHTML = '';

	if (zip != null && (zip.length) == 5 && ((zip.indexOf(0) == 0) || (parseInt(zip) == zip)))
	{
		flag_zip = true;
	}	  
		if (subject != 'none' ) 
	{ 
		flag_sub = true;
	}
		   
	if (!(flag_zip))
		clearfield();
		
	if (!(flag_sub))	
		document.getElementById('error2').innerHTML = 'Subject Required';
		
	if (!(flag_sub))
		{return (false)}
	
	else 
		return(true);	
	}	
	
function fbList() {
document.write ('<iframe src="http://www.facebook.com/plugins/like.php?href='+location.href+'&amp;layout=standard&amp;show_faces=true&amp;width=550&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:;margin-left:10px;"></iframe>');
}

function fbButton() {
document.write ('<iframe src="http://www.facebook.com/plugins/like.php?href='+location.href+'&amp;layout=button_count&amp;show_faces=false&amp;width=140&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:140px; height:30px;margin-left:40px;"></iframe>');
}