//functions.js
//Create a boolean variable to check for a valid IE instance.
var xmlhttp = false;

//Check if we are using IE.
try {
//If the javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using IE.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}

function showSpan(theNumber) {
for(var i=1; i<7; i++){
		var theOffID="menu" + i;
		document.getElementById(theOffID).style.display='none';
		document.getElementById("btn" + i).style.backgroundColor='#f0f0f0';
		document.getElementById("btn" + i).style.color='black';
	}
/*
document.getElementById("menu2").style.display='block';
var arr = new Array();
arr = document.getElementsByTagName("span");
var theCount=0;
 for(var i=0; i < arr.length; i++){
	if (document.getElementsByTagName("span").item(i).title=="menu"){
		theCount=theCount+1;
		var theOffID="menu" + theCount;
		document.getElementById(theOffID).style.display='none';
		document.getElementById("btn" + theCount).style.backgroundColor='#f0f0f0';
		document.getElementById("btn" + theCount).style.color='black';
	}
}
var theOnID="menu" + theNumber;
//document.getElementById("menu3").style.display='block';
document.getElementById("btn" + theNumber).style.backgroundColor='rgb(4,53,52)';
document.getElementById("btn" + theNumber).style.color='yellow';
*/
var theOnID="menu" + theNumber;
document.getElementById("btn" + theNumber).style.backgroundColor='rgb(4,53,52)';
document.getElementById("btn" + theNumber).style.color='yellow';
document.getElementById(theOnID).style.display='block';

}

function monthView(theID){
//alert("hi");
xmlhttp.open("GET", "calendarMonthly.php");
document.getElementById([theID]).innerHTML="<span style='color:black;'>Loading...</sapn>";
xmlhttp.onreadystatechange = function() {

if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById([theID]).innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
}

function getText(theID){
//alert("hi");
switch(theID){
case 1:
    var theFile="Include/home1.php";
    break;
case 2:
    var theFile="Include/home2.php";
    break;
case 3:
    var theFile="Include/home3.php";
    break;
case 4:
    var theFile="Include/home4.php";
    break;
}
xmlhttp.open("GET", theFile);
xmlhttp.onreadystatechange = function() {

if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("theText").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.send(null);
}

function showHideCalendar(theMonth,operat,theYear) {
if (theMonth<1){
	theMonth=12;
	theYear=theYear-1;
}else if (theMonth>12){
	theMonth=1;
	theYear=theYear+1;
}else{
}
//alert(theMonth);
//The location we are loading the page into.
var objID = "gameCalendar";
var serverPage = "calendarMonthly.php?month=" + theMonth  + "&year=" + theYear;

xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("gameCalendar").innerHTML=xmlhttp.responseText;
//obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}

function clickPic(){
window.open('PlayerOfOct.htm','','toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=600,height=800');


}
