function newWin(url,img,title,w,h) { 
	if (! (url) &&! (img)) { return; } 
	var day,id,ww,wh,params,baseHeight,win; 
	// This insures the images always open in a NEW window 
	//instead of populating one that's left open. 
	day= new Date(); 
	id = day.getTime(); 
	// Pad it a bit for scrollbars if passing an image size 
	ww = (url)?w:w+75; 
	wh = (url)?h:h+150; 
	// In case you really **don't** have all the bases covered, allow scroll and resize 
	params = 'width='+ww+',height='+wh+',scrollbars,resizable'; 
	// Have you ever had windows falling off the bottom of the screen? 
	// Remember how mad you were. Never assume you know how many toolbars will be on 
	// if you're inside the window or what resolution is "best" if you're out. 
	if (screen.height) { baseHeight = screen.height; } 
	if (! baseHeight > 0 ) { baseHeight= 600; } 
	wh = (wh>baseHeight)?baseHeight:wh; 
	// if passing an image, write a doc 
	if (url=='') { 
		msg='<html><head><title>'+title+'<\/title>\n'+ 
		'<style type="text\/css">\n'+ 
		'html,body,div { font-family:Arial,Helvetica,Sans-Serif; \n'+ 
		'background-image: url(images/popup.png); }\n'+
		'img { border-bottom: 0px solid; border-left: 0px solid; border-top: 0px solid; border-right: 0px solid; }\n'+
		'<\/style><\/head><body><div align="center"><h3>'+title+'<\/h3>\n'+ 
		'<img src="'+img+'" width="'+w+'" height="'+h+'" border="0" ALT="'+title+'">\n'+ 
		'<hr width="100%" size="1"><form action="" onSubmit="return false;">\n'+ 
		'<input type="submit" onclick="javascript:window.close();" value="Venster sluiten">\n'+ 
		'<hr width="100%" size="1"><\/form><\/div><\/body><\/html>\n'; 
		win = open('',id,params); 
		// Upper left, as requested 
		win.moveTo(0,0); 
		win.document.write(msg); 
		win.document.close(); 
	} 
	else { win = open(url,id,params); win.moveTo(0,0); } 
} 

function refreshimage(){
	document.getElementById('vertimg').src = document.getElementById('vertimg').src + '#';
	document.getElementById('code').value="";
	document.getElementById('code').focus()
	window.scroll(0,document.body.scrollHeight);
}

function getdata(what, dest) {
	var url = "toon.php?"+what;
	try { 
		xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); 
	} catch (e) { 
	} 
	xmlhttp.onreadystatechange = triggered; 
	
	xmlhttp.open("GET", url); 
	xmlhttp.send(null); 
}

function triggered() { 
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) { 
		document.getElementById("maincontent").innerHTML = xmlhttp.responseText; 
	} 
} 

function getObj(name){     
    if (document.getElementById){         
        this.obj = document.getElementById(name);         
        this.style = document.getElementById(name).style;
    }     
    else if (document.all){         
        this.obj = document.all[name];         
        this.style = document.all[name].style;     
    } 
} 

function resize() {                                
	var height = document.getElementById('maincontent').offsetHeight;
    var xheight = document.getElementById('divbg').offsetHeight;
    xContent = new getObj('divbg'); 
}

