var type;	
function callajax(pUrl)

	{



		xmlHttp=GetXmlHttpObject()

		if (xmlHttp==null)

		{

			alert ("Browser does not support HTTP Request");

			return;

		}

		var url="includes/CAjax.php";

		url=url+pUrl;





		xmlHttp.onreadystatechange=stateChanged;

		xmlHttp.open("GET",url,true);

		xmlHttp.send(null);

	}



	function stateChanged()
	{
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{	
			if(xmlHttp.responseText!=0)
			{	
				document.getElementById('upcoming_events').style.display='';			
				document.getElementById('upcoming_events').innerHTML=xmlHttp.responseText;
				document.getElementById('upcoming_seminar').style.display='none';
				document.getElementById('upcoming_webinar').style.display='none';
				//var xx = 'upcoming_' + type;alert(xx);
				//document.getElementById(xx).innerHTML=xmlHttp.responseText;
			}
		}
	}



	function GetXmlHttpObject()

	{

		var objXMLHttp=null;



		if (window.ActiveXObject)

		objXMLHttp=new ActiveXObject("Msxml2.XMLHTTP");

		else if (window.XMLHttpRequest != "undefined")

		objXMLHttp=new XMLHttpRequest();



		return objXMLHttp;

	}





    function showNextSeminars(pOp,pPreDate,pCurDate,pDir,type)

	{
		type=type;

		xmlHttp=GetXmlHttpObject()



		if (xmlHttp==null)

		{

			alert ("Browser does not support HTTP Request");

			return;

		}





		var url="celtemAdmin/includes/CAjax.php";

		url=url+"?strPageOp="+pOp+"&strCurDate="+pCurDate+"&strPreDate="+pPreDate+"&strDir="+pDir+"&type="+type;

		/*

		document.form1.method   = 'POST';

		document.form1.action   = "index.php";

		document.form1.submit();

		*/



		xmlHttp.onreadystatechange=stateChanged;

		xmlHttp.open("GET",url,true);

		xmlHttp.send(null);

	}







	function IsNumericField ( pObj,pCtr )

	{

		if(parseInt(pObj.value,10) < 0 || !IsNumeric(pObj.value))

		{

			alert("Please enter valid item");

			document.getElementById(pCtr).focus();

		}

	}



	function IsNumeric(sText)

	{

	   var ValidChars = "0123456789";

	   var IsNumber=true;

	   var Char;





	   for (i = 0; i < sText.length && IsNumber == true; i++)

	      {

	      Char = sText.charAt(i);

	      if (ValidChars.indexOf(Char) == -1)

	         {

	         IsNumber = false;

	         }

	      }

	   return IsNumber;

   }



function showSeminar(pSemId)

{

	document.getElementById('strSemId').value = pSemId;

	document.forms[0].method = "POST";

	document.forms[0].action="EventRegistration.php";

	document.forms[0].submit();	 	

}

//added by sanjeet

function showEvent(pSemId)

{

	document.getElementById('strSemId').value = pSemId;

	document.forms[0].method = "POST";

	document.forms[0].action="EventRegistration.php";

	document.forms[0].submit();	 	

}

function showListing()

{

	//document.getElementById('strSemId').value = pSemId;

	document.forms[0].method = "POST";

	document.forms[0].action="EventContainer2.php";

	document.forms[0].submit();	 	

}
function showListing2()
{
	document.forms[0].method = "GET";
	document.forms[0].action="EventContainer2.php";
	document.forms[0].submit(); 	
}

function showFaculty(pFacultyId)

{

	document.getElementById('strFacultyId').value = pFacultyId;

	document.forms[0].method = "POST";

	document.forms[0].action="faculty_details.php";

	document.forms[0].submit();	 	

}
/*
function PopupMedium()

{

	var url="vsCalendar/index.php";



	win_handle = window.open( url, "", "width=1013,height=800,status=yes,toolbar=no,menubar=no,scrollbars=yes,location=no,resizable=yes,left=0,top=0");

	

	// set the focus to the new window

    win_handle.focus();

}
*/
