
function setMinimumContentDivHeight(){
	/* Sets the minimum contentDiv height if a page doesn't have enough content to push the footer to the bottom of the window. (bottom is based on a resolution of 1600*1200) */
	document.getElementById('contentDiv').style.height = "730px"; /* Note: Use single quotes in the getElementById method double quotes don't seem to work (in this case?) */
}

/*
function setMinimumContentDivHeight(e){
	//Works on id's aswell as classes
	e.style.backgroundColor = "red";
}
*/

function drawDarkerBorderColor(e){
	e.style.borderColor = "#736F6E";
	e.style.color = "#736F6E";
}

function drawDefaultBorderColor(e){
	e.style.borderColor = "#adadad";
	e.style.color = "#adadad";
}

function toggleTableBorder(){
		
		if(document.getElementById('handsetDiv').className == 'handsetDiv'){
			
			document.getElementById('handsetDiv').setAttribute('class', 'handsetDiv2');		//Firefox
			document.getElementById('handsetDiv').setAttribute('className', 'handsetDiv2'); //IE --> IE does not recognize the class element. For ie it's called className.
			//document.getElementById('handsetDiv').className = 'handsetDiv2'; //Is also a way of doing it
		}
		else{
			document.getElementById('handsetDiv').setAttribute('class', 'handsetDiv');		//Firefox
			document.getElementById('handsetDiv').setAttribute('className', 'handsetDiv'); 	//IE --> IE does not recognize the class element. For ie it's called className.
		}	
}


//AJAX function
function loginForm(variable1){
 
		var myRequestObject_loginForm = null; 

		document.getElementById("loginForm").innerHTML="<span style='color:white;'>Started...</span>";
 
		if (window.XMLHttpRequest)
		{
 			myRequestObject_loginForm = new XMLHttpRequest();
		} 
		else if (window.ActiveXObject) 
		{
			try 
			{
				myRequestObject_loginForm = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e)
			{
				try 
				{
					myRequestObject_loginForm = new ActiveXObject("Microsoft.XMLHTTP");
				} 
				catch (e) {}
			}
	    }


		myRequestObject_loginForm.onreadystatechange = function()
		{ 
			document.getElementById("loginForm").innerHTML="<span style='color:white;'>Wait server...</span>";
			if(myRequestObject_loginForm.readyState == 4)
			{
				if(myRequestObject_loginForm.status == 200)
				{
					// process a document here
					document.getElementById("loginForm").innerHTML = "<span style='color:white;'>Processing file...</span>"
										
					document.getElementById("loginForm").innerHTML = myRequestObject_loginForm.responseText;

				}	
				else	
				{
					document.ajaxForm.myDynamicTextField2.value="<span style='color:white;'>Error: returned status code " + myRequestObject_loginForm.status + " " + myRequestObject_loginForm.statusText + "</span>";
				}	
			} 
		}; 
		
		myRequestObject_loginForm.open("GET", "/login.php"+variable1, true); 
		myRequestObject_loginForm.send(null);
		
} 

function showOverlay(helpTopicNr){
	
	var node0;
	var node1;
	var node2;
	var node3;
	
	if (document.getElementById)
    {
		node0 = document.getElementById('html');
		node1 = document.getElementById('transparantOverlay');
		node2 = document.getElementById('helpTopicContainer');
		node3 = document.getElementById('helpTopic'+helpTopicNr);
		
	}
	else if (document.all)	//When making a cross-browser javascript application  and trying to reference an object in the DOM one can't be sure document.getElementById will be supported by the browser. So then one can check if document.all is true and use that to reference objects in the DOM.
	{
		node0 = document.all['html'];
		node1 = document.all['transparantOverlay'];
		node2 = document.all['helpTopicContainer'];
		node3 = document.all['helpTopic'+helpTopicNr];		
	}
	else if (document.layers)	
	{
		node0 = document.layers['html'];
		node1 = document.layers['transparantOverlay'];
		node2 = document.layers['helpTopicContainer'];
		node3 = document.layers['helpTopic'+helpTopicNr];
		
	}

	node0.style.overflowY = "hidden";
	node1.style.display = "block";
	node2.style.display = "block";
	node3.style.display = "block";
}

function hideOverlay(){

	var node0;
	var node1;
	var node2;
	var node3;	
	
	if (document.getElementById)
    {
		node0 = document.getElementById('html');
		node1 = document.getElementById('transparantOverlay');
		node2 = document.getElementById('helpTopicContainer');		
	}
	else if (document.all)	//When making a cross-browser javascript application  and trying to reference an object in the DOM one can't be sure document.getElementById will be supported by the browser. So then one can check if document.all is true and use that to reference objects in the DOM.
	{	
		node0 = document.all['html'];
		node1 = document.all['transparantOverlay'];
		node2 = document.all['helpTopicContainer'];			
	}
	else if (document.layers)	
	{
		node0 = document.layers['html'];
		node1 = document.layers['transparantOverlay'];
		node2 = document.layers['helpTopicContainer'];		
	}
	
	node0.style.overflowY = "scroll";
	node1.style.display = "none";
	node2.style.display = "none";
	
	for(i=1; i<=1; i++){ //Iterate through all helpTopicNr'ed elements and set their display proprty to none. "i" needs to be adjusted according to the number of help topics that exist in overlays.php .
	
		if (document.getElementById)
		{				
			node3 = document.getElementById('helpTopic'+i);		
		}
		else if (document.all)	//When making a cross-browser javascript application  and trying to reference an object in the DOM one can't be sure document.getElementById will be supported by the browser. So then one can check if document.all is true and use that to reference objects in the DOM.
		{		
			node3 = document.all['helpTopic'+i];		
		}
		else if (document.layers)	
		{		
			node3 = document.layers['helpTopic'+i];		
		}
		
		node3.style.display = "none";		
	}	
}


