// functie om inhoud op te halen
function getContent(item,page){
	changeMenu(item,page);
}

function getContentText(item,page){

	// wis eerst oude inhoud
	document.getElementById("content").innerHTML = "<font color='#FFFFFF'>loading page...</font>";
	// haal nieuwe inhoud op via getContent.php
	xmlhttp.open("GET", "getContent.php?action="+item+"&page="+page,true);
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4){            
				tekst_content = xmlhttp.responseText;
				document.getElementById("content").innerHTML = tekst_content;
				//verander afbeelding in Flash header
		}
	}
	xmlhttp.send(null);	
}

function changeMenu(item,page){
	// haal nieuwe inhoud op via left_menu.php
	xmlhttp.open("GET", "left_menu.php?action="+item,true);
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4){            
				tekst_menu = xmlhttp.responseText;
				document.getElementById("left_menu").innerHTML = tekst_menu;
				getContentText(item,page);
		}
	}
	xmlhttp.send(null);	
}

//functies tbv linker menu
function newImage(arg){
	if (document.images){
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)){
		for (var i=0; i<changeImages.arguments.length; i+=2){
			document.getElementById(changeImages.arguments[i]).src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;

function preloadImages(){
	if (document.images){
		news_over = newImage("components/images/menu_links_01.gif");
		tourdates_over = newImage("components/images/menu_links_02.gif");
		biography_over = newImage("components/images/menu_links_03.gif");
		discography_over = newImage("components/images/menu_links_04.gif");
		theband_over = newImage("components/images/menu_links_05.gif");
		press_over = newImage("components/images/menu_links_06.gif");
		photo_over = newImage("components/images/menu_links_07.gif");
		multimedia_over = newImage("components/images/menu_links_08.gif");
		message_over = newImage("components/images/menu_links_09.gif");
		links_over = newImage("components/images/menu_links_10.gif");
		contact_over = newImage("components/images/menu_links_11.gif");
		preloadFlag = true;
	}
}

// functie tbv verwijderen selectie driehoek op links
function defocus(x) {
	x.blur();
}

function callExternalInterface() {
	/* Call a function registered as callPlayBall in the SWF named myMovie. */
	getMovieName("newcoolcollective").changePic(); 
}

/* This utility function resolves the string movieName to a Flash object reference based on browser type. */
function getMovieName(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName]
	}
	else {
		return document[movieName]
	}
}
