function clearMe(formfield){
	if (formfield.defaultValue==formfield.value)
		formfield.value = ""
}

function restoreMe(formfield){
	if (formfield.value == ""){
		formfield.value = formfield.defaultValue;
	}
};

// Writes out the print and bookmark links, in the top right of the page
function pageTools() {
	var strPrintLink ='';
	var strFavLink ='';
	if (window.print) strPrintLink = strPrintLink + '<a href="#" class="print" onclick="window.print();">Print</a> ';
    // IE Bookmark
    if (window.external && !window.sidebar) strFavLink = strFavLink + '<a class="bookmark" href="#" onclick="window.external.AddFavorite(location.href, document.title);return false;">Bookmark page</a> ';
    // Gekko bookmark
    if (window.sidebar) strFavLink = strFavLink + '<a class="bookmark" href="#" onclick="window.sidebar.addPanel(document.title, location.href, \'\');return false;">Bookmark page</a> ';
	if(document.getElementById('pagetools')) {
		var objPageTools = document.getElementById('pagetools');
		// If we've managed to add anything to the string
		if (strPrintLink.length > 0 || strFavLink.length > 0) objPageTools.innerHTML = strPrintLink + ' ' + strFavLink;
	}
	// For the footer links
	if(document.getElementById('booklink')) {
		var objBookLink = document.getElementById('booklink');
		// If we have a bookmark link
		if(strFavLink.length > 0) objBookLink.innerHTML = strFavLink;
	}
}


// Converts links with an attribute of rel="external" to target="_blank"
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";
     anchor.title = "This link will open in a new window.";
  }
 }
}

