/* ***************************************************
		Vars										*/
		
var searchCount = -70;
var weatherCount = -72;
var weatherBox = null;
var searchBox = null;
var searchBiz = null;
var searchSite = null;
var wi;
var wo;
var wc;
var si;
var sc;
var bo;
var weatherGo = true;
var searchGo = true;

/* ***************************************************
		Search										*/

function openSearch()
{	
	if (searchCount != 1) {
		searchBox.style.top = searchCount + "px";
		searchCount=searchCount+1;
		var si = setTimeout("openSearch()",1);
	}
}

function closeSearch()
{	
	if (searchCount != -37) {
		searchBox.style.top = searchCount + "px";
		searchCount=searchCount-1;
		var sc = setTimeout("closeSearch()",1);
	}
	else searchGo = true;
}

function searchSiteIn()
{
	clearTimeout(bo);
	searchSite = document.getElementById('search-site');
	if (searchSite.value == 'Search SantaFe.com ...')
	searchSite.value = '';
	searchBox = document.getElementById('searchObj');
	setStyle(searchSite);
	if (searchGo == true)
	{
		searchGo = false;
		openSearch();
	}
}

function searchSiteOut()
{
	if (searchSite.value == '')
	{
		searchSite.value = 'Search SantaFe.com ...';
		searchSite.style.color = '#777777';
		searchSite.style.fontStyle = 'italic';
	}
	if (searchSite.value == 'Search SantaFe.com ...' && searchBiz.value == 'Search Businesses ...')
	bo = setTimeout("closeSearch()",5000);
}

function searchBizIn()
{
	clearTimeout(bo);
	searchBiz = document.getElementById('search-biz');
	if (searchBiz.value == 'Search Businesses ...')
	searchBiz.value = '';
	setStyle(searchBiz);
}

function searchBizOut()
{
	if (searchBiz.value == '')
	{
		searchBiz.value = 'Search Businesses ...';
		searchBiz.style.color = '#777777';
		searchBiz.style.fontStyle = 'italic';
	}
	if (searchBiz.value == 'Search Businesses ...' && searchSite.value == 'Search SantaFe.com ...')
	bo = setTimeout("closeSearch()",5000);
}

function setStyle(i)
{
	i.style.color = '#3a3a3a';
	i.style.fontStyle = 'normal';
	return;
}
 
/* ***************************************************
		Weather										*/

function openWeather()
{	
	if (weatherCount != 1) {
		weatherBox.style.top = weatherCount + "px";
		weatherCount=weatherCount+1;
		wi = setTimeout("openWeather()",2);
	}
	else
	{
		clearTimeout(wo);
		wo = setTimeout("closeWeather()",5000);
	}
}

function closeWeather()
{
	if (weatherCount != -73) {
		weatherBox.style.top = weatherCount + "px";
		weatherCount=weatherCount-1;
		wc = setTimeout("closeWeather()",2);
	}
	else weatherGo = true;
}

function weatherIn()
{
	weatherBox = document.getElementById('weatherObj');
	if (weatherGo == true)
	{
		weatherGo = false;
		openWeather();
	}
}


/* ***************************************************
		Subnav Flyouts								*/

var startFly = 0;
var t;

/* function showFly(pos) {
	if(!startFly) {
		startFly = 1;
		var t=setTimeout(function(){showFlyGo(pos); parameter = null},2000);
	}
	else {
		clearTimeout(t);
		var t=setTimeout(function(){showFlyGo(pos); parameter = null},2000);
	}
	
//	var temp = pos;
//	var t=setTimeout("showFlyGo(temp)",2000);
}	 */

function showFly(pos) {
	clearTimeout(t);
	t=setTimeout(function(){showFlyGo(pos); parameter = null},600);
}

function stopFly() {
	clearTimeout(t);
}

function hideFly() {
	var nav = document.getElementById("nav");
	
	nav.setAttribute("class", "nav"); //For Most Browsers
	nav.setAttribute("className", "nav"); //For IE; harmless to other browsers.
}

function showFlyGo(posMe) {	
	var nav = document.getElementById("nav");
	
	var fullClass = "nav showSub " + posMe;
	
	nav.setAttribute("class", fullClass); //For Most Browsers
	nav.setAttribute("className", fullClass); //For IE; harmless to other browsers.
}	





















