///////////////////////////////////////////
// Site search validator
// Checks for required items in site search
///////////////////////////////////////////

function validateSiteSearchForm(){
	// Set the default error message
	errmsg = "What do you want to search for?";
	if (document.siteSearchForm.siteSearch.value=="" || document.siteSearchForm.siteSearch.value=="enter search"){
		errmsg += "\n\nEnter your keyword(s) in the search box\nat the top of the page.\n\n";
	}
	//Check to see if we added anything to the default error message
	if (errmsg != "What do you want to search for?"){
		alert(errmsg);
		return false;
	}

return true;
}




///////////////////////////////////////////
// Site-wide Form Functions
// Adds focus & blur javascripts to all form elements
///////////////////////////////////////////
pnc_input = [];

window.addEvent('domready',function(){
	var elements = $('siteWrapper').getElements('input[type=text]');
	elements.each(function(el){
		if($defined(el.getProperty('id')))
		{
			var index = el.getProperty('id');

			if(!$defined(pnc_input[index]))
				pnc_input[index] = el.getProperty('value');

			el.addEvent('focus', function(){
				if(el.getProperty('value') == pnc_input[index])
					el.setProperty('value', '');
			});

			el.addEvent('blur', function(){
				if(el.getProperty('value') == '')
					el.setProperty('value', pnc_input[index]);
			});
		}
	});

	/*
	$$('a.video').each(function(el){
		el.addEvent('click',function(event){
			if(el.href.match(/(flv|gif)$/))
			event = new Event(event);
			event.stop();

			var href = el.href.split('.com')[1].split('/');
			href.shift();
			href = href.join('/');

			open_player(el, href, { width: 350, height: 200, params: { wMode: 'opaque' }, vars: {} });
		});
	});
	*/
});