// JavaScript Document

function insertContact (theName, linkText){
	
	var theDomain = ('nbsc' + '.' + 'co' + '.' + 'uk');
	
	theAddress = (theName + '&#064' + theDomain);
	if(linkText=='me'){
		linkText = theAddress;
	}
	document.write('<a href="mailto:' + theAddress +'">' + linkText + '<\/a>');
}

// Toggles the hidden status of a the given html object
function toggletext(textID, hideArray) {
	var text = document.getElementById(textID);
	
	if(text.className == "hidden") {
		text.className = "";
	} else {
		text.className = "hidden";
	}
	
	for(i=0; i<hideArray.length; i++) {
		var toHideText = document.getElementById(hideArray[i]);
		toHideText.className = "hidden";
	}
}

function displaycase(textid) {
	var case_description = document.getElementById(textid);
	case_description.className = "selected";
}

function hidecase(textid) {
	var case_description = document.getElementById(textid);
	case_description.className = "deselected";
}

/**
 * JavaScript popup window function (from: http://www.quirksmode.org/js/popup.html)
 */
function popitup(url, width, height) {
	newwindow=window.open(url,"name","height=" + height + ",width=" + width + ",scrollbars=1,resizable=1");
	if (window.focus) {newwindow.focus()}
	return false;
}