$(function(){
	$('#header_AddFavorite').bind('click',function(){
		sURL=window.location.href;
		sTitle=document.title;
		alert( sURL + ' -- ' + sTitle );
		AddFavorite(sURL,sTitle)
	});
	
	$('#index_search').click(function(){
		searchPart();
	});
	
});

function searchPart(){
	sKey=$.trim( $('#search_key').val() );
	sSelect=$('#search_part').val();

	sSearchURL="";
	switch(sSelect){
		case 'news':
		sSearchURL="http://news.lanbailan.com/search.php?key=";
		break

		case 'tech':
		sSearchURL="http://tech.lanbailan.com/search.php?key=";
		break

		case 'report':
		sSearchURL="http://report.lanbailan.com/search.php?key=";
		break

		case 'company':
		sSearchURL="http://www.lanbailan.com/company/index.php?act=search&industrys=x&key=";
		break

		case 'product':
		sSearchURL="http://www.lanbailan.com/product/index.php?act=search&key=";
		break

		case 'meeting':
		sSearchURL="http://meeting.lanbailan.com/search.php?key=";
		break

		case 'job':
		sSearchURL="http://www.lanbailan.com/job/index.php?act=search&key=";
		break

		case 'gallery':
		sSearchURL="http://www.lanbailan.com/gallery/index.php?act=search&key=";
		break

		case 'interview':
		sSearchURL="http://interview.lanbailan.com/search.php?key=";
		break

		case 'business':
		sSearchURL="http://business.lanbailan.com/search.php?key=";
		break

		case 'friend':
		sSearchURL="http://friend.lanbailan.com/search.php?key=";
		break
	}

	if(sSearchURL.length > 2){
		location.href=sSearchURL+sKey
	}
}
