<!--

/**  Function: null clearInput(ele, val)
*    ---------------------------------------------------------------- 
*    Purpose:           clear an input
*    Arguments:         ele			- str, the name of the element to clear
*						val			- str, the default value that should be cleared
*    Returns/Assigns:   none
*/

function clearInput(ele, val){
	if(ele.value == val){
		ele.value='';
	}
}


/**  Function: null openWin(windowURL, windowName, windowFeatures)
*    ---------------------------------------------------------------- 
*    Purpose:           opens a new window and sets its properties
*    Arguments:         windowURL			- str, the url
*						windowName			- str, the window name
*						windowFeatures		- str, the features of the window
*    Returns/Assigns:   none
*/

function openWin(windowURL, windowName, windowFeatures){
	window.open(windowURL, windowName, windowFeatures);
}


/**  Function: null writeEmail(user, domain, subject, text)
*    ---------------------------------------------------------------- 
*    Purpose:           writes an email address in a mailto link
*						if no 'text' is supplied it just writes the <a href="mailto:user@domain">
*						if 'text' is supplied it writes <a href="mailto:user@domain">text</a>
*						if 'subject' is supplied it writes <a href="mailto:user@domain?subject=subject">text</a>
*    Arguments:         user			- str, the username for the email address
*						domain			- str, the domain name of the email address
*						subject			- str, any subject line required
*						text			- str, text for the link
*    Returns/Assigns:   writes a mailto link
*/

function writeEmail(user, domain, subject, text){
	// open up a mailto and combine the user and domain into an email address
	document.write('<a href="mailto:' + user + '@' + domain);
	if(subject){
		// if there's a subject tack it on
		document.write('?subject=' + subject);
	}
	document.write('">');
	if(text){
		// if there's text for the link add it and close the link
		document.write(text + '</a>');
	}
}


/**  Function: null addToFavourites()
*    ---------------------------------------------------------------- 
*    Purpose:           add a link or text for adding to favourites
*    Arguments:         none
*    Returns/Assigns:   writes html to screen
*/

function addToFavourites(){
	if(document.all){
		document.write('<a href="javascript:window.external.AddFavorite(document.location.href, document.title);" class="book">Bookmark</a>'); 
	} else{ 
		document.write('<span class="book">Press Ctrl+D to bookmark</span>');
	}
}

// -->