//JavaScript dealing with the popup divs:
document.write("<div id='DivPop'></div>");
var divpop = document.getElementById("DivPop");

function putPopDiv(this_class,this_text)
{
	divpop.className = this_class;
	divpop.innerHTML = this_text;
}

function closePopDiv()
{
	divpop.className = "invisable";
	divpop.innerHTML = '';
}

function putPopDiv1()
{
	divpop.className = "loading";
	divpop.innerHTML = "Loading your settings...";
}

function putPopDiv2()
{
	divpop.className = "loading";
	divpop.innerHTML = "Redirecting...";
}

function putPopDiv3(loc)
{
	var ntext = "Where would you like to be redirected to?";
	ntext = ntext+"</br></br>";
	ntext = ntext+"<center>";
	ntext = ntext+"<input type='button' class='submit-button' onClick='window.location=\"2_admin/index.htm\"' value='Administrator interface'>";
	ntext = ntext+"</center>";
	ntext = ntext+"</br>";
	ntext = ntext+"<center>";
	ntext = ntext+"<input type='button' class='submit-button' onClick='window.location=\""+loc+"\"' value='Teacher interface'>";
	ntext = ntext+"</center>";
	
	divpop.className = "loaded";
	divpop.innerHTML = ntext;
}

function putPopDiv4()
{
	divpop.className = "ms_validating";
	divpop.innerHTML = "Checking this marksheet...";
	divpop.innerHTML = divpop.innerHTML+"<br><br><br><br><br><br><i>Depending on the amount of students and allocated LOs and ASs this could take up to 2 minutes to complete</i>";
}

function putPopWarn(mess)
{alert(mess);
	var ntext = mess;
	ntext = ntext+"</br></br>";
	ntext = ntext+"<center>";
	ntext = ntext+"<input type='button' class='submit-button' onClick='return true' value='Yes, delete it'>";
	ntext = ntext+"</center>";
	ntext = ntext+"</br>";
	ntext = ntext+"<center>";
	ntext = ntext+"<input type='button' class='submit-button' onClick='return false' value='No, do not delete it'>";
	ntext = ntext+"</center>";
	
	divpop.className = "loaded";
	divpop.innerHTML = ntext;
}

function putPopSave(mess)
{
	var ntext = mess;
	ntext = ntext+"</br></br>";
	ntext = ntext+"<center>";
	ntext = ntext+"<input type='button' class='submit-button' onClick='return true' value='Yes, save this Marksheet'>";
	ntext = ntext+"</center>";
	ntext = ntext+"</br>";
	ntext = ntext+"<center>";
	ntext = ntext+"<input type='button' class='submit-button' onClick='return false' value='No, do not save this Marksheet'>";
	ntext = ntext+"</center>";
	
	divpop.className = "loaded";
	divpop.innerHTML = ntext;
}

function putPopMS()
{
	divpop.className = "div_ms";
	var ntext = "";
	ntext = ntext+"</br></br>";
	ntext = ntext+"<fieldset>";
	ntext = ntext+"<legend>Some value | Some other value</legend>";
	ntext = ntext+"some text";
	ntext = ntext+"</fieldset>";	
}

function putPopProgress(prog,mess)
{
	if(document.getElementById('pgbar_green'))
	{
		document.getElementById('pgbar_green').style.width = prog;
	}
	else
	{
		divpop.className = "loaded";
		var ntext = "<br>"+mess;
		ntext = ntext+"</br></br></br>";
		ntext = ntext+"<center>";
		ntext = ntext+"<div style='background-image:url(pgbar_red.gif);height:15px;width=200px' align='left'><img src='pgbar_green.gif' width='"+prog+"%' height='15px' id='pgbar_green'></div>";
		ntext = ntext+"</center>";
		divpop.innerHTML = ntext;
		divpop.focus();
	}
}