
currentlySelected = '#propmen1'; // remembers last one to 'uncheck'.
currentID = 1


/* hides all of them at startup */
function startup(){
	for ( i =2;i<5;i++){
		try {dis = document.getElementById('info' + i)}catch(e){alert (i)}
		try {dat = document.getElementById('hide'+i)}catch(e){}
		try {dis.style.display='none';}catch(e){}
		try {dat.style.display = 'none';}catch(e){}
	}
	for ( i =2;i<5;i++){
		try {document.getElementById('propmen'+i).style.display = 'inline';}catch(e){}
	}
}
/* on click makes tab go white /grey and shows page content*/
function menu(id){
	if (id != currentID) { // else misbehaves
		constructed_id = '#propmen' + id
		$(constructed_id).addClass('selected')
		if (currentlySelected) {
			$(currentlySelected).removeClass('selected')
		}
		currentlySelected = constructed_id;
		
		newone = document.getElementById('info' + id)
		oldone = document.getElementById('info' + currentID)
		email_id = document.getElementById('info5').style.display ='none'; // gotta hide it every time i'm afraid...
		newone.style.display = 'block';
		oldone.style.display = 'none';
		
		var book_now_button = document.getElementById('book_now_button');
		if (id == 1){
		 	book_now_button.style.display ='block';
		}else{
			book_now_button.style.display ='none';
		}
		
		currentID = id
	}	
	
}


function showemail(){
	for ( i =1;i<5;i++){
		document.getElementById('info'+i).style.display='none';
	}
	email_id = document.getElementById('info5').style.display ='block';
	email_id = document.getElementById('propmen5').style.display ='inline';
	menu(5)
//	email_id.style.display = 'block';
	return false;
	
}

function showguestbook(){
	for ( i =1;i<5;i++){
		document.getElementById('info'+i).style.display='none';
	}
	//email_id = document.getElementById('info3').style.display ='block';
	//email_id = document.getElementById('propmen3').style.display ='inline';
	menu(3)
//	email_id.style.display = 'block';
	return false;
	
}

function preload_images(){
	// Preload images for rollovers...
	imageObj = new Image();
	
	// set image list
	preimages = new Array();
	var path = 'templates/default/images/'
	preimages[0]= path + "add-to-shortlist-button/ats-1-h.gif"
	preimages[1]= path + "add-to-shortlist-button/ats-2-h.gif"
	preimages[2]= path + "enquiry-button/enq-1-h.gif"
	preimages[3]= path + "enquiry-button/enq-2-h.gif"
	// start preloading
	for(var i=0; i< preimages.length; i++){
		imageObj.src=preimages[i];
	}
	
}

//



































