// JavaScript Document
function showVehicleDetail(row) {
	dyn.loadContent('vehicleDetailResponse','/ajax/booking.showVehicleDetail.php?vehicle_id='+row.id );
	var winWidth = (document.body.clientWidth);
	var winHeight = (document.body.clientHeight);
	setTimeout(window.scrollTo(winWidth*100000,winHeight*100000),5000);
}
function showVehicleDetailById(vehicle_id) {
	dyn.loadContent('vehicleDetailResponse','/ajax/booking.showVehicleDetail.php?vehicle_id='+vehicle_id );
	window.location='#footer';
}
function showExtraFee(vehicle_id) {
	dyn.loadContent('vehicleDetailResponse','/ajax/booking.showExtraFee.php?vehicle_id='+vehicle_id );
}
function updateExtraFeeTotal(extrafee_id,charge) {
	var inputId = 'extraFeeInterval'+extrafee_id;
	var responseId = 'extraFeeTotal'+extrafee_id;
	var interval = document.getElementById(inputId).value;
	document.getElementById(responseId).innerHTML = interval * charge;
}
function toggleRowColor(it,extrafee_id) {
  tr = it.parentNode.parentNode;
  tr.style.color = (it.checked) ? "black" : "gray";
  interval = document.getElementById('extraFeeInterval'+extrafee_id);
  interval.disabled = (interval.disabled) ? false : true;
  
}


function clickClear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

function clickRecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}												

function displayImage(imagePath,title,description) {
	enlargerObj.displayImage(imagePath,title,description);
}

function popUp(url, width, height, name) {
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;
	var params = 'width='+width+', height='+height;
	params += ', top='+top+', left='+left;
	params += ', directories=no';
	params += ', location=no';
	params += ', menubar=no';
	params += ', resizable=no';
	params += ', scrollbars=yes';
	params += ', status=no';
	params += ', toolbar=no';
	newwin=window.open(url,name,params);
	if (window.focus) {newwin.focus()}
	return false;
}




//////////////////////////////////////////////////////////////////////////
