function confirm_active($msg, $action, $id, $id2, $id3, $id4) {
	var answer = confirm($msg);
	if (answer){
		$url = "save.php?action="+$action+"&id="+$id+"&rid="+$id2+"&id2="+$id3+"&id3="+$id4;
		window.location = $url;
	}
}


function getXMLHTTP(){ //fuction to return the xml http object
	var xmlhttp=false;	
	try{
		xmlhttp=new XMLHttpRequest();
	} catch(e){
		try {			
			xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e){
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e1){
				xmlhttp=false;
			}
		}
	}
	
	return xmlhttp;
}

function getName(profile, span_area){
	if ((document.myForm.profile.value=='Student') || (document.myForm.profile.value=='Overseas')){
		document.getElementById("profile_value_list").innerHTML = "Profile Value";
	} else { document.getElementById("profile_value_list").innerHTML = ""; }
    var strURL="register.inc.php?profile="+profile;
    var req = getXMLHTTP();
    if(req){
    	req.onreadystatechange = 
			function(){
    			if(req.readyState == 4){
    				if (req.status == 200){
    					document.getElementById('profile_list').innerHTML=req.responseText;
    				} else {
   						alert("There was a problem while using XMLHTTP:\n" + req.statusText);
    				}
    			}
    		}
   		req.open("GET", strURL, true);
    	req.send(null);
    }
}
