// versie 2.02

// vang rechtmuisklik af down-arrow BRMC();
function BRMC(){
	document.oncontextmenu = function (){ return false;};
}

// dit is zeer handig om te kijken of een id wel bestaat voordat je iets uitvoert
// if( CheckIfIdExists( 'hier_de_id' ) ){ do something; }
function CheckIfIdExists( e ){
  	var t=typeof(e);
  	if (t == "undefined")
  		return 0;
  	else if (t == "string")
  	{
  		var re = document.getElementById( e );
  		if (!re)
  			return 0;
  		else if (typeof(re.appendChild) != "undefined" )
  			return re;
  		else
  			return 0;
  	}
  	else if (typeof(e.appendChild) != "undefined")
  		return e;
  	else
  		return 0;
}

function initBovenPlaatje() {
	var winW = document.documentElement.clientWidth;
	var winH = document.documentElement.clientHeight;
	var browserName=navigator.appName; 
	
	if (browserName=="Netscape"){ 
		if (parseInt(navigator.appVersion)>3) {
			if (navigator.appName=="Netscape") {
				winW = window.innerWidth;
				winH = window.innerHeight;
			}
		}
	}else{ 
		if (browserName=="Microsoft Internet Explorer"){
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	if( winH > 600 ){
		document.getElementById('bovenplaatje').style.height = '34px';
	}else{
		document.getElementById('bovenplaatje').style.height = '8px';
	}
}

// ######v###v### javascript BGslideShow functions #####################################
//#####v####v###                           ######v#######v#####v#######v####v######v####v######vv#######v#########
var dCimageHeight = 0.87 * g_CONFIG_imageMAXheight;
var dCimageWidthSmall = 0.3 * g_CONFIG_imageMAXwidth;
var dCimageWidthBig = 0.38 * g_CONFIG_imageMAXwidth;

var gControlImages = "<nobr><img src='images/leeg.gif' onMouseOver=\"this.style.cursor='pointer';this.style.cursor='hand';\" title='klik hier voor de vorige foto' id='prevpic' name='prevpic' height='" + dCimageHeight + "' width='" + dCimageWidthSmall + "' border='0' align='left' onclick='GoToPrevPicture();'><img src='images/leeg.gif' onMouseOver=\"this.style.cursor='pointer';this.style.cursor='hand';\" title='klik hier om de slideshow te starten/stoppen' id='slide' name='slidepic' height='" + dCimageHeight + "' width='" + dCimageWidthBig + "' border=0' align='left' onclick='ToggleSlideShow();'><img src='images/leeg.gif' title='klik hier voor de volgende foto' id='nextpic' onMouseOver=\"this.style.cursor='pointer';this.style.cursor='hand';\" name='nextpic' height='" + dCimageHeight + "' width='" + dCimageWidthSmall + "' border=0' align='left' onclick='GoToNextPicture();'></nobr><br><div id=\"slideshowtext\" class=\"slideshowtext\"></div>";

// DisPlayText( 'MENU1' ) display in fotoslide DIV but first STOP slideshow
function DisPlayText( p_menu ){
	
	var sNieuweInnerHTML;

	ClearLInks( 0 );

	g_stopslideshow='yes';
	g_SHOWcurrentPicture = 'yes';
	g_NrOfPictureToPlay=0;
	g_ProjectNr=0;
	document.getElementById('fotoslide').style.backgroundImage = 'url( "images/leeg.gif" )';
	
	// look if bovenplaatje height is to big than no toppic image
	if( document.getElementById('bovenplaatje').style.height == '8px' ){
		sTableStart = '<table border="0"><tr><td valign="top"><img src="images/leeg.gif" id="toppic" width="470" height="20" border="0"><br/>';
	}else{
		sTableStart = '<table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">';
	}
	sTableEnd = '</td><td valign="top"><img src="images/leeg.gif" id="overpic" width="5" height="' + g_CONFIG_imageMAXheight + '" border="0"></td</tr></table>';
	
	var str_lengteheight = "  ";
	str_lengteheight = document.getElementById('bovenplaatje').style.height;
	
	if( p_menu=='INTRO' ){
		sNieuweInnerHTML = sTableStart ;
		if( g_intropicture ){
			sNieuweInnerHTML = sNieuweInnerHTML + '<div style=\"text-align:center;width:' + g_CONFIG_imageMAXwidth + ';\"><img src=\"images/' + g_introfotofilename + '\" name=\"intropic\" ></div><p>';
		}
		sNieuweInnerHTML = sNieuweInnerHTML + g_introtext;
	}else{
		// set powered by only with text
		document.getElementById('powered').style.display = 'inline';
	}
	
	if( p_menu=='MENU1' ){
		document.getElementById('menu1').className = 'menuvisited';
		sNieuweInnerHTML = sTableStart + g_menutxt1;
	}
	if( p_menu=='MENU2' ){
		document.getElementById('menu2').className = 'menuvisited';
		sNieuweInnerHTML = sTableStart + g_menutxt2;
	}
	if( p_menu=='MENU3' ){
		document.getElementById('menu3').className = 'menuvisited';
		sNieuweInnerHTML = sTableStart + g_menutxt3;
	}
	if( p_menu=='MENU4' ){
		document.getElementById('menu4').className = 'menuvisited';
		sNieuweInnerHTML = sTableStart + g_menutxt4;
	}
	if( p_menu=='TEXTPAGE' ){
		sNieuweInnerHTML = sTableStart + '<div style="padding-right:40px;padding-left:17px;">' + g_textpage + '</div>';
	}
	document.getElementById('fotoslide').style.textAlign = 'left';
	document.getElementById('fotoslide').innerHTML = sNieuweInnerHTML + sTableEnd;
	document.getElementById('navigatielinks').innerHTML = '';
	document.getElementById('navigatierechts').innerHTML = '';
	document.getElementById('fotoslide').style.height = 'auto';
	// zorg dat rechtermuis op plaatjes niet werkt
	BRMC();
}

// ClearLInks() clear link style: reset the styles of the divs from the menu's
function ClearLInks( p_notthis ){
	
	document.getElementById('menu1').className= 'menu';
	document.getElementById('menu2').className= 'menu';
	document.getElementById('menu3').className= 'menu';
	document.getElementById('menu4').className= 'menu';
	
	if( p_notthis != 1 && 1 <= g_nr_of_projects ){
		document.getElementById( 'projtext1' ).className = 'projectmenu';
	}
	if( p_notthis != 2 && 2 <= g_nr_of_projects ){
		document.getElementById( 'projtext2' ).className = 'projectmenu';
	}
	if( p_notthis != 3 && 3 <= g_nr_of_projects ){
		document.getElementById( 'projtext3' ).className = 'projectmenu';
	}
	if( p_notthis != 4 && 4 <= g_nr_of_projects ){
		document.getElementById( 'projtext4' ).className = 'projectmenu';
	}
	if( p_notthis != 5 && 5 <= g_nr_of_projects ){
		document.getElementById( 'projtext5' ).className = 'projectmenu';
	}
	if( p_notthis != 6 && 6 <= g_nr_of_projects ){
		document.getElementById( 'projtext6' ).className = 'projectmenu';
	}
	if( p_notthis != 7 && 7 <= g_nr_of_projects ){
		document.getElementById( 'projtext7' ).className = 'projectmenu';
	}
	if( p_notthis != 8 && 8 <= g_nr_of_projects ){
		document.getElementById( 'projtext8' ).className = 'projectmenu';
	}
	if( p_notthis != 9 && 9 <= g_nr_of_projects ){
		document.getElementById( 'projtext9' ).className = 'projectmenu';
	}
	if( p_notthis != 10 && 10 <= g_nr_of_projects ){
		document.getElementById( 'projtext10' ).className = 'projectmenu';
	}
	if( p_notthis != 11 && 11 <= g_nr_of_projects ){
		document.getElementById( 'projtext11' ).className = 'projectmenu';
	}
	if( p_notthis != 12 && 12 <= g_nr_of_projects ){
		document.getElementById( 'projtext12' ).className = 'projectmenu';
	}
	if( p_notthis != 13 && 13 <= g_nr_of_projects ){
		document.getElementById( 'projtext13' ).className = 'projectmenu';
	}
	if( p_notthis != 14 && 14 <= g_nr_of_projects ){
		document.getElementById( 'projtext14' ).className = 'projectmenu';
	}
	if( p_notthis != 15 && 15 <= g_nr_of_projects ){
		document.getElementById( 'projtext15' ).className = 'projectmenu';
	}
	if( p_notthis != 16 && 16 <= g_nr_of_projects ){
		document.getElementById( 'projtext16' ).className = 'projectmenu';
	}
	if( p_notthis != 17 && 17 <= g_nr_of_projects ){
		document.getElementById( 'projtext17' ).className = 'projectmenu';
	}
	if( p_notthis != 18 && 18 <= g_nr_of_projects ){
		document.getElementById( 'projtext18' ).className = 'projectmenu';
	}
	if( p_notthis != 19 && 19 <= g_nr_of_projects ){
		document.getElementById( 'projtext19' ).className = 'projectmenu';
	}
	if( p_notthis != 20 && 20 <= g_nr_of_projects ){
		document.getElementById( 'projtext20' ).className = 'projectmenu';
	}
	if( p_notthis != 21 && 21 <= g_nr_of_projects ){
		document.getElementById( 'projtext21' ).className = 'projectmenu';
	}
	if( p_notthis != 22 && 22 <= g_nr_of_projects ){
		document.getElementById( 'projtext22' ).className = 'projectmenu';
	}
	if( p_notthis != 23 && 23 <= g_nr_of_projects ){
		document.getElementById( 'projtext23' ).className = 'projectmenu';
	}
	if( p_notthis != 24 && 24 <= g_nr_of_projects ){
		document.getElementById( 'projtext24' ).className = 'projectmenu';
	}
	if( p_notthis != 25 && 25 <= g_nr_of_projects ){
		document.getElementById( 'projtext25' ).className = 'projectmenu';
	}
}

// ClearText( p_notthis ) clear display in fotoslide DIV but first STOP slideshow
function ClearText( p_notthis ){	
	ClearLInks( p_notthis );
	document.getElementById('fotoslide').innerHTML = gControlImages;
	document.getElementById('fotoslide').style.height = g_CONFIG_imageMAXheight + 'px';
	document.getElementById('navigatielinks').innerHTML = '<a href="javascript:GoToPrevPicture();" class="navigation">&lt;&lt;</a>';
	document.getElementById('navigatierechts').innerHTML = '<a href="javascript:GoToNextPicture();" class="navigation">&gt;&gt;</a>';
}

