/*
=====================================================
VeriVide
JavaScript utility functions library
=====================================================
*/

// Function to open links to external sites in a new browser window (target attribute not allowed by XHTML 1.0 Strict)
// (c) SitePoint.com 2003 (http://www.sitepoint.com/article/standards-compliant-world/)
function externalLinks() {
 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";
 }
}

// Function to clear a text input field on click (eg search box)
function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

// Function to write default text to a text input field (eg search box)
function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}