// JavaScript Document
var xmlHttp;

function Update_Cal(month,year)
	{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	var url="mini_cal.php";
	url=url+"?month="+month;
	url=url+"&year="+year;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function mail_list()
	{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Browser does not support HTTP Request");
	  return;
	  }
	var url="mail_list.php";
	xmlHttp.onreadystatechange=stateChanged2;
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send("txtEmail=" + document.getElementById("mail_list").value);
}

function stateChanged2()
{

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	  {
	  document.getElementById("mail_con").innerHTML=xmlHttp.responseText;
	  }
}

function stateChanged()
{

	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	  {
	  document.getElementById("cal_outer_div").innerHTML=xmlHttp.responseText;
	  }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  //Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
} 

// JavaScript Document
function nav_img(element_id, a) {
		if (a == 1) {
			top.document.getElementById(element_id).src = "images/" + element_id + "_on.gif";
		} else if (a == 2) {
			
			//Add a check. If current page do not off
			
			top.document.getElementById(element_id).src = "images/" + element_id + "_off.gif";
		} else {
			document.write(a);
		}
	}
	

