// Snelle functie voor getElementByid
function gebid(id) {
	return document.getElementByid(id);
}

// Selecteer een gebied van een pagina
function selecteren (id) {
	if (document.selection) {
		var range = document.body.createTextRange();
		range.moveToElementText(id);
		range.select();
	}
	else if (window.getSelection) {
		var range = document.createRange();
		range.selectNodeContents(het_id);
		var selection = window.getSelection();
		selection.removeAllRanges();
		selection.addRange(range);
	}
}

// te grote afbeeldingen in popup weergeven
function popupafb() {
	var winwidth = (this.naturalWidth < screen.availWidth ? this.naturalWidth : screen.availWidth)+16;
	var winheight = (this.naturalHeight < screen.availHeight ? this.naturalHeight : screen.availHeight)+16;
	openvenster(this.src,'',winwidth,winheight);
}

function openvenster(url,winname,width,height) {
	var popup = window.open(url,winname,'toolbar=no,location=no,menubar=no,width='+width+',height='+height+',resizable=yes,status=no,scrollbars=auto,left=0,top=0');
	try{ popup.focus();} catch(e) {}
}

// te grote afbeeldingen verkleinen
function img(afb) {
	maxbreedte = screen.width-505;
	orgbreedte = afb.width;
	orghoogte = afb.height;
	verhouding = orgbreedte/orghoogte;
	if(orgbreedte > maxbreedte){
		afb.width = 495;
		afb.height = Math.round((maxbreedte/verhouding));
		afb.onclick = popupafb;
		afb.style.cursor = "pointer";
		afb.style.border = "1px dashed white";
	}
}

function showhide(id, change){
	if(document.getElementById('d_'+id).style.display == 'none'){
		document.getElementById('d_'+id).style.display = 'block';
		if (change == 1){ //Change link
			document.getElementById('l_'+id).innerHTML = '<a href="javascript:showhide(\''+id+'\');" title="Verbergen">-</a> ';
		}
		//document.cookie = 'rctisland_display_d_'+id+'=0;expires=Thu, 01-Jan-1970 00:00:01 GMT;';
	}
	else{
		document.getElementById('d_'+id).style.display = 'none';
		if (change == 1){ //Change link
			document.getElementById('l_'+id).innerHTML = '<a href="javascript:showhide(\''+id+'\');" title="Weergeven">+</a> ';		
		}
		//document.cookie = 'rctisland_display_d_'+id+'=1;';		
	}
}