//function to replace target="_blank" which is not xhtml valid
//example <a href="" rel="external"></a>
externalLinks = function () { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
     anchor.getAttribute("rel") == "external") 
     anchor.target="_blank"; 
 } 
} 

//automatically clear default value form fields
//first parameter is a reference to the field (e.g. 'this'), second parameter is the default value (e.g. 'Your name...')
clearForm = function (val,defaultval){
	if(val.value==defaultval){
		val.value="";
	}
}

$(document).ready(function() { 
    externalLinks();
});
