// HoutenKlaas and  Kopietje website
// Author: Global Nomad
// This Javascript is used to manipulated the menu options and preload images
//
//
//
// Speeding up the page by preloading the menu-images when the page is initial loaded
// The variables do have names correspondending the menu option
		var home_over = new Image(); home_over.src = "g-home.gif"; 
		var winkel_over = new Image(); winkel_over.src = "g-webwinkel.gif"; 
		var printservice_over = new Image(); printservice_over .src = "g-printservice.gif"; 
		var spelverhuur_over = new Image(); spelverhuur_over.src = "g-spelverhuur.gif"; 
		var contact_over = new Image(); contact_over.src = "g-contact.gif"; 
		var adres_over = new Image(); adres_over.src = "g-adres.gif"; 		
		var vacatures_over= new Image(); vacatures_over.src = "g-vacatures.gif"; 
						


// Declare a var that will keep track on the current plage loaded in the Iframe in order to get the menu right						
		var current_page_loaded= "home";		

// Declare an Array that contains the different menu-options		
		var number_of_menu_items = new Array();
		number_of_menu_items[0]="home";
		number_of_menu_items[1]="winkel";
		number_of_menu_items[2]="printservice";
		number_of_menu_items[3]="spelverhuur";
		number_of_menu_items[4]="contact";
		number_of_menu_items[5]="adres";
		number_of_menu_items[6]="vacatures";		
		number_of_menu_items[7]="empty";


// This function will swap the logo in the top left to default (kopietje) and in the right to blue. 
// The top right is used to let the pictures appear on the right of the screen
		function home_logo() {
			document.images["logo"].src ="logo1.gif" ;
			document.images["right_picture"].src ="blue.gif" ;
		}
				
// This function will swap the logo in the top left to printservice and the right to the corresponding graphs

		function print_logo () {
			document.images["logo"].src ="logo2.gif" ;
			document.images["right_picture"].src="printservice.gif";
		}
// This function will swap the logo in the top left to kopietje and the right to the corresponding graphs for winkel
		function winkel_logo () {
			document.images["logo"].src ="logo1.gif" ;
			document.images["right_picture"].src="winkel.gif";			
		}
		
// This function will swap the logo in the top left to kopietje and the right to the corresponding graphs spelverhuur
		function spelverhuur_logo() {
			document.images["logo"].src ="logo1.gif" ;
			document.images["right_picture"].src="spellen.gif";}	
	
	
// This function will build the menu. The parameter received is the current mouse position when the function is called. 
	function build_menu (current_position) 
	{
	var s = String;
	var s1 = String;
		for (n = 0; n <8; n++) 
		{
			if (number_of_menu_items[n] == current_position) 
			{
				s="b-"+current_position+".gif";
				document.images[current_position].src =s;
				current_page_loaded = current_position;
			}
			else
			{
				s="a-"+number_of_menu_items[n] +".gif";
				s1=number_of_menu_items[n];
				document.images[s1].src =s;				
			}
		}
	if (current_page_loaded == "spelverhuur") {spelverhuur_logo();}	else
	if (current_page_loaded == "printservice") {print_logo()} else
	if (current_page_loaded == "speelgoed") {winkel_logo()}	else home_logo();
	} 
	
// This function is called when the mouse leaves an menu bar and restores the right pictures for the menu
	function mouse_out(current_position) {
	var s = String;
	if (current_position == current_page_loaded) 
		{ s="b-"+current_position+".gif";
		document.images[current_position].src =s;
		}
		else
		{ s="a-"+current_position+".gif";
		document.images[current_position].src =s;
		}
	}	

	function mouse_over(current_position) {
	var s = String;
	if (current_position == current_page_loaded) 
		{ s="b-"+current_position+".gif";
		document.images[current_position].src =s;
		}
		else
		{ s="g-"+current_position+".gif";

		document.images[current_position].src =s;
		}
	}	


