﻿
var hasDown = false;
function SearchDown()
{

	mclS(!hasDown,'SearchDownList', 'SearchDown', true);

	hasDown = !hasDown;
}

function SearchUp()
{
	mclS(false,'SearchDownList', 'SearchDown', true);
	hasDown = false;
}

function SelectKeyword(keyword)
{
	SearchUp();
	var obj = gid("SearchKeywords");
	if (obj!=null)
	{
		obj.value=keyword;
	}
}

var showKeyword = false;
function changeKeyword()
{
	//alert('start');
	var obj = gid("SearchKeywords");
	if (obj!=null)
	{
		if (!showKeyword)
		{
			var PostData = "do=searchkeyword&keyword=" + obj.value;
			PostRequest(window.location.protocol + "//" + window.location.host + "/Ajax/AJAX_index.aspx", PostData);
			showKeyword = true;
		}
	}
}

function ShowList(Keyword)
{
	var obj = gid("SearchDownList");
	if (obj!=null)
	{
		obj.innerHTML = Keyword;
		mclS(true,'SearchDownList', 'SearchDown', true);
		showKeyword = false;
	}
}

function NotShowList()
{
	mclS(false,'SearchDownList', 'SearchDown', true);
	showKeyword = false;
}

function GoSearch(cityID)
{
	var obj = gid("SearchKeywords");
	if (obj!=null)
	{
		self.location = '/search/k/' + cityID + "_" +StrCode(obj.value);
	}
	
}

function Over(type, id)
{
	var obj=gid("SearchDownItem" + id);
	if (obj!=null)
	{
		if (id==0)
		{
			if (type==0)
			{
				obj.className="SeletedItem RightLi";
			}
			else
			{
				obj.className="RightLi";
			}
		}
		else
		{
			if (type==0)
			{
				obj.className="SeletedItem";
			}
			else
			{
				obj.className="";
			}
		}
	}
}