//	OPEN EXTERNAL LINKS IN A NEW WINDOW
	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"; 
		} 
	} 

//	ACTIVATE THE SEARCH CRITERIA FIELD
	function search_focus() {
		var criteria = document.getElementById('q').value;
		if ( criteria == 'Search' ) {
			document.getElementById('q').value = '';
		} else {
			return true;
		}	
	}

//	DEACTIVATE THE SEARCH CRITERIA FIELD
	function search_blur() {
		var criteria = document.getElementById('q').value;
		if ( criteria == '' ) {
			document.getElementById('q').value = 'Search';
		} else {
			document.getElementById('q').value = criteria;
		}
	}

//	ADD PAGE TO FAVOURITES
	function setBookmark(url,str){
		if(str=='')str=url;
		if (document.all)window.external.AddFavorite(url,str);
		else alert('Sorry, this function only works in Internet Explorer.\n\nPlease press CTRL and D to add a bookmark to \n"'+str+'".');
	}

//	limit number of characters in a textarea field
	function limit_characters( limit_field, limit_count_field, limit_num ) {
		var limit_field = document.getElementById(limit_field);
		var limit_count_field = document.getElementById(limit_count_field);
		if ( limit_field != undefined ) {
			if ( limit_field.value.length > limit_num ) {
				limit_field.value = limit_field.value.substring( 0, limit_num );
			} else {
				limit_count_field.innerHTML	= (limit_num - limit_field.value.length) + ' characters remaining';
			}		
		}	
	}