// JavaScript Document

function startSliceShows(){
	var nrOfSlidesShow1=9;
	var nrOfSlidesShow2=14;
	var nrOfSlidesShow3=6;
	
	var firstFrameIndex=1;
	var startSlideShow1=Math.floor(Math.random( ) * nrOfSlidesShow1 - firstFrameIndex + 1) + firstFrameIndex;
	var startSlideShow2=Math.floor(Math.random( ) * nrOfSlidesShow2 - firstFrameIndex + 1) + firstFrameIndex;
	var startSlideShow3=Math.floor(Math.random( ) * nrOfSlidesShow3 - firstFrameIndex + 1) + firstFrameIndex;
	
	$('slideshow1_'+startSlideShow1 ).show();	
	$('slideshow2_'+startSlideShow2 ).show();
	$('slideshow3_'+startSlideShow3 ).show();
	
	setTimeout(switch_slides('slideshow1_',startSlideShow1,firstFrameIndex, nrOfSlidesShow1, 24000), 16000);
	setTimeout(switch_slides('slideshow2_',startSlideShow2,firstFrameIndex, nrOfSlidesShow2, 24000), 8000);
	setTimeout(switch_slides('slideshow3_',startSlideShow3,firstFrameIndex, nrOfSlidesShow3, 24000), 24000);
}
function beforeBodyLoad(){
	displayNoneByJS();//Apply class="displayNoneByJS"
	//adaptContentToBrowserHeight();
	reloadTextSize();
}
function onBodyLoad(){
	/*
	var vertMenuFromUL_activePath=[];
	var vertMenuFromULBlue_activePath=[0];
	var vertMenuFromULRed_activePath=[0];
	var vertMenuFromULGreen_activePath=[0];
	var vertMenuFromULTail_activePath=[];
	*/
	
	if( $('vertMenuFromUL') != null ){
		if( typeof(vertMenuFromUL_activePath) != 'undefined' ){
			listHighlightAndCollapse($('vertMenuFromUL'),vertMenuFromUL_activePath);
		}//else{//Depth of the list will not be changed }	
		$('vertMenuFromUL').className = "";			//undo displayNoneByJS
	}
	if( $('vertMenuFromULLuik1') != null ){	
		if(typeof(vertMenuFromULLuik1_activePath) != 'undefined' ){
			listHighlightAndCollapse($('vertMenuFromULLuik1'),vertMenuFromULLuik1_activePath);
		}//else{//Depth of the list will not be changed }	
		$('vertMenuFromULLuik1').className = "";		//undo displayNoneByJS
	}
	if( $('vertMenuFromULLuik2') != null ){	
		if(typeof(vertMenuFromULLuik2_activePath) != 'undefined' ){
			listHighlightAndCollapse($('vertMenuFromULLuik2'),vertMenuFromULLuik2_activePath);
		}//else{//Depth of the list will not be changed }	
		$('vertMenuFromULLuik2').className = "";		//undo displayNoneByJS
	}
	if( $("vertMenuFromULLuik3") != null ){	
		if(typeof(vertMenuFromULLuik3_activePath) != 'undefined' ){
			listHighlightAndCollapse($("vertMenuFromULLuik3"),vertMenuFromULLuik3_activePath);
		}//else{//Depth of the list will not be changed }	
		$("vertMenuFromULLuik3").className = "";	//undo displayNoneByJS
	}
	if( $("vertMenuFromULTail") != null ){	
		if(typeof(vertMenuFromULTail_activePath) != 'undefined' ){
			listHighlightAndCollapse($("vertMenuFromULTail"),vertMenuFromULTail_activePath);
		}//else{//Depth of the list will not be changed }	
		$("vertMenuFromULTail").className = "";		//undo displayNoneByJS
	}
	adaptContentToBrowserHeight();	

	startSliceShows();
	
	reloadTextSize();
	$("changeSizes").style.visibility="visible";
}
function adaptContentToBrowserHeight(){
	$('minHeight').style.height = document.body.parentNode.clientHeight-285-75 + 'px';
	rule = getCSSRule(".hightByJS");
	if(rule){
		rule.style.height = document.body.parentNode.clientHeight-285-75 + 'px';	
	}
}
function reloadTextSize(){
	var setBigger=false;
	if(Cookie.get("steunpuntwvg_vozs_bigFont")!=null){
		if(Cookie.get("steunpuntwvg_vozs_bigFont")=="true"){
			//alert(Cookie.get("steunpuntwvg_vozs_bigFont"));
			setBigger=true;
		}
	}

	if(setBigger){
		Cookie.set("steunpuntwvg_vozs_bigFont","true",14,"/");	
		
		rule = addCSSRule(".bodyMod");
		if(rule){
			rule.style.fontSize = "18px";	
		}

		if($('vertMenuFromUL')!=null)$('vertMenuFromUL').style.fontSize = "18px";
		if($('vertMenuFromULLuik1')!=null)$('vertMenuFromULLuik1').style.fontSize = "18px";
		if($('vertMenuFromULLuik2')!=null)$('vertMenuFromULLuik2').style.fontSize = "18px";
		if($('vertMenuFromULLuik3')!=null)$('vertMenuFromULLuik3').style.fontSize = "18px";
		if($('vertMenuFromULTail')!=null)$('vertMenuFromULTail').style.fontSize = "18px";	

		if($('changeSizeBigger')!=null)$("changeSizeBigger").style.display = "none";
		if($('changeSizeSmaller')!=null)$("changeSizeSmaller").style.display = "block";	
	}else{		
		Cookie.set("steunpuntwvg_vozs_bigFont","false",14,"/");	
		
		killCSSRule(".bodyMod");
		
		if($('vertMenuFromUL')!=null)$('vertMenuFromUL').style.fontSize = null;
		if($('vertMenuFromULLuik1')!=null)$('vertMenuFromULLuik1').style.fontSize = null;
		if($('vertMenuFromULLuik2')!=null)$('vertMenuFromULLuik2').style.fontSize = null;
		if($('vertMenuFromULLuik3')!=null)$('vertMenuFromULLuik3').style.fontSize = null;
		if($('vertMenuFromULTail')!=null)$('vertMenuFromULTail').style.fontSize = null;	
		
		if($('changeSizeSmaller')!=null)$("changeSizeSmaller").style.display = "none";
		if($('changeSizeBigger')!=null)$("changeSizeBigger").style.display = "block";
		
		Cookie.erase("steunpuntwvg_vozs_bigFont");			
	}
}
function toggleTextSize() { 
	rule = getCSSRule(".bodyMod");
	
	if(rule){
		Cookie.set("steunpuntwvg_vozs_bigFont","false",14,"/");		

		killCSSRule(".bodyMod");
		
		if($('vertMenuFromUL')!=null)$('vertMenuFromUL').style.fontSize = null;
		if($('vertMenuFromULLuik1')!=null)$('vertMenuFromULLuik1').style.fontSize = null;
		if($('vertMenuFromULLuik2')!=null)$('vertMenuFromULLuik2').style.fontSize = null;
		if($('vertMenuFromULLuik3')!=null)$('vertMenuFromULLuik3').style.fontSize = null;
		if($('vertMenuFromULTail')!=null)$('vertMenuFromULTail').style.fontSize = null;
		
		if($('changeSizeSmaller')!=null)$("changeSizeSmaller").style.display = "none";
		if($('changeSizeBigger')!=null)$("changeSizeBigger").style.display = "block";
		
		Cookie.erase("steunpuntwvg_vozs_bigFont");	
	}else{
		Cookie.set("steunpuntwvg_vozs_bigFont","true",14,"/");
		
		rule = addCSSRule(".bodyMod");
		if(rule){
			rule.style.fontSize = "18px";	
		}

		if($('vertMenuFromUL')!=null)$('vertMenuFromUL').style.fontSize = "18px";
		if($('vertMenuFromULLuik1')!=null)$('vertMenuFromULLuik1').style.fontSize = "18px";
		if($('vertMenuFromULLuik2')!=null)$('vertMenuFromULLuik2').style.fontSize = "18px";
		if($('vertMenuFromULLuik3')!=null)$('vertMenuFromULLuik3').style.fontSize = "18px";
		if($('vertMenuFromULTail')!=null)$('vertMenuFromULTail').style.fontSize = "18px";	
		
		if($('changeSizeBigger')!=null)$("changeSizeBigger").style.display = "none";
		if($('changeSizeSmaller')!=null)$("changeSizeSmaller").style.display = "block";		
	}
	
	//Apply class="displayNoneByJS"
	//rule = addCSSRule(".displayNoneByJS");
	//if(rule){
	//	rule.style.display = "none";		
	//}
}


beforeBodyLoad();//Execute the beforeBodyLoad function


