﻿function OnFocus(elementId, defaultText)
{ 
   if (document.getElementById(elementId).value == defaultText)
   {
      document.getElementById(elementId).className = "normal";
      document.getElementById(elementId).value = "";
   }
}

function OnBlur(elementId, defaultText)
{
   var textValue = document.getElementById(elementId).value;
   if (textValue == defaultText || textValue.length == 0)
   {
      document.getElementById(elementId).className = "watermark";
      document.getElementById(elementId).value = defaultText;
   }
   else
      document.getElementById(elementId).className = "normal";
}

function addbookmark(url,desc){
	var nonie = 'Sorry, only Internet Explorer supports this method to add a bookmark/favourite\n But please feel free to visit the site\'s home page to add a bookmark manually';
	if(!url || !desc){
		var bookmarkurl		= window.location;
		var bookmarktitle	= document.title;
	}else{
		var bookmarkurl		= url;
		var bookmarktitle	= desc;
	}
	if (window.sidebar) { 
	
		alert('Due to security restrictions placed in Firefox, we are unable to automatically add a bookmark.\nPlease navigate to the home page and press: CTRL+D to add one manually.');
	} else if(document.all){ 
		window.external.AddFavorite(bookmarkurl,bookmarktitle);
	} else {
		alert(nonie);
	}
}

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";   
 }   
}   
window.onload = externalLinks;
