// JavaScript Document
//zie Ollerton/_templates/startpagina.tpl voor de functieaanroepen ****************************

// menuitem Swap Images ***********************************************************************
	function showElementA(){
		if (document.layers) {crossb = document.Aid}
		if (document.all) {crossb = Aid.style}     
		crossb.visibility="visible";
	}
	
	function hideElementA(){
		if (document.layers) {crossb = document.Aid}
		if (document.all) {crossb = Aid.style}     
		crossb.visibility="hidden";
	}
	
	// menuitem B
	function showElementB(){
		if (document.layers) {crossb = document.Bid}
		if (document.all) {crossb = Bid.style}     
		crossb.visibility="visible";
	}
	
	function hideElementB(){
		if (document.layers) {crossb = document.Bid}
		if (document.all) {crossb = Bid.style}     
		crossb.visibility="hidden";
	}
	
	// menuitem C
	function showElementC(){
		if (document.layers) {crossb = document.Cid}
		if (document.all) {crossb = Cid.style}     
		crossb.visibility="visible";
	}
	
	function hideElementC(){
		if (document.layers) {crossb = document.Cid}
		if (document.all) {crossb = Cid.style}     
		crossb.visibility="hidden";
	}
	
	// menuitem D
	function showElementD(){
		if (document.layers) {crossb = document.Did}
		if (document.all) {crossb = Did.style}     
		crossb.visibility="visible";
	}
	
	function hideElementD(){
		if (document.layers) {crossb = document.Did}
		if (document.all) {crossb = Did.style}     
		crossb.visibility="hidden";
	}
	
	// menuitem E
	function showElementE(){
		if (document.layers) {crossb = document.Eid}
		if (document.all) {crossb = Eid.style}     
		crossb.visibility="visible";
	}
	
	function hideElementE(){
		if (document.layers) {crossb = document.Eid}
		if (document.all) {crossb = Eid.style}     
		crossb.visibility="hidden";
	}
	
	// menuitem F
	function showElementF(){
		if (document.layers) {crossb = document.Fid}
		if (document.all) {crossb = Fid.style}     
		crossb.visibility="visible";
	}
	
	function hideElementF(){
		if (document.layers) {crossb = document.Fid}
		if (document.all) {crossb = Fid.style}     
		crossb.visibility="hidden";
	}
	
	// menuitem G
	function showElementG(){
		if (document.layers) {crossb = document.Gid}
		if (document.all) {crossb = Gid.style}     
		crossb.visibility="visible";
	}
	
	function hideElementG(){
		if (document.layers) {crossb = document.Gid}
		if (document.all) {crossb = Gid.style}     
		crossb.visibility="hidden";
	}
	
	// menuitem H
	function showElementH(){
		if (document.layers) {crossb = document.Hid}
		if (document.all) {crossb = Hid.style}     
		crossb.visibility="visible";
	}
	
	function hideElementH(){
		if (document.layers) {crossb = document.Hid}
		if (document.all) {crossb = Hid.style}     
		crossb.visibility="hidden";
	}
	
// Ondersteuning voor het swappen van images ***********************************************************
	
	function MM_swapImgRestore() { //v3.0
		var i,x,a=document.MM_sr;
		
		for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
			x.src=x.oSrc;
	}
		
	function MM_swapImage() { //v3.0
		var i,j=0,x,a=MM_swapImage.arguments;
		
		document.MM_sr=new Array;
		for(i=0;i<(a.length-2);i+=3)
			if ((x=MM_findObj(a[i]))!=null) {
				document.MM_sr[j++]=x;
				if(!x.oSrc)
					x.oSrc=x.src;
				x.src=a[i+2];
			}
	}


// Preload images ***********************************************************
	function MM_preloadImages() { //v3.0
		var d=document;
		
		if(d.img){
			if(!d.MM_p)
				d.MM_p=new Array();

	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		
		for(i=0; i<a.length; i++)
	    	if (a[i].indexOf("#")!=0) {
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
		}
	}

	function MM_findObj(n, d) { //v3.0
		var p,i,x;
		
		if(!d)
			d=document;
		if((p=n.indexOf("?"))>0&&parent.frames.length) {
		    d=parent.frames[n.substring(p+1)].document;
			n=n.substring(0,p);
		}
  		if(!(x=d[n])&&d.all)
			x=d.all[n];
		for (i=0;!x&&i<d.forms.length;i++)
			x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++)
			x=MM_findObj(n,d.layers[i].document);
		return x;
	}
	
	   function changeBgColor(td, color) {
       if (document.getElementById){
		document.getElementById(td).style.backgroundColor = color;}
	}
	
// Popup functie ***********************************************************************************************************
	var win=null;
	function popup(mypage,myname,w,h,pos,infocus){
	if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
	settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
	win.focus();}
	
	
	function openpopup(){
	var popurl="SanTwee"
	winpops=window.open(popurl,"","width=400,height=338,")
	}


//fotoslider **********************************************************************************************************************
var slidespeed=3000

//specify images
var slideimages=new Array("../images/menu/meubilair2.jpg","../images/menu/skate.jpg","../images/menu/Constructies.jpg" ,"../images/menu/speeltoestellen.gif","../images/menu/fietsparkeer.jpg","../images/menu/fitness.jpg","../images/menu/overkappingen.jpg","../images/menu/diversen.jpg")

//specify corresponding links
//var slidelinks=new Array("http://www.dynamicdrive.com","http://javascriptkit.com","http://www.geocities.com")

var newwindow=1 //open links in new window? 1=yes, 0=no

var imageholder=new Array()
var ie=document.all
for (i=0;i<slideimages.length;i++){
imageholder[i]=new Image()
imageholder[i].src=slideimages[i]
}

function gotoshow(){
if (newwindow)
window.open(slidelinks[whichlink])
else
window.location=slidelinks[whichlink]
}

//******************************
//zorgt ervoor dat de button die deze functie aanroept ook werkt door op enter te drukken(Gebruikt in Login.aspx)
function KeyDownHandler(btn)
{
    // process only the Enter key
    if (event.keyCode == 13)
    {
        // cancel the default submit
        event.returnValue=false;
        event.cancel = true;
        // submit the form by programmatically clicking the specified button
        btn.click();
    }
}