// JavaScript Document
var v_focus = "";

PreloadImages();

function PreloadImages()
{	var myImages = new Array(12);
	myImages[0]="/templates/images/nav/contact.gif";
	myImages[1]="/templates/images/nav/contact_ro.gif";
	myImages[2]="/templates/images/nav/galleries.gif";
	myImages[3]="/templates/images/nav/galleries_ro.gif";
	myImages[4]="/templates/images/nav/home.gif";
	myImages[5]="/templates/images/nav/home_ro.gif";
	myImages[6]="/templates/images/nav/mailinglist.gif";
	myImages[7]="/templates/images/nav/mailinglist_ro.gif";
	myImages[8]="/templates/images/nav/news.gif";
	myImages[9]="/templates/images/nav/news_ro.gif";
	myImages[10]="/templates/images/nav/clients.gif";
	myImages[11]="/templates/images/nav/clients_ro.gif";
	for (i=0; i < myImages.length; i++)
	{	var preload = new Image(12);
		preload.src = myImages[i];
	}
}

function LoadImagesHomepage()
{	// Preload
	var myImages = new Array(15);
	myImages[0]="/images/home/zw_1a.jpg";
	myImages[1]="/images/home/zw_1b.jpg";
	myImages[2]="/images/home/zw_1c.jpg";
	
	myImages[3]="/images/home/zw_2a.jpg";
	myImages[4]="/images/home/zw_2b.jpg";
	myImages[5]="/images/home/zw_2c.jpg";
	
	myImages[6]="/images/home/kl_1a.jpg";
	myImages[7]="/images/home/kl_1b.jpg";
	myImages[8]="/images/home/kl_1c.jpg";
	
	myImages[9]="/images/home/kl_2a.jpg";
	myImages[10]="/images/home/kl_2b.jpg";
	myImages[11]="/images/home/kl_2c.jpg";
	
	myImages[12]="/images/home/kl_3a.jpg";
	myImages[13]="/images/home/kl_3b.jpg";
	myImages[14]="/images/home/kl_3c.jpg";
	
	for (i=0; i < myImages.length; i++)
	{	var preload = new Image(15);
		preload.src = myImages[i];
	}
	// End preload
	var currentIndex = Math.round(Math.random()*4); // *4 geeft 5 mogelijke reeksen (0, 1, 2, 3 of 4)
	if (currentIndex == 0)
	{	document["photo_1"].src = myImages[0];
		document["photo_2"].src = myImages[1];
		document["photo_3"].src = myImages[2];
	}
	if (currentIndex == 1)
	{	document["photo_1"].src = myImages[3];
		document["photo_2"].src = myImages[4];
		document["photo_3"].src = myImages[5];
	}
	if (currentIndex == 2)
	{	document["photo_1"].src = myImages[6];
		document["photo_2"].src = myImages[7];
		document["photo_3"].src = myImages[8];
	}
	if (currentIndex == 3)
	{	document["photo_1"].src = myImages[9];
		document["photo_2"].src = myImages[10];
		document["photo_3"].src = myImages[11];
	}
	if (currentIndex == 4)
	{	document["photo_1"].src = myImages[12];
		document["photo_2"].src = myImages[13];
		document["photo_3"].src = myImages[14];
	}
}

function OpenFullScreen(sv_body_html)
{	var v_sv_body_html = sv_body_html;
	v_sv_body_html = (v_sv_body_html.replace("500", "100%")); // de hoogte van de <embed> op full screen brengen
	v_sv_body_html = (v_sv_body_html.replace("88", "100")); // de breedte van de <embed> op full screen brengen
	w= "<html>";
	w+= "<head>";
	w+= "<title>Marion Kahane | Photographer</title>";
	w+= "</head>";
	w+= "<body style='height:100%; width:100%; margin:0; padding:0; background-color:#000000;'>";
	w+= "<div style='height:100%; width:100%;'>";
	w+= v_sv_body_html;
	w+= "</div>";
	w+= "</body>";
	w+= "</html>";
	var mywindow = window.open ('', "mywindow"); 
	mywindow.document.open();
	mywindow.document.write(w);
	mywindow.document.close();	
}

function SwapBtn(placeholder)
{	if (placeholder.src == "http://www.marionkahane.com/templates/images/nav/home_ro.gif")
	{	v_focus = "home";
	}
	if (placeholder.src == "http://www.marionkahane.com/templates/images/nav/galleries_ro.gif")
	{	v_focus = "galleries";
	}	
	if (placeholder.src == "http://www.marionkahane.com/templates/images/nav/clients_ro.gif")
	{	v_focus = "clients";
	}	
	if (placeholder.src == "http://www.marionkahane.com/templates/images/nav/news_ro.gif")
	{	v_focus = "news";
	}	
	if (placeholder.src == "http://www.marionkahane.com/templates/images/nav/mailinglist_ro.gif")
	{	v_focus = "mailinglist";
	}	
	if (placeholder.src == "http://www.marionkahane.com/templates/images/nav/contact_ro.gif")
	{	v_focus = "contact";
	}
	placeholder.src = "/templates/images/nav/" + (placeholder.name) + "_ro.gif";
}

function RestoreBtn(placeholder)
{	if (placeholder.name == v_focus)
	{	placeholder.src = "/templates/images/nav/" + (placeholder.name) + "_ro.gif";
	}
	else
	{	placeholder.src = "/templates/images/nav/" + (placeholder.name) + ".gif";
	}
}

function SwapImg(placeholder, path)
{	placeholder.src= path + (placeholder.name) + "_ro.gif";
}

function RestoreImg(placeholder, path)
{	placeholder.src= path + (placeholder.name) + ".gif";
}