function showLibrary(theDiv) {
	if(theDiv=="Financ") {
	swapContent('lCInner','6');
	} else {
	swapContent('lCInner','3');
	}
}

function setTabTitle(theSet) {
var fullname = document.getElementById('forenames_' + theSet).value + " " + document.getElementById('surname_' + theSet).value;
var newCode = '<a href="javascript:showForm(\'' + theSet + '\');" title="Edit "' + fullname + '">' + fullname + '</a>';
document.getElementById('formtab' + theSet).innerHTML = newCode;
}
function showForm(theDiv) {
document.getElementById('contact1').style.display = "none";
document.getElementById('contact2').style.display = "none";
document.getElementById('contact3').style.display = "none";
document.getElementById('contact'+theDiv).style.display = "Block";
}

function checkBody() {
var innerHeight = document.getElementById('bsesHeader').style.height;
// alert("The inner body height is: " + innerHeight + "px");
}
function buttonOn(thediv) {
document.getElementById(thediv).style.backgroundPosition = "0px 50px";
}
function buttonOff(thediv) {
document.getElementById(thediv).style.backgroundPosition = "0px 0px";
}

function setHeader(theImage) {
document.getElementById('bsesHeader').style.backgroundImage="url(/assets/template/220-header-" + theImage + ".jpg)";
}
function preFooter(newContent,theDiv) {
var newhtml = document.getElementById(newContent).innerHTML;
document.getElementById(theDiv).innerHTML = newhtml;
// show divs in prefooter
  cn = document.getElementById('buttons').getElementsByTagName('div');
  var liveButton = "none";
  for (var i = 0; i < cn.length; i++) {
    // alert( "Found '" + i + "', with id of='" + cn[i].id + "', class of ='" + cn[i].className + "'" );  
    if ( cn[i].className=="preFooterButtonOn" ) {
      // alert( "So this needs to be turned off! '" + cn[i].id + "'");
      cn[i].className = "preFooterButtonOff";
      }
  }
 // now turn on the relevant one
 document.getElementById('link_' + newContent).className = "preFooterButtonOn";
}


function openSearch() {
var myDiv = document.getElementById('searchDiv');
var divContent = "<form action=\"\" method=\"get\" name=\"searchForm\" class=\"inlineForm\">";
divContent = divContent + "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\">";
divContent = divContent + "<input type=\"text\" name=\"searchFor\" class=\"searchInput\"></td><td valign=\"top\">";
divContent = divContent + "<a href=\"javascript:document.searchForm.submit();\" title=\"Search BSES\"><img src=\"/assets/template/searchGo.jpg\" class=\"searchSubmit\"></a>";
divContent = divContent + "</td></tr></table></form>";
myDiv.style.width = "175px";
myDiv.style.margin = "-2px 6px 0px 6px";
myDiv.innerHTML = divContent;
}
function closeSearch() {
var myDiv = document.getElementById('searchDiv');
divContent = "<a href=\"\" onMouseOver=\"openSearch()\">Search</a>";
myDiv.style.width = "auto";
myDiv.style.margin = "0px 6px 0px 6px";
myDiv.innerHTML = divContent;
}
