function test(){
	alert('TEST');	
}	

function rooms(){ 
MM_preloadImages('images/indicator.gif');
 // this function is used to fill the category list on load
	//addOption(document.drop_list.Category, "0", "0", "");
	addOption(document.drop_list.Category, "1", "1", "");
	addOption(document.drop_list.Category, "2", "2", "");
	addOption(document.drop_list.Category, "3", "3", "");
	addOption(document.drop_list.Category, "4", "4", "");
	addOption(document.drop_list.Category, "5", "5", "");
}

function Pesrons(){
// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);
//addOption(document.drop_list.SubCat, "", "0", "");

if(document.drop_list.Category.value == '1'){
	addOption(document.drop_list.SubCat,"1", "1");
	addOption(document.drop_list.SubCat,"2", "2");
	addOption(document.drop_list.SubCat,"3", "3");
}
if(document.drop_list.Category.value == '2'){
	addOption(document.drop_list.SubCat,"2", "2");
	addOption(document.drop_list.SubCat,"3", "3");
	addOption(document.drop_list.SubCat,"4", "4");
	addOption(document.drop_list.SubCat,"5", "5");
	addOption(document.drop_list.SubCat,"6", "6");
	
}
if(document.drop_list.Category.value == '3'){
	addOption(document.drop_list.SubCat,"3", "3");
	addOption(document.drop_list.SubCat,"4", "4");
	addOption(document.drop_list.SubCat,"5", "5");
	addOption(document.drop_list.SubCat,"6", "6");
	addOption(document.drop_list.SubCat,"7", "7");
	addOption(document.drop_list.SubCat,"8", "8");
	addOption(document.drop_list.SubCat,"9", "9");
}

if(document.drop_list.Category.value == '4'){
	addOption(document.drop_list.SubCat,"4", "4");
	addOption(document.drop_list.SubCat,"5", "5");
	addOption(document.drop_list.SubCat,"6", "6");
	addOption(document.drop_list.SubCat,"7", "7");
	addOption(document.drop_list.SubCat,"8", "8");
	addOption(document.drop_list.SubCat,"9", "9");
	addOption(document.drop_list.SubCat,"10", "10");
	addOption(document.drop_list.SubCat,"11", "11");
	addOption(document.drop_list.SubCat,"12", "12");	
}

if(document.drop_list.Category.value == '5'){
	addOption(document.drop_list.SubCat,"5", "5");
	addOption(document.drop_list.SubCat,"6", "6");
	addOption(document.drop_list.SubCat,"7", "7");
	addOption(document.drop_list.SubCat,"8", "8");
	addOption(document.drop_list.SubCat,"9", "9");
	addOption(document.drop_list.SubCat,"10", "10");
	addOption(document.drop_list.SubCat,"11", "11");
	addOption(document.drop_list.SubCat,"12", "12");
	addOption(document.drop_list.SubCat,"13", "13");
	addOption(document.drop_list.SubCat,"14", "14");
	addOption(document.drop_list.SubCat,"15", "15");
}

}

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

function display_desc(){
	alert('test');	
}	

function getXmlHttpRequestObject() {
 if (window.XMLHttpRequest) {
    return new XMLHttpRequest(); //Mozilla, Safari ...
 } else if (window.ActiveXObject) {
    return new ActiveXObject("Microsoft.XMLHTTP"); //IE
 } else {
    alert("Your browser doesn't support the XmlHttpRequest object.");
 }
}

var receiveReq = getXmlHttpRequestObject();

function makeRequest(url, param ) {
	 if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
	   receiveReq.open("POST", url, true);
	   receiveReq.onreadystatechange = updatePage; 
	   receiveReq.send(param);
	 }   
}

function makeRequest1(url, param ) {
	 if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
	   receiveReq.open("POST", url, true);

	   receiveReq.onreadystatechange = updatePage1; 
	   receiveReq.send(param);
	 }   
}

function updatePage() {
	 if (receiveReq.readyState == 4) {
	   document.getElementById('result').innerHTML = receiveReq.responseText;
	 }
}

function updatePage1() {
	 if (receiveReq.readyState == 4) {
	   document.getElementById('result_activity').innerHTML = receiveReq.responseText;
	 }
}

function getParam(theForm,value) {
	var value ;
	
	if (theForm == 'rooms') {
		 var url = 'get_room_info.php?room_id='+ value;
		 makeRequest(url);
	} 
	
//	if (theForm == 'get_activity') {
//		var url = 'administrator/components/com_kdk_search/get_activity.php?r_id=' + value;
//		makeRequest1(url);
//	} 
//
//	if (theForm == 'x3') {
//		var url = 'administrator/components/com_kdk_search/search_1.php?r_id=' + value;
//		makeRequest(url);	
//	} 

}

