function PowerSearch() {
	GetToestelSoort();
}

function ddlDimensionTypeChange() {
	var ddlDimensionType = document.getElementById(ddlDimensionTypeClientId);

	if (ddlDimensionType.value == 1) {
		GetInhoud();
	}
	else
	{
		GetGasVerbruik();
	}
}

function ddlDimensionTypeChangeVisibility() {
	var ddlDimensionType = document.getElementById(ddlDimensionTypeClientId);

	if (ddlDimensionType.value == 1) {
		GetInhoud();
		document.getElementById('ATAGProductwizardformHome').style.height='83px';
		document.getElementById('productwizardhome_ddlDimension').style.visibility='visible';
		document.getElementById('productwizardhome_ddlFinalShow').style.visibility='hidden';
		void(0);
	}
	else if (ddlDimensionType.value == 2)
	{
		GetGasVerbruik();
		document.getElementById('ATAGProductwizardformHome').style.height='83px';
		document.getElementById('productwizardhome_ddlDimension').style.visibility='visible';
		document.getElementById('productwizardhome_ddlFinalShow').style.visibility='hidden';
		void(0);
	}
	else if (ddlDimensionType.value == 0)
	{
		document.getElementById('ATAGProductwizardformHome').style.height='53px';
		document.getElementById('productwizardhome_ddlDimension').style.visibility='hidden';
		document.getElementById('productwizardhome_ddlFinalShow').style.visibility='hidden';
		void(0);
	}
}

function ddlToestelTypeChange() {
	var ddlToestelType = document.getElementById(ddlToestelTypeClientId);

	if (ddlToestelType.value == 0) {
		document.getElementById('ATAGProductwizardformHome').style.height='13px';
		document.getElementById('productwizardhome_ddlDimensionType').style.visibility='hidden';
		document.getElementById('productwizardhome_ddlDimension').style.visibility='hidden';
		document.getElementById('productwizardhome_ddlFinalShow').style.visibility='hidden';
		void(0);
		document.getElementById(ddlDimensionTypeClientId).value = 0;
	}
	else
	{
		GetCwWaarde();
		document.getElementById('ATAGProductwizardformHome').style.height='53px';
		document.getElementById('productwizardhome_ddlDimensionType').style.visibility='visible';
		document.getElementById('productwizardhome_ddlDimension').style.visibility='hidden';
		document.getElementById('productwizardhome_ddlFinalShow').style.visibility='hidden';
		void(0);
	}
}

function GetCwWaarde() {
	var SelType = document.getElementById(ddlToestelTypeClientId);

	Productwizard.Ajax.GetCwWaarde(SelType.value, function(response) {
		var teamsList = document.getElementById(ddlCwWaardeClientId);
		//var teamsList = document.getElementById("ddlToestel");
		teamsList.disabled = false;

		//if the server side code threw an exception
		if (response.error != null)
		{    
			alert("A problem occurred in Productwizard:GetCwWaarde\n" + response.error.Message); //we should probably do better than this
			return;
		}  

		var teams = response.value;  
		//if the response wasn't what we expected  
		if (teams == null || typeof(teams) != "object")
		{
			alert('A problem occurred in Productwizard:GetCwWaarde');
			return;  
		}

		teamsList.options.length = 0; //reset the teams dropdown     

		//note that this is JavaScript casing and the L in length is lowercase for arrays
		//teamsList.options[teamsList.options.length] = new Option("", "");
		for (var i = 0; i < teams.Rows.length; ++i)
		{
			teamsList.options[teamsList.options.length] = new Option(teams.Rows[i].cwwaarde, teams.Rows[i].id);       
			//teamsList.options[teamsList.options.length] = new Option(teams[i].team_name, teams[i].team);       
		}  
	});
}

function GetInhoud() {
	Productwizard.Ajax.GetInhoudWoning(function(response) {
		var teamsList = document.getElementById(ddlDimensionClientId);
		teamsList.disabled = false;

		//if the server side code threw an exception
		if (response.error != null)
		{    
			alert("A problem occurred in Productwizard:GetInhoudWoning\n" + response.error.Message); //we should probably do better than this
			return;
		}  

		var teams = response.value;  
		//if the response wasn't what we expected  
		if (teams == null || typeof(teams) != "object")
		{
			alert('A problem occurred in Productwizard:GetInhoudWoning');
			return;  
		}

		teamsList.options.length = 0; //reset the teams dropdown     

		//note that this is JavaScript casing and the L in length is lowercase for arrays
		for (var i = 0; i < teams.Rows.length; ++i)
		{
			teamsList.options[teamsList.options.length] = new Option(teams.Rows[i].inhoud, teams.Rows[i].id);       
			//teamsList.options[teamsList.options.length] = new Option(teams[i].team_name, teams[i].team);       
		}  
	});
}

function GetGasVerbruik() {
	Productwizard.Ajax.GetGasVerbruik(function(response) {
		var teamsList = document.getElementById(ddlDimensionClientId);
		teamsList.disabled = false;

		//if the server side code threw an exception
		if (response.error != null)
		{    
			alert("A problem occurred in Productwizard:GetGasVerbruik\n" + response.error.Message); //we should probably do better than this
			return;
		}  

		var teams = response.value;  
		//if the response wasn't what we expected  
		if (teams == null || typeof(teams) != "object")
		{
			alert('A problem occurred in Productwizard:GetGasVerbruik');
			return;  
		}

		teamsList.options.length = 0; //reset the teams dropdown     

		//note that this is JavaScript casing and the L in length is lowercase for arrays
		//teamsList.options[teamsList.options.length] = new Option("", "");
		for (var i = 0; i < teams.Rows.length; ++i)
		{
			teamsList.options[teamsList.options.length] = new Option(teams.Rows[i].verbruik, teams.Rows[i].id);       
			//teamsList.options[teamsList.options.length] = new Option(teams[i].team_name, teams[i].team);       
		}  
	});
}
