// JavaScript Document
/*
ALLROUND FUNCTIONS
*/
function findObj(theObj,theDoc){
	var p,i,foundObj;
	if(!theDoc) theDoc=document;
	if((p=theObj.indexOf("?"))>0&&parent.frames.length){
		theDoc=parent.frames[theObj.substring(p+1)].document;
		theObj=theObj.substring(0,p);
	}
	if(!(foundObj=theDoc[theObj])&&theDoc.all)foundObj=theDoc.all[theObj];
	for(i=0;!foundObj&&i<theDoc.forms.length;i++)
		foundObj=theDoc.forms[i][theObj];
	for(i=0;!foundObj&&theDoc.layers&&i<theDoc.layers.length;i++)
		foundObj=findObj(theObj,theDoc.layers[i].document);
	if(!foundObj&&document.getElementById)foundObj=document.getElementById(theObj);
	return foundObj;
}

/*
BOOKING-FUNCTIONS
*/
var active_id1 = '', active_id1_class = '', active_id2 = '', active_id2_class = '';
function fillBookingForm(myYear, myMonth, myDay, myHour, myMinute, id1, id2){
	if(active_id1!=''){
		findObj(active_id1).className = active_id1_class;
		findObj(active_id2).className = active_id2_class;
	}
	active_id1 = id1;
	active_id1_class = findObj(id1).className;
	active_id2 = id2;
	active_id2_class = findObj(id2).className;
	findObj(id1).className = 'booking_active';
	findObj(id2).className = 'booking_active';
	if(myMinute<10)myMinute='0' + myMinute;
	findObj('showdatetime').innerHTML = myDay + '.' + myMonth + '.' + myYear + ' ' + myHour + ':' + myMinute + ' - ' + (myHour + 1) + ':' + myMinute;
	findObj('datetime').value = myYear + '/' + myMonth + '/' + myDay + ' ' + myHour + ':' + myMinute + ':00';
}
