/*-------------------------
precastCore.js
Author: Andy Sherman
Client: Precast Solutions
Date: 09/08/09
-------------------------*/

jQuery(document).ready(function() {

	/*-------------------------------------------
	assign new window funct to external links
	-Allows removal of nonstandard target="_blank"
	--------------------------------------------*/
	var extLinks = $('a');
	 for (var i=0; i<extLinks.length; i++) {
	   var extLink = extLinks[i];
	   if ($(extLink).attr("href") && $(extLink).attr("rel") == "external") {
		extLink.target = "_blank";
		}
	 }
	
	/*------------------------------------------------------------------------------------------------
	assign click event to searchInput 
	- !! below replaces clearField() on search field as stopped working as call from html onfocus=
	-----------------------------------------------------------------------------------------------*/
	$('#searchInput').click(function(){
		 if (this.value == this.defaultValue) {
	         this.value = ""
	     }
	});
});

//formField on focus clear
function clearField(inputObj) {
     if (inputObj.value == inputObj.defaultValue) {
         inputObj.value = "";
     }
 }