<!--//--><![CDATA[//><!--
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>

var gcity = [];
function updatelist()
{
	$('qscities').value = '';
	for (var i=0; i< gcity.length; i++)
	{
		//chad highlight city here.
		$('qscities').value += gcity[i];
		
		if (i < gcity.length-1)
		{
			$('qscities').value += ',';
		}
	}
}

function findandremove(num,el)
{
	for (var i=0; i< gcity.length; i++)
	{
		if (gcity[i] == num)
		{
			$('qs-bg'+num).setStyle({ backgroundImage: null });
			//chad unhighlight the city here
			gcity.splice(i,1); 
			return true;
		}	
	}
}

function qsCitySelect(num,el) {
	if (!findandremove(num,el))
	{
		gcity.push(num);

		if(num == 1)
		{
			$('qs-bg'+num).setStyle({ backgroundImage: 'url(/img/map-over-hanalei.png)' });
		}
		else if(num == 2)
		{
			$('qs-bg'+num).setStyle({ backgroundImage: 'url(/img/map-over-kawaihau.png)' });
		}
		else if(num == 3)
		{
			$('qs-bg'+num).setStyle({ backgroundImage: 'url(/img/map-over-lihue.png)' });
		}
		else if(num == 4)
		{
			$('qs-bg'+num).setStyle({ backgroundImage: 'url(/img/map-over-koloa.png)' });
		}
		else if(num == 5)
		{
			$('qs-bg'+num).setStyle({ backgroundImage: 'url(/img/map-over-waimea.png)' });
		}
		else
		{
			$('qs-bg'+num).setStyle({ backgroundImage: 'url(/img/qsearch-chk.gif)', backgroundPosition: 'bottom center' });
		}
	}
	updatelist();
}