	
	
	function eid(o){return document.getElementById(o)}
	
	function bookmarkSite(sitenaam) {
			
		var name = sitenaam;
		var url = 'http://beeldbank.thegreenery.com/';
		
		if (window.sidebar) {
			window.sidebar.addPanel(name, url,"");
		} else if (document.all) {
			window.external.AddFavorite(url, name);
		}
		
	}
	
	function checkField(bestandsnaam) {
		if(document.form1.bestandsnaam.value==bestandsnaam) document.form1.bestandsnaam.value='';
	}
	
	function checkFieldB(bestandsnaam) {
		if(document.form1.bestandsnaam.value=='') document.form1.bestandsnaam.value=bestandsnaam;
	}
	
	function checkFieldEmail(email) {
		if(document.form2.email.value==email) document.form2.email.value='';
	}
	
	function checkFieldBEmail(email) {
		if(document.form2.email.value=='') document.form2.email.value=email;
	}
	
	function checkFieldww(wachtwoord) {
		wwt = document.form2.wachtwoordT;
		wwp = document.form2.wachtwoord1;

		wwt.style.display = 'none'
		wwp.style.display = ''

		if( (wwt.value==wachtwoord && wwp.value=='') || wwp.value==wachtwoord ){
			wwp.value='';
		}
		wwp.focus();
		
	}
	
	function checkFieldBww(wachtwoord) {
		
		wwt = document.form2.wachtwoordT;
		wwp = document.form2.wachtwoord1;


		if(wwp.value==''){
			wwt.value=wachtwoord;
			wwt.style.display = ''
			wwp.style.display = 'none'
		}

	}
	
	function zoek() {
		document.form1.offset.value = '';
		document.form1.submit();
	}
	
	function clearForm(bestandsnaam) {
		document.form1.bestandsnaam.value=bestandsnaam;
		document.form1.productnaam.value='0';
		document.form1.productgroep.value='0';
		document.form1.opname.value='0';
		document.form1.ras.value='0';
		document.form1.merk.value='0';
	}

	function login() {
		document.form2.submit();
	}
	
	function voegToe(i) {
		
		document.form1.selectie.value = i;
		document.form1.submit();
	}	
	
	function NieuwVensterE(URL) {
		
		windowName = window.open(URL, "nieuw3", "width=590,height=370");	
		windowName.focus();
	}
	
	function NieuwVensterRecept(URL) {
		
		windowName = window.open(URL, "nieuw2", "width=660,height=656");	
		windowName.focus();
	}
	
	
	function showBevestiging(i, tekst) {
		oudBlok = eid("resultaatblok"+i).innerHTML;
		eid("resultaatblok"+i).innerHTML="<div class=\"thumb\" style=\"text-align: center; color: rgb(0,127,81); padding-top: 5px; font-weight: normal;\">"+tekst+"</div>";
		p=i;
		
		setTimeout("sluitBevestiging()",3000);
		
	}
	
	function sluitBevestiging() {
		
		eid("resultaatblok"+p).innerHTML= oudBlok;
		
	}
	
	function changeOffset(offset) {
		document.form1.offset.value = offset;
		document.form1.submit();
	}
	
	function changeOffsetMijSelectie(offset,pag) {
		document.form1.action = '/?pag='+pag;
		document.form1.offset.value = offset;
		document.form1.submit();
	}
	
	
	function legen(pag) {
		document.form1.offset.value = 'alles';
		document.form1.action = '/?pag='+pag;
		document.form1.submit();	
	}
	
	function verwijder(i,pag) {
		document.form1.verwijder.value = i;
		document.form1.action = '/?pag='+pag;
		document.form1.submit();
	}	
	
	
	function download(pag) {
		document.form1.lg.value = 'downloaden';
		document.form1.action = '/?pag='+pag;
		document.form1.submit();
	}	
	
	function logout(pag) {
		document.form1.lg.value = 'loguit';
		document.form1.action = '/?pag='+pag;
		document.form1.submit();
	}	
	
	//download zip en hide het aantal beelden geselecteerd in het rechterblokje
	function dwnl() {
		
		document.form2.submit();
		
		if(document.form2.verwijder_mijn_selectie.checked) {
		
			if(document.form2.reden.value!='') {
				eid("mijn_sel").innerHTML="";
				init();
			}
			
		}
		
		
	}
	
	
	
	//download zip, ga naar het volgende scherm om te downloaden
	function dwnl_zonder() {
		
		document.form2.submit();
		
	}
	
	
		
function init() {
	
	var totaal;
	var topS
	
	totaal = document.getElementById('borders').offsetHeight;
	topFooter = totaal - 32;
	document.getElementById('footer').style.top= topFooter + 'px';
	
			
}	
		
		
	function closepopup() {
		self.close ();
	}
