var page = "";

function changeContent(button) {
	var datetime = new Date();
	if (page == "standard") {
		var thispage = "/furnishingpage_standard.php?contentid=" + button+"&time="+datetime.getDate().toString();		
	} else if (page == "executive") {
		var thispage = "/furnishingpage_executive.php?contentid=" + button+"&time="+datetime.getDate().toString();
	} else if (page == "bespoke") {
		var thispage = "/furnishingpage_bespoke.php?contentid=" + button+"&time="+datetime.getDate().toString();
	}
	new Ajax.Request(thispage, {
		method:'get',
		onSuccess: function(transport){
			var response = transport.responseText || "no response text";
			$('packagecontent').update(response);
			initLightbox();
		}
	});
	
	if (button == 1) {
		$('inc').removeClassName('button');
		$('inc').addClassName('buttonselected');
		
		$('info').removeClassName('buttonselected');
		$('info').addClassName('button');
	} else {
		$('info').removeClassName('button');
		$('info').addClassName('buttonselected');
		
		$('inc').removeClassName('buttonselected');
		$('inc').addClassName('button');		
	}
}

function changePage(pageid) {
	var datetime = new Date();
	$('furnishingpage').addClassName('innerfurnishingpage');
	
	if ($('packagecontent')) {
		$('packagecontent').fade();
	}
	
	if (pageid == 1) {
		page = "standard";	
	} else if (pageid == 2) {
		page = "executive";
	} else if (pageid == 3) {
		page = "bespoke";
	}
	
	var thispage = "/furnishingpage.php?pageid=" + pageid+"&time="+datetime.getDate().toString();
	
	
	new Ajax.Request(thispage, {
		method:'get',
		onSuccess: function(transport){
			var response = transport.responseText || "no response text";
			$('furnishingpage').update(response);

			$('packagecontent').appear();

			initLightbox();
		}
	});

}

function setPage(newpage) {
	page = newpage;
}