function ajax_update(data, id) {
    var myAjax = new Ajax.Updater(
				id,
        'ajaxsrv.php',
        {method: 'post', parameters: data}
    );
}

function ajax_request(data) {
    var myAjax = new Ajax.Request(
        'ajaxsrv.php',
        {method: 'post', parameters: data}
    );
}

function getElementsByClassName(oElm, strTagName, strClassName){
//alert(oElm+ " : " + strTagName + " : " + strClassName);
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements);
}

function changeImages(id,thissrc){
	var img = document.getElementById(id);
	img.src = thissrc;
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("/iscr/mphtc/images/home-over.gif");
		home_down = newImage("/iscr/mphtc/images/home-down.gif");
		aboutus_home_over = newImage("/iscr/mphtc/images/aboutus-over.gif");
		aboutus_home_down = newImage("/iscr/mphtc/images/aboutus-down.gif");
		courses_home_over = newImage("/iscr/mphtc/images/courses-over.gif");
		courses_home_down = newImage("/iscr/mphtc/images/courses-down.gif");
		career_home_over = newImage("/iscr/mphtc/images/career-over.gif");
		career_home_down = newImage("/iscr/mphtc/images/career-down.gif");
		resources_home_over = newImage("/iscr/mphtc/images/resources-over.gif");
		resources_home_down = newImage("/iscr/mphtc/images/resources-down.gif");
		calendar_home_over = newImage("/iscr/mphtc/images/calendar-over.gif");
		calendar_home_down = newImage("/iscr/mphtc/images/calendar-down.gif");
		help_home_over = newImage("/iscr/mphtc/images/help-over.gif");
		help_home_down = newImage("/iscr/mphtc/images/help-down.gif");
		contactus_home_over = newImage("/iscr/mphtc/images/contactus-over.gif");
		contactus_home_down = newImage("/iscr/mphtc/images/contactus-down.gif");
		preloadFlag = true;
	}
}


function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function IsNumeric(strString)
	 //  check for valid numeric strings	
			{
				 var strValidChars = "0123456789.-";
						var strChar;
							 var blnResult = true;

									if (strString.length == 0) return false;

										 //  test strString consists of valid characters listed above
												for (i = 0; i < strString.length && blnResult == true; i++)
															{
																		strChar = strString.charAt(i);
																					if (strValidChars.indexOf(strChar) == -1)
																									 {
																														blnResult = false;
																																		 }
																																					 }
																																							return blnResult;
																																								 }

