
var httpObject0 = null;
var httpObject1 = null;
var httpObject2 = null;
// Get the HTTP Object
function getHTTPObject(){   
	if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");  
	else if (window.XMLHttpRequest) return new XMLHttpRequest();   
	else {      
		alert("Your browser does not support AJAX.");      
		return null;   
	}
}   


function setOutput(){    

	if(httpObject0.readyState == 4){  
		
		document.getElementById('studio-info').innerHTML = httpObject0.responseText;    
	} 
}


function setOutputRoom(){    

	if(httpObject1.readyState == 4){  
		
		document.getElementById('studio-room').innerHTML = httpObject1.responseText;    
	} 
}

function setOutputRate(){    

	if(httpObject2.readyState == 4){  
		
		document.getElementById('rate-info').innerHTML = httpObject2.responseText;    
	} 
}


function findStudio(id_studio){        
	httpObject0= getHTTPObject(); 
	if (httpObject0 != null) { 
		httpObject0.onreadystatechange = setOutput;
		httpObject0.open("GET", "http://www.beatlocker.com/studios/studio_info.php?id_studio="+id_studio, true);       
		httpObject0.send(null);
		
	}
} 

function findRoom(id_studio){        
	httpObject1 = getHTTPObject(); 
	if (httpObject1 != null) { 
		httpObject1.onreadystatechange = setOutputRoom;
		httpObject1.open("GET", "http://www.beatlocker.com/studios/studio_room.php?id_studio="+id_studio, true);       
		httpObject1.send(null);
		
	}
} 

function findRate(id_studio, id_room, startdate, enddate, starttimehour, starttimemin, starttimeampm, endtimehour, endtimemin, endtimeampm){
	httpObject2 = getHTTPObject(); 
	if (httpObject2 != null) { 
		httpObject2.onreadystatechange = setOutputRate;
		httpObject2.open("GET", "http://www.beatlocker.com/studios/studio_rate.php?id_studio="+id_studio+"&id_room="+id_room+"&startdate="+startdate+"&enddate="+enddate+"&starttimehour="+starttimehour+"&starttimemin="+starttimemin+"&starttimeampm="+starttimeampm+"&endtimehour="+endtimehour+"&endtimemin="+endtimemin+"&endtimeampm="+endtimeampm, true);       
		httpObject2.send(null);		
	}
} 





