function tabover(tabSet,tab) {
	
	var color = "transparent"
	var overColor = "url('graphics/tab.jpg') no-repeat scroll right top"
	var textColor = "black"
	var overTextColor = "black"
	
	document.getElementById("ts"+tabSet+"c1").style.display = "none";
	document.getElementById("ts"+tabSet+"t1").style.background = color;
	document.getElementById("ts"+tabSet+"t1").style.color = textColor;
	document.getElementById("ts"+tabSet+"c2").style.display = "none";
	document.getElementById("ts"+tabSet+"t2").style.background = color;
	document.getElementById("ts"+tabSet+"t2").style.color = textColor;
	document.getElementById("ts"+tabSet+"c3").style.display = "none";
	document.getElementById("ts"+tabSet+"t3").style.background = color;
	document.getElementById("ts"+tabSet+"t3").style.color = textColor;
	document.getElementById("ts"+tabSet+"c4").style.display = "none";
	document.getElementById("ts"+tabSet+"t4").style.background = color;
	document.getElementById("ts"+tabSet+"t4").style.color = textColor;
	document.getElementById("ts"+tabSet+"c5").style.display = "none";
	document.getElementById("ts"+tabSet+"t5").style.background = color;
	document.getElementById("ts"+tabSet+"t5").style.color = textColor;
	document.getElementById("ts"+tabSet+"c6").style.display = "none";
	document.getElementById("ts"+tabSet+"t6").style.background = color;
	document.getElementById("ts"+tabSet+"t6").style.color = textColor;
	document.getElementById("ts"+tabSet+"c7").style.display = "none";
	document.getElementById("ts"+tabSet+"t7").style.background = color;
	document.getElementById("ts"+tabSet+"t7").style.color = textColor;
	
	document.getElementById("ts"+tabSet+"c"+tab).style.display = "block";
	document.getElementById("ts"+tabSet+"t"+tab).style.background = overColor;
	document.getElementById("ts"+tabSet+"t"+tab).style.color = overTextColor;
	
}

function ActivateSearch() {
	
	 document.getElementById('searchbox').style.color = "black"; // Color of Search box text when clicked
	 document.getElementById('searchbox').value = "";
	 
}

function DeActivateSearch() {
	
	if (document.getElementById('searchbox').value == "") {
	 	document.getElementById('searchbox').style.color = "gray"; // Color of Search box text when unclicked
	 	document.getElementById('searchbox').value = "Search SDMS";
	}
	
}
	 
function slideshowStart() {

	$('.slideshow').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

}	 
	 
function testimonials() {
	 
	var tests = new Array();
	tests[0] = "\"<em>In the last Football League inspection we were highly commended by the Football League for our Administration of the Youth Development Programme, this was in no small way due to SDMS software.<\/em>\" <br><strong>Marina Emberson, Portsmouth FC <\/strong>";
	tests[1] = "\"<em>We have been a user of SDMS software for managing Schools Training since the early 1990s and have progressed through all its versions to the very latest. We have now completed a Schools Pilot of SDMS V e-Training and in the coming months are rolling it out to all Schools. The Pilot has enabled us to iron out issues and to build a basis for extending it to all Schools under our own steam. <\/em>\" <br> <strong> Steve Davies, Neath Port Talbot LEA <\/strong>";
	tests[2] = "\"<em>Since 1994 we have continued to use the various editions of SDMS and used the Staff Development Management System to assist with training administrative functions.   The system has a wide range of functions which record the staffs learning and qualifications for their Continuous Professional Development (CPD) and Registration. It helps the administration team provide statistical data for performance management purposes and is a powerful tool for the effectiveness of learning, training and development activities. <\/em>\" <br> <strong> Lisa Lepley, Cornwall Adult Social Care <\/strong>";
	
	var myRandom = parseInt(Math.random() * 100)
	var a = myRandom % tests.length;
	
	document.getElementById('testimonials').innerHTML = tests[a];
	
}

function show(element) {
	document.getElementById(element).style.display = "block";
}

function hide(element) {
	document.getElementById(element).style.display = "none";
}

function panel(element) {
	
	if (document.getElementById(element).style.display == "none") {
		document.getElementById(element+"Icon").innerHTML = "<img alt=\"Hide\" src=\"graphics/ddDown.jpg\">";
		document.getElementById(element).style.display = "block";
	} else {
		document.getElementById(element+"Icon").innerHTML = "<img alt=\"Expand\" src=\"graphics/ddUp.jpg\">";
		document.getElementById(element).style.display = "none";
	}
	
}

function writeForm() {
	var src = gup('src');
	var det = gup('det');
	var bm = gup('bm');
	src = src+"#"+bm;
	det = det.replace(/%20/gi,' ');
	document.form.redirect.value += src;
	document.form.detail.value = det;
}

function writeUserGroupForm() {
	var UG = gup('UserGroup');
	var UGD = gup('Date');
	
	UG = UG.replace(/%20/gi,' ');
	document.forms[1].usergroup.value = UG;
	document.forms[1].usergroupdate.value = UGD;
}

function gup(name)
{
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null ) {
        return "";
    } else {
        return results[1];
    }
}

