// JavaScript Document

// Upload popup
/*
function popup_upload() 
{
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open('http://www.hartensveld.com/eurocolor?pagename=popup_upload','" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=500,left=400,top=250');");
}
*/


// Random image
var theImages = new Array() 

theImages[0] = 'img/foto/foto01.jpg'
theImages[1] = 'img/foto/foto02.jpg'
theImages[2] = 'img/foto/foto03.jpg'
theImages[3] = 'img/foto/foto04.jpg'
theImages[4] = 'img/foto/foto05.jpg'
theImages[5] = 'img/foto/foto06.jpg'
theImages[6] = 'img/foto/foto07.jpg'
theImages[7] = 'img/foto/foto08.jpg'
theImages[8] = 'img/foto/foto09.jpg'
theImages[9] = 'img/foto/foto10.jpg'
theImages[10] = 'img/foto/foto11.jpg'
theImages[11] = 'img/foto/foto12.jpg'
theImages[12] = 'img/foto/foto13.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'" class="foto">');
}

// Open Close div
var currentShownDivID = null;
function showDiv(id) {
	if(currentShownDivID == id)	{
		return;
	}
	
	if(currentShownDivID != null) 	{
		var oldElement = document.getElementById(currentShownDivID);
		oldElement.style.display = "none";
	}
	currentShownDivID = id;
	
    newElement = document.getElementById(id);
	newElement.style.display = 'block';
	
	return;
}

// clearField

function clearField(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
} 

//captcha calc
function calcCaptcha(){
	var captcha1 = document.getElementById("captcha1");	
	var captcha2 = document.getElementById("captcha2");	
	var captchaTotal = document.getElementById("captchaTotal");		
	captchaTotal = parseInt(captcha1.value)+parseInt(captcha2.value);
	//alert(captchaTotal);
	document.getElementById("contactForm").submit();	
	return true;
}





