﻿/* Code for Hebel 123 */

var hebel_123 = {

	data : [{"name":"Homeowner","url":"","array":[{"name":"Build a","url":"","array":[{"name":"New Home","url": jsAppPath + "homeowners/newhomes.aspx","array":[]},
	{"name":"Extension","url": jsAppPath + "homeowners/alterationsandadditions/extensions.aspx","array":[]},
	{"name":"DIY project","url": jsAppPath + "diy/hebelhandi.aspx","array":[]}]},
	{"name":"Contact a","url":"url","array":[{"name":"Builder","url": jsAppPath + "homeowners/findbuilder.aspx","array":[]},
	{"name":"Installer","url": jsAppPath + "specifiers/findinstaller.aspx","array":[]},
	{"name":"Distributor","url": jsAppPath + "specifiers/contactdistributor.aspx","array":[]}]},
	{"name":"Be inspired by","url":"url","array":[{"name":"Building Projects","url": jsAppPath + "gallery/projectsearch.aspx","array":[]},
	{"name":"DIY Projects","url": jsAppPath + "diy/creativediysolutions/otherdiyideas.aspx","array":[]}]},
	{"name":"Learn more about","url":"url","array":[{"name":"Hebel & the Environment","url": jsAppPath + "whyhebel/hebelandtheenvironment.aspx","array":[]}]}]},
	{"name":"Specifier","url":"url","array":[{"name":"Design a","url":"","array":[{"name":"House","url": jsAppPath + "specifiers/detachedresidential.aspx","array":[]},
	{"name":"Low-Rise Multiresidential (3 or less levels)","url": jsAppPath + "specifiers/lowrisemultiresidential.aspx","array":[]},
	{"name":"HighRise Multiresidential (4 or more levels)","url": jsAppPath + "specifiers/highrisemultiresidential.aspx","array":[]},
	{"name":"Commercial/ Industrial","url": jsAppPath + "specifiers/commercialindustrial.aspx","array":[]}]},
	{"name":"Refurbish a","url":"url","array":[{"name":"House","url": jsAppPath + "specifiers/detachedresidential.aspx","array":[]},
	{"name":"Low-Rise Multiresidential (3 or less levels)","url": jsAppPath + "specifiers/lowrisemultiresidential.aspx","array":[]},
	{"name":"HighRise Multiresidential (4 or more levels)","url": jsAppPath + "specifiers/highrisemultiresidential.aspx","array":[]},
	{"name":"Commercial/ Industrial","url": jsAppPath + "specifiers/commercialindustrial.aspx","array":[]}]},
	{"name":"Contact a","url":"url","array":[{"name":"Builder","url": jsAppPath + "specifiers/findbuilder.aspx","array":[]},
	{"name":"Installer","url": jsAppPath + "specifiers/findinstaller.aspx","array":[]},
	{"name":"Distributor","url": jsAppPath + "specifiers/contactdistributor.aspx","array":[]}]},
	{"name":"Find a","url":"url","array":[{"name":"MSDS","url": jsAppPath + "resources/msdsdetails.aspx","array":[]},
	{"name":"CAD drawing","url": jsAppPath + "resources/caddetails.aspx","array":[]},
	{"name":"Brochure/Design Guide","url": jsAppPath + "resources/designguides.aspx","array":[]},
	{"name":"Architectural specification sheet","url": jsAppPath + "resources/designguides.aspx","array":[]}]},
	{"name":"Learn more about","url":"url","array":[{"name":"Hebel & the Environment","url": jsAppPath + "whyhebel/hebelandtheenvironment.aspx","array":[]},
	{"name":"Coating Systems","url": jsAppPath + "homeowners/coatingsystems.aspx","array":[]}]}]},
	{"name":"Builder","url":"url","array":[{"name":"Contact a","url":"","array":[{"name":"Installer","url": jsAppPath + "specifiers/findinstaller.aspx","array":[]},
	{"name":"Specifier","url": jsAppPath + "builders/findspecifier.aspx","array":[]},
	{"name":"Distributor","url": jsAppPath + "specifiers/contactdistributor.aspx","array":[]}]},
	{"name":"Build a","url":"url","array":[{"name":"House","url": jsAppPath + "specifiers/detachedresidential.aspx","array":[]},
	{"name":"Low-Rise Multiresidential (3 or less levels)","url": jsAppPath + "specifiers/lowrisemultiresidential.aspx","array":[]},
	{"name":"HighRise Multiresidential (4 or more levels)","url": jsAppPath + "specifiers/highrisemultiresidential.aspx","array":[]},
	{"name":"Commercial/ Industrial","url": jsAppPath + "specifiers/commercialindustrial.aspx","array":[]}]},
	{"name":"Find a","url":"url","array":[{"name":"MSDS","url": jsAppPath + "resources/msdsdetails.aspx","array":[]},
	{"name":"Technical Manual","url": jsAppPath + "resources/technicalmanual.aspx","array":[]},
	{"name":"Design Guide","url": jsAppPath + "resources/designguides.aspx","array":[]},
	{"name":"Handling Guidelines","url": jsAppPath + "builders/handlingguidelines.aspx","array":[]}]},
	{"name":"Learn more about","url":"url","array":[{"name":"Hebel & the Environment","url": jsAppPath + "whyhebel/hebelandtheenvironment.aspx","array":[]},
	{"name":"Coating Systems","url": jsAppPath + "homeowners/coatingsystems.aspx","array":[]}]}]}],
	

	layer0_selected : function (sel) { 
		$ ( hebel_123.data).each ( 
			function (i,v) { 
			
				if ( v.name == $(sel).selectedValues()[0] )
				{
					while ( $("#step2").get(0).options.length > 1 )
					{
						$('#step2').removeOption($("#step2").get(0).options.length-1);
					}
					
					
					$ ( v.array ).each (
						function ( i, v2 ) {
							$ ( '#step2').addOption ( v2.name, v2.name, false );
						} );
						
						
				}
			
			 } ); },
			 
	layer1_selected : function (first, sel) { 
		$ ( hebel_123.data).each ( 
			function (i,v) { 
			
				if ( v.name == $(first).selectedValues()[0] )
				{
		
		
					$ ( v.array ).each (
						function ( i, v2 ) {
							if ( v2.name == $(sel).selectedValues()[0] )
							{
							
								while ( $("#step3").get(0).options.length > 1 )
								{
									$('#step3').removeOption($("#step3").get(0).options.length-1);
								}
						
								$ ( '#step3').get(0).selectedIndex=0;
								
								$ ( v2.array ).each (
									function ( i, v3 ) {
									
										$ ( '#step3').addOption ( v3.url, v3.name, false );
									}
								
								);
							}
						} );
						
						
				}
			
			 } ); },
			 
	layer2_selected : function ( sel )
	{
		if ( $(sel).selectedValues()[0] != '' )
		{
			document.location.href =  $(sel).selectedValues()[0];
		}
		
	},
			 

	
	
	
	layer0 : function () { $ ( hebel_123.data).each ( function (i,v) { $('#step1').addOption(v.name,v.name,false);  } ) ; },
	
	
	
	layer1: function () { }
	
	
}


$(window).load(function () {
	hebel_123.layer0();
});
