// JavaScript Document
function CheckAdd(selectVal, startCount, divNum, path, addRows) {
	
		AddReservation(startCount,divNum,path,addRows);
}

function AddReservation(startCount,divNum,path,addRows) {
	
	var url = path+"/inc/ajax/add_reservation.php";
	var params = "startCount="+startCount+"&divNum="+divNum+"&addRows="+addRows;
	http.open("GET", url+"?"+params, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-Type", "text/html; charset=windows-1250");
    http.onreadystatechange = handleResponseAddReservation;
    http.send(null);
    document.getElementById('add_reservation'+divNum).innerHTML = '<div align="center" style=\"height:29px; padding-top:6px;\"><img src="http://bowgarden.gartproject.com/images/body/working.gif" width="16" height="16"></div>';
}



function handleResponseAddReservation() {
    if(http.readyState == 4){
        if(http.status == 200 && http.responseText != '') {
            var response = http.responseText;
            var update = new Array();

            if(response.indexOf('|' != -1)) {
                update = response.split('|');
                document.getElementById('calendar_reservation').style.display = 'none';
                document.getElementById('add_reservation'+update[3]).innerHTML = update[1];
            }
        }
    }
}

