window.addEventListener("load", function() { setTimeout(initialLoad, 100) }, false);
function initialLoad(){
	updateOrientation();	

}
function formHandlerQuick(sel_alphab){
	var value = document.sel_alphab.jumpto.options[document.sel_alphab.jumpto.selectedIndex].value.split("|")[0];
	if (value != "")
	{
		var URL  = "http://www.lwsquared.net/SRDMobile/videos/" + value + ".mp4";
		window.location.href = URL;
	}
}

function updateTerm(){
  var termT  = document.sel_alphab.jumpto.options[document.sel_alphab.jumpto.selectedIndex].value.split("|")[1];
	document.getElementById("term").innerHTML = termT;

}
function scrollTime(time)
{
	setTimeout("window.scrollTo(0, 1)", time);
}

function scrollDown()
{
	document.getElementById("page_wrapper").style.visibility = "visible";
	window.scrollTo(0, 1);
}

function updateOrientation(){
	var contentType = "show_";
	switch(window.orientation){
		case 0:
		contentType += "vertical";
		break;
		
		case -90:
		contentType += "side";
		break;
		
		case 90:
		contentType += "side";
		break;
	}
	document.getElementById("page_wrapper").setAttribute("class", contentType);

	scrollDown();
}
function clearTextBox()
{
	if(document.text_input.term.value=="  Enter search here")
	{
	document.text_input.term.value="";
	}
}
function clearTextBox1()
{
	if(document.text_input1.term.value=="  Enter search here")
	{
	document.text_input1.term.value="";
	}
}
function formHandler(sel_subject){
	var URL = document.sel_subject.jump.options[document.sel_subject.jump.selectedIndex].value;
	window.location.href = URL;
}
function formHandlerA(sel_alpha){
	var URL = document.sel_alpha.jump.options[document.sel_alpha.jump.selectedIndex].value;
	window.location.href = URL;
}
function goToSrch() { window.location = "searchTerm.php?Title="; }
function goToMult() { window.location = "Multiple.php?Title="; }
function goToInstrux() { window.location = "../Instrux/index.php?Title="; }

function toggleMenus()
{
	if (document.getElementById("alphaForm").style.display == "none")
	{
		document.getElementById("alphaForm").style.display = "block";
		document.getElementById("subjectForm").style.display = "block";
		document.getElementById("alphaForm1").style.display = "block";
		document.getElementById("subjectForm1").style.display = "block";
	}
	else 
	{
		document.getElementById("alphaForm").style.display = "none";
		document.getElementById("subjectForm").style.display = "none";
		document.getElementById("alphaForm1").style.display = "none";
		document.getElementById("subjectForm1").style.display = "none";
	}
}
