// Created By Shah Ansari 20 aug 2003
var bw = new lib_bwcheck();

var ElementOne
var ElementTwo
var GoOnTrue = false

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion;
	this.agent=navigator.userAgent;
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.moz= (this.agent.indexOf("Gecko/")>-1 && this.dom)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.moz || this.ns4 || this.ns6 || this.opera5 || this.dom)
	return this
}

if (bw.ie)
	document.onreadystatechange  = StartPage
else
	window.setTimeout("initPage()", 500);

function makeReadOnly(oThis){oThis.readOnly	= true}
function makeDisabled(oThis){oThis.disabled	= true}
function StartPage(){if (document.readyState == 'complete'){initPage();}}

function initPage()
{
    if ( document.forms.length > 0 )
    {
	    if (document.forms[0]['WoonhuisData.Woning.Buitenzijde'])
		    if (document.forms[0]['WoonhuisData.Woning.Bouwaard'].value != "Houtskeletbouw")
			    HideShowThis(document.forms[0]['WoonhuisData.Woning.Bouwaard'],document.forms[0]['WoonhuisData.Woning.Buitenzijde'],"Houtskeletbouw")

	    if (document.forms[0]['WoonhuisData.IBW.GebDatumJKday'])
		    HideShowThis(document.forms[0]['WoonhuisData.IBW.BurgerlijkeStaat'],document.forms[0]['WoonhuisData.IBW.GebDatumJKday'], 'AlleenstaandMetKinderen', 'EchtpaarSamenwMetKinderen')

	    if ( document.forms[0]['WoonhuisData.HBW.FunderingC'])
	    {
		    setFunderingC();
	    }
	}
}

function setFunderingC()
{
	if (document.forms[0]['WoonhuisData.HBW.FunderingA'][1].checked)
		document.forms[0]['WoonhuisData.HBW.FunderingC'][0].parentNode.parentNode.style.display = 'none'
	else
		document.forms[0]['WoonhuisData.HBW.FunderingC'][0].parentNode.parentNode.style.display = ''
}
function ShowHideNextElement2(oThis,sDestElementName,pParameters,sSetAction)
{
	var ThisElement
	ThisElement = document.getElementById(sDestElementName)

	if (ThisElement == null)
	{
		ThisElement = document.forms[0][sDestElementName]
		if (typeof(ThisElement.type) == "undefined")
			ThisElement = document.forms[0][sDestElementName][0]
	}

	if(ThisElement)
		if (pParameters.indexOf(oThis.value+';') >= 0)
			ThisElement.parentNode.parentNode.style.display = ""
		else
			if (ThisElement.parentNode.parentNode.tagName == "TR")
				ThisElement.parentNode.parentNode.style.display = "none"
	else
		if (pParameters.indexOf(oThis.value) > 0)
			if (sSetAction != "")
				if (ThisElement)
					DoAction(sSetAction)

}

function ShowHideNextElement(oThis,sDestElementName,pParameterOne,pParameterTwo,sSetAction)
{

	var ThisElement
	ThisElement = document.getElementById(sDestElementName)
	if (ThisElement == null)
	{
		ThisElement = document.forms[0][sDestElementName]
		if (typeof(ThisElement.type) == "undefined")
			ThisElement = document.forms[0][sDestElementName][0]
	}	
	if(ThisElement)
		HideShowThis(oThis,ThisElement,pParameterOne,pParameterTwo)
	else
		if (oThis.value == pParameterOne || oThis.value == pParameterTwo)
			if (sSetAction != "")
				if (ThisElement)
					DoAction(sSetAction)
}

function HideShowThis(oThis,ThisElement,pParameterOne,pParameterTwo)
{
	if (oThis.value != pParameterOne && oThis.value != pParameterTwo)
	{
		if (ThisElement.parentNode.parentNode.tagName == "TR")
		{
//			ThisElement.parentNode.parentNode.style.visibility = 'hidden'
			ThisElement.parentNode.parentNode.style.display = "none"
		}
	}
	else
	{
		if (ThisElement.parentNode.parentNode.style.visibility != "visible")
		{
//			ThisElement.parentNode.parentNode.style.visibility = "visible"
			ThisElement.parentNode.parentNode.style.display = ""
		}
	}
}
