document.getElementsByClassName = function(cl) {
	return $$('.'+cl);
};

// return an object for a string or an object (just in case)
function getObject(daName){
	return $(daName);
}

// shows an object
function show(daObj){
	$(daObj).show();
}

// hides an object
function hide(daObj){
	$(daObj).hide();
}

function popup(name, url, width, height, scroll) {
	scrolling = (scroll==1)?'yes':'no';
	mywin = window.open(url, name,"menubar=no,resizable,scrollbars="+scrolling+",status=no,width="+width+",height="+height);
	mywin.focus();
	return false;
}

function checkTerms() {
	if(document.getElementById('TermsCheckboxes')) {
		myInputs = document.getElementById('TermsCheckboxes').getElementsByTagName('input');
		notAllChecked = false;
		arrayLength = myInputs.length;
		for (i=0;i<arrayLength;i++) {
			if(!myInputs[i].checked) {
				notAllChecked = true;
			}
		}
		if(notAllChecked) {
			document.getElementById('book_button').src = document.getElementById('book_button').getAttribute('off');
		} else {
			document.getElementById('book_button').src = document.getElementById('book_button').getAttribute('on');
		}
		document.getElementById('book_button').disabled = notAllChecked;
	}
}

function disableButton(form_ident, button_ident) {
	bttn = $(button_ident);
	frm = $(form_ident);
	bttn.disabled = true;
	bttn.value = 'Please Wait...';
	bttn.addClassName('Disabled');
	frm.submit();
	return false;
}

function removeDefault(box){
	box = Element.extend(box);
	if (box.value == box.defaultValue) {
		box.value = '';
		box.addClassName('On');
	}
}

function restoreDefault(box){
	if (box.value == '') {
		box.value = box.defaultValue;
		box.removeClassName('On');
	}
} 
