function changeActivity(thisId)
{
	var myId;
	setPreloadPage()
	if(thisId == ""){
		//myId = activitySelect.value;
	}else{
		//activitySelect.value = thisId;
		myId = thisId;
	}
	http = GetXmlHttpObject();

	if (!http)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	var url="getActivity.php?rand="+getCurrMsec()+"&id="+myId
	if(debug==1){
		url+="&debug=1"
	}
	http.onreadystatechange=handleChangeActivity
	http.open("GET",url,true)
	http.send(null)
} 

function handleChangeActivity() { 
	if (http.readyState==4 || http.readyState=="complete") { 
		//alert(http.responseText);
		var res_array = http.responseText.split("|");
		if (res_array[0] == "0"){
			document.getElementById("activityContent").innerHTML="Error loading activity!";
			clearPreloadPage()
		} else {
			document.getElementById("activityContent").innerHTML=res_array[1];			
			ajaxinclude(res_array[2], "activityContentImage");
			toggle_page('activityLB', 'activityContent', 2)
			ajaxinclude('Components/comment_box/box.php?type=activity&typeid='+res_array[0]+'&quantity=5&submit=true&rand='+getCurrMsec(), "activity_comment_content");
		}
	}
}
// for colouring prizing winner
function displayImage(img, dir) { //v3.0
	if(img != -1) {
		
		document.getElementById("imageArea").innerHTML='<img src="http://www.myccfamily.com/2009/activity/' + dir + '/images/' + img + '.jpg" width="600" height="400" alt="">';
	
		document.getElementById('imageArea').style.visibility='visible';
		
		var pos = (100 * Math.floor(img/4))+500;	
		document.getElementById("imageArea").style.top = pos + "px";
		
	} else {
		document.getElementById('imageArea').style.visibility='hidden';
	}
}
