function tekenPlusLayout()
{
	layout.renderPlusLayout(); 
} 

/* 
JS van de classe Layout : het tekenen van de verschillende panels  
*/ 

function Layout() 
{
	//constructor : inits
	this.renderPlusLayout = Layout_renderPlusLayout;
	this.getViewportWidth = Layout_getViewportWidth; 
	this.getViewportHeight = Layout_getViewportHeight;	
	this.getElementHeight = Layout_getElementHeight;
}

function Layout_renderPlusLayout()
{
	try
	{	   
		//var x = this.getViewportWidth();
//		var y = this.getViewportHeight();
//		var titlePanelHeight = this.getElementHeight("titlePanel");
		//var mainPanel = document.getElementById("PagePanel");  	 	
		//mainPanel.style.height = parseInt(y - Math.min(titlePanelHeight, y)) + "px";

	}
	catch(e)
	{
		ShowError(e, "renderPlusLayout", "Layout.js", "");
	} 
}


function Layout_getViewportWidth() 
{
	try
	{	
		var x = 0;
		if (window.innerWidth) 
			x = window.innerWidth; 
		else if (document.documentElement && document.documentElement.clientWidth) 
			x = document.documentElement.clientWidth; 
		else if (document.body)  
			x = document.body.clientWidth; 
				
		return x;
	}	
	catch(e)
	{
		ShowError(e, "getViewportWidth", "Layout.js", "");
	} 
}

function Layout_getViewportHeight() 
{
	try
	{
		var y = 0;
		if (window.innerHeight) 
			y = window.innerHeight; 
		else if (document.documentElement && document.documentElement.clientHeight) 
			y = document.documentElement.clientHeight; 
		else if (document.body)  
			y = document.body.clientHeight; 
			
		return y;
	}	
	catch(e)
	{
		ShowError(e, "getViewportHeight", "Layout.js", "");
	} 
}

function Layout_getElementHeight(elementId) 
{
	try
	{	
		var element = document.getElementById(elementId);
		var x = element.clientHeight; 				
		return x;
	}	
	catch(e)
	{
		ShowError(e, "getElementHeight", "Layout.js", "");
	} 
}

var layout = new Layout();

//vinkjes
function toon(evt)
{
  var subId;
  var div;
  try
  { 
	div = document.getElementById(evt.id.replace('chk', 'div'));
    if (evt.checked)
		div.className = "";
	else
		div.className = "verborgen";
  }
  catch(e)
  {
		var params = "";
		if ((evt) && (evt.id))  
			params = evt.id;
		ShowError(e, "toon", "Brutonetto.js", params);  
  }
}

function checkToon()
{
  try
  { 
		toonbouw();
		var divs = document.getElementsByTagName('div');
		for (var i = 0; i< divs.length; i++)
		{
			if (divs[i].className == "verborgen")
				{
					var chk = document.getElementById(divs[i].id.replace('div', 'chk'));
					toon(chk);
				}
		}	
  }
  catch(e)
  {
		var params = "";
		ShowError(e, "toon", "Brutonetto.js", params);  
  }
}

function toonbouw()
{
  try
  {
	var ddl;
	ddl = document.getElementById("ctlBN_ddlParitairComite");
	if (ddl != null)
		{
		var div;
		div = document.getElementById("divBouw");
		if (ddl.value == "1240000")
			div.className = "";
		else
			div.className = "verborgen";
		}
  }
  catch(e)
  {
		var params = "";
		if ((evt) && (evt.id))  
			params = evt.id;
		ShowError(e, "toon", "Brutonetto.js", params);  
  }
}

function ShowError(err, ffunctie, fpage, fparams)
{
var fstr, fmsg, ftype; 
	
	fmsg = err.message;
	ftype = err.name;
	if (err.lineNumber)
		flyn = err.lineNumber;
	else
		flyn = 0;	
	fstr = "foutboodschap=" + fmsg + "&fouttype=" + ftype + "&foutfunctie=" + ffunctie + "&foutpage=" + fpage + "&foutlijn=" + flyn + "&foutparams=" + fparams;
	
	//var str = parent.location.href;   //http://localhost/Q/QInternetClient/_Start/Default.aspx
	var str = parent.location.pathname.toLowerCase();	//Q/QInternetClient/_Start/Default.aspx
	var idx = str.indexOf("_plus", 0);
	var str2 = parent.location.pathname.substr(0, idx) + "ApplicationErrorJavaPage.aspx?" + fstr;
   	parent.location.replace(str2);
} 

function ShowErrorWindow(msg, url, lno)
{
var params; 	
	 
	params = "foutboodschap=" + msg + "&fouttype=window.onerror" + "&foutlijn=" + lno + "&foutpage=" + url;
	
	var str = parent.location.pathname.toLowerCase();	
	var idx = str.indexOf("_plus", 0);
	var str2 = parent.location.pathname.substr(0, idx) + "ApplicationErrorJavaPage.aspx?" + params;
   	parent.location.replace(str2);
   	   	
    return true;
}

