var layerArray=['newsAll','guestbookAll','downloadsAll','albumsAll','newsArchive','newsActive','eventsArchive','eventsActive','albumImages','guestbookForm','contactForm','pressAll','discographyAll','tell_a_friend'];

var xmlhttp=false;
var STATUS = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
function displayPages(pageId,qs){
	hideAll();
	window.setTimeout('goahead('+pageId+',"'+qs+'");',1000);
}

function goahead(pageId,qs){
	
	var pageToGet='';
	var layerToShow='';
	

	switch (pageId){
		case 100:

		break;
		case 200:

		break;
		case 300:
		pageToGet='/news/index.php';
		layerToShow='newsAll';
		break;
		case 301:
		pageToGet='/news/archive.php';
		layerToShow='newsArchive';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 302:
		pageToGet='/news/active.php';
		layerToShow='newsActive';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 303:
		pageToGet='/news/events.php';
		layerToShow='eventsActive';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 304:
		pageToGet='/news/archive_events.php';
		layerToShow='eventsArchive';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 400:
		pageToGet='/photo_album/index.php';
		layerToShow='albumsAll';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 401:
		pageToGet='/photo_album/album.php';
		layerToShow='albumImages';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 500:
		pageToGet='/songsvideos/index.php';
		layerToShow='discographyAll';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		
		break;
		case 600:
		pageToGet='/downloads/index.php';
		layerToShow='downloadsAll';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 700:
		pageToGet='/press/index.php';
		layerToShow='pressAll';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 800:

		break;
		case 900:
		pageToGet='/guestbook/index.php';
		layerToShow='guestbookAll';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 901:
		pageToGet='/guestbook/form.php';
		layerToShow='guestbookForm';
		if(qs!=''){
			var more ="?"+qs;
			pageToGet +=more;
		}
		break;
		case 1000:
		pageToGet='/contact/index.php';
		layerToShow='contactForm';
		break;
		default:
		hideAll();
		break;
	}
	var radarResponse="";
	
	xmlhttp.open("GET", pageToGet ,true);

	xmlhttp.onreadystatechange=function() {
		document.getElementById('loadingDiv').style.visibility ='visible';
		document.getElementById('loading_data').style.visibility ='visible';
		document.getElementById('loadingDiv').style.height = screen.height;
		if(xmlhttp.readyState==4) {
			if(xmlhttp.status ==200){
				document.getElementById('loadingDiv').style.visibility ='hidden';
				document.getElementById('loading_data').style.visibility ='hidden';
				document.getElementById('loadingDiv').style.height = 1;
				radarResponse = xmlhttp.responseText;
				hideShowPages(radarResponse,layerToShow);
			}
		}
	}
	xmlhttp.send(null);
}

function hideShowPages(theResponse,layerToShow){
	//	document.getElementById(layerToShow).style.height=height+'px';
	document.getElementById(layerToShow).style.visibility='visible';
	document.getElementById(layerToShow).innerHTML=theResponse;
}
function hideAll(){
	document.getElementById('loadingDiv').style.visibility ='hidden';
	document.getElementById('loadingDiv').style.height = 1;
	for(var i=0;i<layerArray.length;i++){
		//		document.getElementById(layerArray[i]).style.height='0px';
		document.getElementById(layerArray[i]).style.visibility='hidden';
	}
}