// JavaScript Document
function getMenu(xurl) {
				var nid = document.menuform.menu.options[document.menuform.menu.selectedIndex].value;
				window.location = xurl + "&id=" + nid ;
			}

function verwijder(bericht, url) {
	if(confirm(bericht)) location.href = url;
}

function verwijdermenu(bericht, url) {
	if(confirm(bericht)) {
		getMenu(url);
	}
}





var vorig_width = new Array();
var vorig_height = new Array();
	
function resize()
{
	image = document.images;
   
	for(i = 0; i < image.length; i++)
	{
		id_tag = image[i].getAttribute('id')
        
		if(id_tag == 'contentimg')
		{
			if(image[i].width > 470)
			{
			   vorig_width[image[i].src] = image[i].width;
			   vorig_height[image[i].src] = image[i].height;

			   image[i].width = 470;
			   image[i].style.border = "#000 1px dashed";
			   image[i].style.cursor = "hand";
			   image[i].height = Math.floor(image[i].height/(image[i].width/490));
			   image[i].alt = 'Originele grootte: ' + vorig_width[image[i].src] + ' x ' + vorig_height[image[i].src];
			}
		}
	}
}

window.onload = function() { resize(); }; 



function image_fullscreen(image)
{
	width = vorig_width[image];
	height = vorig_height[image];

	if(width > 470)
	{
		scrollbar = 0;
		target = image;

		if(width > screen.availWidth)
		{
			scrollbar = 1;
			width = screen.availWidth;
		}

		if(height > screen.availHeight)	
		{
			scrollbar = 1;
			height = screen.availHeight;
    	}

		full = window.open(target, "_blank");
	}
}





			
			
			
			
function bb(tago, tagc) {
	comp = navigator.userAgent.toLowerCase(); 
	vers = parseInt(navigator.appVersion);
	msie = ((comp.indexOf("msie") != -1) && (comp.indexOf("opera") == -1));
	win  = ((comp.indexOf("win")!=-1) || (comp.indexOf("16bit") != -1));
	
	if ((vers >= 4) && msie && win) {
		selectie = document.selection.createRange().text;
		if (!selectie) {
			document.form.tekst.value += tago + " " + tagc;
			document.form.tekst.focus();
			return;
		}else	{
			document.selection.createRange().text = tago + selectie + tagc;
			document.form.tekst.focus();
			return;
		}
		if (document.form.tekst.createTextRange) {
			document.form.tekst.caretPos = document.selection.createRange().duplicate();
		} else{
			document.form.tekst.value += tago+ " " + tagc;
			document.form.tekst.focus();
		}
	}
}













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_preloadImages() { //v3.0
  var d=document; if(d.images){ 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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}


function checklinkform ( form )
{	
  if (form.submitternaam.value == "" || form.submitternaam.value == 'jouw naam' ||
  		form.naam.value == "" || form.naam.value == 'naam bij de link' ||
		form.url.value == "" || form.url.value == 'http://' ) {
  
  	alert( "Vul alle velden in!" );
	
    return false ;
  }
  if(form.omschrijving.value == 'omschrijving'){ form.omschrijving.value = ''};
  
  return true ;
}