// JCookMenu
var myMenu =
[
	[null,'Verre Reizen','http://www.rienbouw.nl/Reizen/googlemaps_ihavebeenthere.htm','main','',
		[null,'Namibië (2010)','http://www.rienbouw.nl/Reizen/Namibie/body_nl.htm','main',''],
		[null,'Tibet (2009)','http://www.rienbouw.nl/Reizen/Tibet/body_nl.htm','main',''],
		[null,'Marokko(2007)','http://picasaweb.google.com/rienbouw/Morocco2007In80Pictures#slideshow','_blank',''],
		[null,'Myanmar (2006)','http://travel.webshots.com/slideshow/557410770HDeqGZ','main',''],
		[null,'Filippijnen (2005)','http://www.rienbouw.nl/Reizen/Filippijnen/body_nl.htm','main','',
			[null,'Reisgroep','http://www.rienbouw.nl/Reizen/Filippijnen/groep/body.htm','main',''],
			[null,'Mindanao','http://www.rienbouw.nl/Reizen/Filippijnen/Mindanao/body.htm','main',''],
			[null,'Reisgroep','http://www.rienbouw.nl/Reizen/Filippijnen/Stranddag/body.htm','main',''],
			[null,'Camiguin','http://www.rienbouw.nl/Reizen/Filippijnen/Camiguin/body.htm','main',''],
			[null,'Bohol','http://www.rienbouw.nl/Reizen/Filippijnen/Bohol/body.htm','main',''],
			[null,'Manila','http://www.rienbouw.nl/Reizen/Filippijnen/Manila/body.htm','main',''],
			[null,'Luzon','http://www.rienbouw.nl/Reizen/Filippijnen/Luzon/body.htm','main',''],
			[null,'Banaue','http://www.rienbouw.nl/Reizen/Filippijnen/Banaue/body.htm','main','']
		],
		[null,'Laos (2004)','Reizen/Laos/body.htm','main',''],
		[null,'Cambodja (2004)','Reizen/Cambodia/body.htm','main',''],
		[null,'India (2003)','Reizen/India2004/body_nl.htm','main','',
			[null,'Mooiste foto\'s','http://www.rienbouw.nl/Reizen/India2004/Great%20pictures/index.htm','main',''],
			[null,'New Delhi','http://www.rienbouw.nl/Reizen/India2004/New%20Delhi/index.htm','main',''],
			[null,'Straatleven','http://www.rienbouw.nl/Reizen/India2004/Street%20live/index.htm','main',''],
			[null,'Rajasthan','http://www.rienbouw.nl/Reizen/India2004/Rajasthan/index.htm','main',''],
			[null,'Jaisalmer','http://www.rienbouw.nl/Reizen/India2004/Jaisalmer/index.htm','main',''],
			[null,'Forten','http://www.rienbouw.nl/Reizen/India2004/Forts/index.htm','main',''],
			[null,'Hotels','http://www.rienbouw.nl/Reizen/India2004/Hotels/index.htm','main',''],
			[null,'De groep','http://www.rienbouw.nl/Reizen/India2004/Group/index.htm','main',''],
			[null,'Steden','http://www.rienbouw.nl/Reizen/India2004/Cities/index.htm','main',''],
			[null,'Tempels','http://www.rienbouw.nl/Reizen/India2004/Temples/index.htm','main',''],
			[null,'Leuke foto\'s','http://www.rienbouw.nl/Reizen/India2004/Funny%20pictures/index.htm','main',''],
			[null,'Khajuraho','http://www.rienbouw.nl/Reizen/India2004/Khajuraho/index.htm','main',''],
			[null,'Varanasi','http://www.rienbouw.nl/Reizen/India2004/Varanasi/index.htm','main',''],
		],
		[null,'Brazilië (2002)','Reizen/Brazilie/body.htm','main','',
			[null,'Land en mensen','Reizen/Brazilie/Land en mensen/index.htm','main',''],
			[null,'Rio de Janeiro','Reizen/Brazilie/Rio%20de%20Janeiro/index.htm','main',''],
			[null,'Parati','Reizen/Brazilie/Parati/index.htm','main',''],
			[null,'Foz do Iguacu','Reizen/Brazilie/Foz do Iguacu/index.htm','main',''],
			[null,'Pantanal','Reizen/Brazilie/Pantanal/index.htm','main',''],
			[null,'Manaus en Amazone','Reizen/Brazilie/Manaus%20en%20Amazonegebied/index.htm','main',''],
			[null,'Recife en Olinda','Reizen/Brazilie/Recife%20en%20Olinda/index.htm','main',''],
			[null,'Lencois','Reizen/Brazilie/Lencois/index.htm','main',''],
			[null,'Chapada Diamantina','Reizen/Brazilie/Chapada%20Diamantina/index.htm','main',''],
			[null,'Salvador da Bahia','Reizen/Brazilie/Salvador da Bahia/index.htm','main',''],
			[null,'Groep','Reizen/Brazilie/Groep/index.htm','main','']			
		],
		[null,'China (2001)','Reizen/China/body_nl.htm','main','',
			[null,'Chinezen','Reizen/China/people/index.htm','main',''],
			[null,'Beijing','Reizen/China/Beijing/index.htm','main',''],
			[null,'Chinese Muur','Reizen/China/ChineseWall/index.htm','main',''],
			[null,"X'ian",'Reizen/China/Xian/index.htm','main',''],
			[null,'Xiahe','Reizen/China/Xiahe/index.htm','main',''],
			[null,'Festival','Reizen/China/Festival/index.htm','main',''],
			[null,'Grasslands','Reizen/China/Grasslands/index.htm','main',''],
			[null,'Langmusi','Reizen/China/Langmusi/index.htm','main',''],
			[null,'Zoige','Reizen/China/Zoige/index.htm','main',''],
			[null,'Songpan','Reizen/China/Songpan/index.htm','main',''],
			[null,'Paardetrektocht','Reizen/China/HorseTrekking/index.htm','main',''],
			[null,'Erdaohai','Reizen/China/Erdaohai/index.htm','main',''],
			[null,'Chengdu','Reizen/China/Chengdu/index.htm','main',''],
			[null,'Yangshuo','Reizen/China/Yangshuo/index.htm','main','']
		],
		[null,'Vietnam (2000)','Reizen/Vietnam/fotos_Vietnam.htm','main',''],
		[null,'Peru (1999)','Reizen/Peru/fotos_Peru.htm','main',''],
		[null,'India/Nepal (1998)','Reizen/India_and_Nepal/index_india_nepal.htm','main',''],
		[null,'Indonesië (1997)','Reizen/indonesie/body.htm','main','']
	],
	[null,'Europa','http://www.rienbouw.nl/Reizen/googlemaps_ihavebeenthere.htm','main','',
		[null,'Madeira (2010)','http://www.rienbouw.nl/Reizen/Madeira/index.htm','_blank','_blank'],
		[null,'Italië (2008)','http://picasaweb.google.nl/rienbouw/VeniceAndTuscany#slideshow','_blank','']
	],
	[null,'Steden Reizen','http://www.rienbouw.nl/Reizen/googlemaps_ihavebeenthere_cities.htm','main','',
		[null,'Lissabon (2011)','http://picasaweb.google.com/rienbouw/Lissabon#slideshow','_blank',''],
		[null,'Brussel (2011)','http://picasaweb.google.com/rienbouw/Brussel#slideshow','_blank',''],
		[null,'Valencia (2009)','http://picasaweb.google.com/rienbouw/Valencia5MinutesBest02#slideshow','_blank',''],
		[null,'Madrid (2008)','http://picasaweb.google.com/rienbouw/Madrid#slideshow','_blank',''],
		[null,'Rome (2007)','Reizen/Rome/index.htm','main',''],
		[null,'Rusland (2006)','http://travel.webshots.com/slideshow?ID=553367069&key=TBNpRs','main',''],
		[null,'Barcelona (2005)','Reizen/Barcelona/Stad/body.htm','main',''],
		[null,'Istanbul (2004)','Reizen/Istanbul/body.htm','main',''],
		[null,'Londen (2003)','Reizen/Londen/body.htm','main',''],
		[null,'Berlijn (2000)','Reizen/Berlijn/berlijn.htm','main','']
	],
	[null,'Wallpaper','http://www.rienbouw.nl/wallpaper/body.htm','main','',
		[null,'Filippijnen','http://www.rienbouw.nl/wallpaper/Filippijnen/body.htm','main',''],
		[null,'China','http://www.rienbouw.nl/wallpaper/china/body.htm','main',''],
		[null,'Laos en Cambodja','http://www.rienbouw.nl/wallpaper/Laos_Cambodja/body.htm','main',''],
		[null,'Istanbul','http://www.rienbouw.nl/wallpaper/Istanbul/body.htm','main',''],
		[null,'Landen','http://www.rienbouw.nl/wallpaper_index.html','main',''],
		[null,'Allerlei','http://www.rienbouw.nl/wallpaper/various_places/body.htm','main',''],
		[null,'Nederland','http://www.rienbouw.nl/wallpaper/Netherlands/body.htm','main',''],
		[null,'India','http://www.rienbouw.nl/wallpaper/India/body.htm','main',''],
		[null,'Brazilië','http://www.rienbouw.nl/wallpaper/Brazilie/body.htm','main',''],
		[null,'Rome','http://www.rienbouw.nl/wallpaper/rome/body.htm','main','']
	],
	[null,'Recepten','http://www.rienbouw.nl/recepten/body.htm','main',''],
	[null,'Utrecht','http://www.rienbouw.nl/utrecht/body.htm','main',''],
	[null,'Taal','http://www.rienbouw.nl/taal/body.htm','main','',
		[null,'Woordjes','http://www.rienbouw.nl/taal/body.htm','main',''],
		[null,'Postcodealfabet','http://www.rienbouw.nl/taal/postcodealfabet.htm','main','']
	],
	[null,'Fotografie','http://www.rienbouw.nl/Fotografie/body.htm','main',''],
	[null,'Fotoalbums','http://community.webshots.com/user/rienbouw','main','',
		[null,'Italië','http://picasaweb.google.nl/rienbouw/VeniceAndTuscany#slideshow','_blank',''],
		[null,'My Best Pictures','http://community.webshots.com/slideshow?ID=546590520&key=YNSOVx','_blank',''],
		[null,'Rajasthan, India','http://community.webshots.com/slideshow?ID=110840188&key=sCHOaG','main',''],
		[null,'Laos en Cambodja','http://community.webshots.com/slideshow?ID=252072168&key=fYieCV','main',''],
		[null,'Brazilië','http://picasaweb.google.nl/rienbouw/Brazilie#slideshow','_blank',''],
		[null,'Istanbul','http://community.webshots.com/slideshow?ID=198448284&key=AlaHqp','main',''],
		[null,'Londen','http://community.webshots.com/slideshow?ID=119916531&key=zWgNse','main',''],
		[null,'Schin op Geul','http://community.webshots.com/slideshow?ID=550653089&key=osDFne','main',''],
		[null,'Weihe naar Heino','http://community.webshots.com/slideshow?ID=550000578&key=BDUSDz','main',''],
		[null,'Almere','http://picasaweb.google.com/rienbouw/Almere#slideshow','_blank',''],
		[null,'Utrecht','http://community.webshots.com/slideshow?ID=190026436&key=MjbzxZ','main',''],
		[null,'Amelisweerd','http://community.webshots.com/slideshow?ID=550145034&key=zRrCUp','main',''],
		[null,'The Barrier','http://community.webshots.com/slideshow?ID=551668912&key=MbfEXX','main','']
	],
	[null,'Privé','http://www.rienbouw.nl/Prive/prive.htm','main',''],
	[null,'Webmasters','http://www.rienbouw.nl/deeplinks/deeplinks.htm','main','']
];

function setLanguage(newLang) 
{
	writeCookie("language", newLang);
}

function getLanguage() 
{
	var qparameters = location.href.split("?");
	var result = "-";
	if (qparameters.length > 1) {
		parvals = qparameters[1].split("&");
		var i;
		for (i = 0; i < parvals.length; i++) {
			parval = parvals[i].split("=");
			if (parval[0] == "language") {
				result = parval[1];
				return result;
			}
		}
	} 

	var l = readCookie("language");

	if (l == null) {
		l = "nl";
	} 

	return l;
}

function switchLanguage()
{
	var lang = getLanguage();
	
	// Compose new url for main window.
	var mainURL = newMainURL = new String(top.main.window.location);
	var pos = mainURL.lastIndexOf( "_" + lang + ".htm");
	var newLang = (lang == "en") ? "nl" : "en";
	writeCookie("language", newLang);
	if (pos != -1) {
		// The main frame contains a multi-language page.
		front = mainURL.substring(0, pos);
		newMainURL = front + "_" + newLang + ".htm";
	} else {
		// Strip language query parameter.
		q = mainURL.indexOf("?");
		if (q != -1) {
			newMainURL = mainURL.substring(0, q);
		}
	}
		
	// Reload main window with new language.
	top.main.window.location.href = newMainURL + "?language=" + newLang;
	
	// Reload the menu frame to change the flag.
	top.menuFrame.window.location.href = "menu_" + newLang + ".htm";

}

function loadLanguage(url) {
	location = url + "?language=" + getLanguage();
}

function addPicture(p_name, p_description, p_wallpaper)
{
	document.write("<tr>");
	document.write('<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">');
    document.write("<img border='0' src='" + p_name + "'>");
    document.write("</td></tr>");
    
    if (p_description.length > 0)
    {
		document.write("<tr>");
		document.write('<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">');
	    document.write('<font face="Verdana,Arial,Helvetica" size="2">' + p_description + '</font>');

	    if (p_wallpaper != null && p_wallpaper.length > 0)
    	{
    		document.write('  <a target="_blank" href="' + p_wallpaper + '"><img border="0" src="http://www.rienbouw.nl/wallpaper.gif" align="top" width="32" height="32"></a>');
	    }	
	    
    	document.write("</td></tr>");
    }

}

function addPictureX(p_name, p_description, p_wallpaper)
{
	document.write("<tr>");
	document.write('<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">');
    document.write("<img border='0' src='http://www.rienbouw.nl/" + p_name + "'>");
    document.write("</td></tr>");
    
    if (p_description.length > 0)
    {
		document.write("<tr>");
		document.write('<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">');
	    document.write('<font face="Verdana,Arial,Helvetica" size="2">' + p_description + '</font>');

	    if (p_wallpaper != null && p_wallpaper.length > 0)
    	{
    		document.write('  <a target="_blank" href="' + p_wallpaper + '"><img border="0" src="http://www.rienbouw.nl/wallpaper.gif" align="top" width="32" height="32"></a>');
	    }	
	    
    	document.write("</td></tr>");
    }

}

function loadML(href)
{
	var lang = getLanguage();
	location = href + "_" + lang + ".htm?language=" + lang;
}

function writeNextPictures(href, desc, desc_en)
{
	if (desc_en == null || desc_en.length == 0) {
		desc_en = desc;
	}
	
	if (getLanguage() == "en")
	{
		document.write('<br><p><b>Next pictures: <a href="' + href + '">' + desc + '</a></b>.');
	}
	else
	{
		document.write('<br><p><b>Volgende serie foto\'s: <a href="' + href + '">' + desc + '</a></b>.');
	}
}

function writeNextPicturesTR(href, desc, desc_en)
{
	if (desc_en == null || desc_en.length == 0) {
		desc_en = desc;
	}
	
	if (getLanguage() == "en")
	{
		document.write('<tr><td><br><p><b>Next pictures: <a href="' + href + '">' + desc_en + '</a></b>.</td></tr>');
	}
	else
	{
		document.write('<tr><td><br><p><b>Volgende serie foto\'s: <a href="' + href + '">' + desc + '</a></b>.</tr></td>');
	}
}

function ML(p_nl, p_en)
{
	var text;
   	text = p_nl;

	if (getLanguage() == "en") {
    		text = p_en;
	}
	    
    if (text.length > 0)
    {
		document.write('<tr><td>' + text + '</td></tr>');
	}
}

function mlWrite(p_nl, p_en)
{
	var text;
   	text = p_nl;

	if (getLanguage() == "en") {
    		text = p_en;
	}
	    
    if (text.length > 0)
    {
		document.write(text);
	}
}


function writeMLUsage()
{
	var lang = getLanguage();
	
	if (lang == "en")
	{
		document.write('<font color="#FF0000">Klik op de Nederlandse vlag in het menu voor Nederlandse tekst. (Klik <a target="_top" href="http://www.rienbouw.nl/index.htm">hier</a> als u geen vlag ziet.)</font><br><br>');
	}
	else if (lang == "nl")
	{
		document.write('<font color="#FF0000">Click on the English flag in the menu to get English text.(Click <a target="_top" href="http://www.rienbouw.nl/index.htm">here</a> when there is no flag.)</font><br><br>');
	}
}

function addPictureML(p_name, p_descriptionNL, p_descriptionEN, p_wallpaper)
{
	var description

	document.write("<tr>");
	document.write('<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">');
    document.write("<img border='0' src='http://www.rienbouw.nl/" + p_name + "'>");
    document.write("</td></tr>");

   	description = p_descriptionNL;

	if (getLanguage() == "en") {
    		description = p_descriptionEN;
	}
	    
    if (description.length > 0)
    {
		document.write("<tr>");
		document.write('<td bgcolor="#FFFFFF" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">');
	    document.write('<font face="Verdana,Arial,Helvetica" size="2">' + description + '</font>');

	    if (p_wallpaper != null && p_wallpaper.length > 0)
    	{
    		document.write('  <a target="_blank" href="' + p_wallpaper + '"><img border="0" src="http://www.rienbouw.nl/wallpaper.gif" align="top" width="32" height="32"></a>');
	    }	
	    
    	document.write("</td></tr>");
    }

}

function OpenWindow(f,name,dim)
{
  window.open(f, name, dim);
}

function imageDimension (evt) 
{
  var w = this.width + 20;
  var h = this.height + 20;
  window.open(this.name, "", "width=" + w + ",height=" + h);
}

function popupImage(image)
{
  currentImage = image;
  var img = new Image();
  img.border = 0;
  img.onload = imageDimension;
  img.name = image;
  img.src = image;
}

function bannerML(nlBanner,enBanner)
{
	if (getLanguage() == "en") 	{
		banner(enBanner);
	} else 	{
		banner(nlBanner);
	}
}

function banner(bannerText, center)
{
	
	if (parent == null)
	{
		window.status("no parent");
//		alert("parent null");
//		alert("banner null" + parent.frames.length + parent.frame[0].name);
		return;
	}

	if (parent.bannerFrame == null || parent.bannerFrame.document == null) 
	{
//		alert("timeoutbanner null" + name + parent.frames.length + parent.bannerFrame);
		setTimeout("writeBanner('" + bannerText + "','" + center + "');", 500);
	}
	else
	{
		writeBanner(bannerText, center);
	}
}

function writeBanner(bannerText, center)
{

	var doc = null;
//	if (parent.bannerFrame == null && bannerFrame != null) {
//		doc = bannerFrame.document;
/*	} else*/ 

	if (parent.bannerFrame !=null && parent.bannerFrame.document != null){
		doc = parent.bannerFrame.document;
	}

	if (doc != null)
	{
	   	doc.open('text/html','replace');
		doc.write('<HTML>'); 
		doc.write('');
		doc.write('<BODY bgcolor="#316796">'); 
		doc.write('<table><tr><td bgcolor="#FFFFFF"><p><a target="_top" href="http://www.rienbouw.nl/index.htm"><img border="0" src="http://www.rienbouw.nl/rienbouw_nl.jpg"></a></p></td>');
		doc.write("<td><center>");
		doc.write('<i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT face="Arial Rounded MT" size=5 color="#FFFFFF">' + bannerText + "</i></td>");
		doc.write('</HTML></BODY>'); 
		doc.close();
	}
}

function getLanguageFlag()
{
  	if (getLanguage() == "en") {
		return "nl.gif"
	}
	else {
		return "uk.gif"
	}
}

function getAlt() {
	if (getLanguage() == "nl") {
		return "Switch to English";
	} else {
		return "Schakel over naar Nederlands";
	}
}

function readCookie(naam) {

	var search = naam + "=";
	if (document.cookie.length > 0) { 
		offset = document.cookie.indexOf(search);
		if (offset != -1) { 
			offset += search.length;
			end = document.cookie.indexOf(";", offset)
			if (end == -1) {
				end = document.cookie.length;
			}
			return unescape(document.cookie.substring(offset, end));
		}
	} else {
		return null;
	}
}

function writeCookie(naam, value) {
	var expdate=new Date();
    // cookie is na 10 jaar niet meer geldig
    expdate.setTime(expdate.getTime()+10*365*24*60*60*1000);
    document.cookie = naam + "=" + escape(value) + 
	    "; expires= " + expdate.toGMTString();
}

function toggleMe(a){
  var e=document.getElementById(a);
  if(!e)return true;
  if(e.style.display=="none"){
    e.style.display="block"
  } else {
    e.style.display="none"
  }
  return true;
}


