// JavaScript Document

function createSideBars() {
	var divHeight = document.getElementById('content_div').offsetHeight;
	document.getElementById('left_gradient').innerHTML='<img src="images/side_gradient.gif" width="37" height="'+divHeight+'" alt="left gradient" border="0" />';
	document.getElementById('right_gradient').innerHTML='<img src="images/side_gradient.gif" width="37" height="'+divHeight+'" alt="right gradient" border="0" />';
}

function createInteriorBackground() {
	var divHeight = document.getElementById('page_content').offsetHeight;
	var str='<div id="page_content">';
	str=str.replace(str, '<div id="page_content" style="background-image:url(images/page_content_gradient.gif); width:100%; height:'+divHeight+'px;">');
	document.write(str);
}

function resetFocus(){
	document.getElementById('comfort').className='whychoose_unselected';
	document.getElementById('privacy').className='whychoose_unselected';
	document.getElementById('airportaccess').className='whychoose_unselected';
	document.getElementById('flexibility').className='whychoose_unselected';
	document.getElementById('cost').className='whychoose_unselected';
	document.getElementById('hasslefree').className='whychoose_unselected';
}

function changeFocusStyle() {
	resetFocus();
	if(!(location.hash=='')){
		if(location.hash=='#hasslefree'){
			document.getElementById('hasslefree').className='whychoose_selected';
		}
		else if(location.hash=='#privacy'){
			document.getElementById('privacy').className='whychoose_selected';
		}
		else if(location.hash=='#flexibility'){
			document.getElementById('flexibility').className='whychoose_selected';
		}
		else{
			document.getElementById('comfort').className='whychoose_selected';
		}
	}
}

function swapFocus(theID,theDivID){
	resetFocus();
	document.getElementById(theID).className='cva_show';
	document.getElementById(theDivID).className='cva_selected';
}

function swapImages(img_name1,img_src1,img_name2,img_src2){
	document[img_name1].src = img_src1;
	document[img_name2].src = img_src2;
}

function clearBox(theBoxID,newValue,originalValue){
	theBox=document.getElementById(theBoxID);
	if(theBox.value==originalValue)
		theBox.value=newValue;
}

function fillBox(theBoxID,newValue){
	theBox=document.getElementById(theBoxID);
	if(theBox.value=='')
		theBox.value=newValue;
}