function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function checkForm (value) {
	
	var error = "";
	
	if (value == 'mail-me-now') {
		
		if (document.getElementById('name').value == "")
			error += "- NAME is not filled in.<br />";
			
		if (document.getElementById('emailadres').value == "")
			error += "- EMAIL ADDRESS is not filled in.<br />";
			
		if (document.getElementById('question').value == "")
			error += "- QUESTION is not filled in.<br />";
		
		if (error == "") {
			
			document.forms['form_mailmenow'].submit();
			
		} else {
			
			document.getElementById('mail_error').innerHTML = error;
			
		}
		
	} else if (value == 'call-me-now') {
		
		if (document.getElementById('name').value == "")
			error += "- NAME is not filled in.<br />";
			
		if (document.getElementById('telephonenumber').value == "")
			error += "- TELEPHONE NUMBER is not filled in.<br />";
		
		if (error == "") {
			
			document.forms['form_callmenow'].submit();
			
		} else {
			
			document.getElementById('call_error').innerHTML = error;
			
		}
		
	}  else if (value == 'contact') {
		
		if (document.getElementById('name').value == "")
			error += "- NAME is not filled in.<br />";
			
		if (document.getElementById('emailadres').value == "")
			error += "- EMAIL ADDRESS is not filled in.<br />";
			
		if (document.getElementById('question').value == "")
			error += "- QUESTION is not filled in.<br />";
		
		if (error == "") {
			
			document.forms['form_contact'].submit();
			
		} else {
			
			document.getElementById('contact_error').innerHTML = error;
			
		}
		
	}	
	
}

function init() {

	if (el = document.getElementById('nav_home')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_home','','/images/nav/home2.gif',1); };
	}
	
	if (el = document.getElementById('nav_about')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_about','','/images/nav/about2.gif',1); };
	}
	
	if (el = document.getElementById('nav_actualnow')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_actualnow','','/images/nav/actualnow2.gif',1); };
	}
	
	if (el = document.getElementById('nav_artists')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_artists','','/images/nav/artists2.gif',1); };
	}
	
	if (el = document.getElementById('nav_events')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_events','','/images/nav/events2.gif',1); };
	}
	
	if (el = document.getElementById('nav_projects')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_projects','','/images/nav/projects2.gif',1); };
	}
	
	if (el = document.getElementById('nav_newsletter')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_newsletter','','/images/nav/newsletter2.gif',1); };
	}
	
	if (el = document.getElementById('nav_links')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_links','','/images/nav/links2.gif',1); };
	}
	
	if (el = document.getElementById('nav_callmenow')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_callmenow','','/images/nav/callmenow2.gif',1); };
	}
	
	if (el = document.getElementById('nav_mailmenow')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_mailmenow','','/images/nav/mailmenow2.gif',1); };
	}
	
	if (el = document.getElementById('nav_contact')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('nav_contact','','/images/nav/contact2.gif',1); };
	}
	
	if (el = document.getElementById('facebook')) {
		el.onmouseout = MM_swapImgRestore;
		el.onmouseover = function () { MM_swapImage('facebook','','/images/nav/fb2.gif',1); };
	}
	
}

window.onload = init;