

function stopError() {
	return true; }
	window.onerror = stopError;

function Goto_Url(form,c2) {
	form.submit()
}

function Goto_Url2(form)	{
	c1 = form.elements['service'].options[form.elements['service'].selectedIndex].value
	form.action = c1
	form.submit()
}

function PopUpWindow(url,h,w,scroll) {
	var sc = scroll
	var ht = h;
	var wt = w;
	popupwindow = window.open(url,"FileWindow",'height='+ ht +',width='+ wt +',location=no,toolbar=no,menubar=no,scrollbars=' + sc +',resizable=yes');
	popupwindow.moveTo(0,0);
	popupwindow.focus();
}

function dynWindow(url,h,w) {
var ht = h;
var wt = w;
window.open(url,"FileWindow",'height='+ ht +',width='+ wt +',location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes');
}

function createImageWindows(imageThumbnails,width) 
{
	for(var index=0;index<imageThumbnails.length;index++)
	{
		if(imageThumbnails[index].nodeName.toLowerCase()=="img") createImageWindow(imageThumbnails[index],width);
	}
}

function createImageWindow(imageNode,resizeFactor) 
{
	if(imageNode==null)
		throw new Error("The first argument of createImageWindow() must be an element node containing images!");
	else
	{
		var width = Math.ceil(imageNode.width*(resizeFactor|1)) , height = Math.ceil(imageNode.height*(resizeFactor|1));
		var url = imageNode.src.replace("_thumb","");

		imageWindow = window.open(url,"imageWindow",(window.innerWidth&&window.innerHeight?('innerHeight='+height+',innerWidth='+width):('height='+height+',width='+width)) +',location=no,toolbar=no,menubar=no,scrollbars=no,resizable=no');
		imageWindow.document.write
		(
			"<html>"
		+		"<head>"
		+			"<title>"
		+				(imageNode.title?imageNode.title:url) + " (Click image to close window)"
		+			"</title>"
		+		"</head>"
		+		"<body style='margin:0px 0px 0px 0px;background-image:url(" + url + ");background-repeat:no-repeat;width:100%;height:100%;' onClick='window.close();'>"
		+		"</body>"
		+	"</html>"
		);
		imageWindow.document.close();
		imageWindow.focus();

		resizeWindow(imageWindow,width,height);
	}
}

function resizeWindow(targetWindow,width,height)
{				
	if(window.innerWidth&&window.innerHeight)
	{
		targetWindow.innerWidth = width;
		targetWindow.innerHeight = height;
	}
	else if (window.resizeTo)
	{
		targetWindow.resizeTo(width+10,height+35); // moet beter
	}
	else
	{}
}

function printWindow(url)
{
	printwin = window.open(url,"popup",'height=600,width=600,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
}

function showhide(id) 
{ 
	var style	= document.getElementById(id).style; 
	var img	= document.getElementById('img' + id); 
	
	if  (style.display == "block")
	{
		style.display = "none";
		img.src = "/grfx/expand.gif";
	}
	else
	{
		style.display = "block";
		img.src = "/grfx/collapse.gif";
	}
} 

