/*****************************************************************************************************************/
/* Created Date    Author           Comments *********************************************************************/
/*****************************************************************************************************************/
/* 10/29/2007      Muni Mahimaluru  As part of the clean up this file is created for findhomenationalsearch.aspx**/
/*****************************************************************************************************************/		
			/* Added by Harish on 11/13/2007
			/* This function is used to get the Values from the hidden text and populate it to the Neighbourhood array */

				if (document.getElementById('hidNeighbourhood').value !="")
				{
					var NeighborhoodArray1 = new Array(document.getElementById('hidNeighbourhood').value) ;
					NeighborhoodArray1 = document.getElementById('hidNeighbourhood').value.split("|");
					NeighborhoodArray1.pop() ;
					
					var NeighborhoodArray = new Array() ;
					var NeighborhoodArray2 = new Array();
					for (i=0;i<NeighborhoodArray1.length;i++)
					{
						NeighborhoodArray2 = NeighborhoodArray1[i].split(",");
						if (NeighborhoodArray2.length !=4)
						{
							alert("Error in Loading");
						}
						else
						{
							NeighborhoodArray.push(new Neighborhood(NeighborhoodArray2[0],NeighborhoodArray2[1],NeighborhoodArray2[2],NeighborhoodArray2[3]));
						}
					}
				}
				

		// Initializations and to findout the Flash or non falsh needs to be displayed		
		function OnLoadHandler()
		{
			InitCombo("ddlDivision", "ddlNeighborhood");
			
			var ctl = document.getElementById("hidDisplayResultGrid");
			var div2 = document.getElementById("SearchResultsGridDiv");
			var divB = document.getElementById("searchMainLeft");
			var hideFlash = document.getElementById("hidHideFlash");
			var bShowResults = 0;
			
			div2.style.display="none";
			divB.style.display="none";
			if (ctl)
			{
				if (ctl.value != 0)
				{
					bShowResults = 1;
				}
			}
			
			if (bShowResults == 1)
			{
				divB.style.display = "none";
				div2.style.display = "block";
			}	
			else
			{
				div2.style.display = "none";
				divB.style.display = "block";
				/*
				if (hideFlash.value != 1)
				{
					var FO = { movie:"../findhome/national_map.swf",  width:"500", height:"256", majorversion:"6", build:"0", flashvars:"sURILink=findHome"};
					UFO.create(FO, "searchMainLeft");
					div2.style.display = "none";
					divB.style.display = "block";		
				}
				else
				{
					div2.style.display = "none";
					divB.style.display = "block";
				}
				*/
			}	
					
			FooterReloc();
		}
			
//Swiching the map regions
		function ShowMap(sMap)
		{
			var sMaps = new Array("UnitedStates", "California", "Arizona", "Colorado", "Texas", "Florida", "Carolinas", "Nevada");
			for (i = 0; i < sMaps.length; i++)
			{
				var ctl = document.getElementById(sMaps[i] + "StaticMap");				
				if (ctl)
				{
					if (sMaps[i] == sMap)
					{
						ctl.style.display = "block";
					}
					else
					{
						ctl.style.display = "none";
					}	
				}
			}				
		}	
