search_type = "baidu";
function SetTab(Link,Obj)
{
	SetBack();
	Obj.className = "cur";
	document.getElementById('app_loader_www').style.display = "none";
	document.getElementById('app_loader_tools_iframe').src = Link;
	document.getElementById('app_loader_tools').style.display = "block";
	return true;
}
function SetHome()
{
	SetBack();
	document.getElementById('nav_home').className = "cur";
	document.getElementById('app_loader_tools').style.display = "none";
	document.getElementById('app_loader_www').style.display = "block";
	return true;
}
function SetBack()
{
	Elemants = document.getElementById('nav');
	for(i=0;i<Elemants.childNodes.length;++i)
	{
		Elemants.childNodes.item(i).className = "";
	}
	return true;
}
function ChangeSearchGroup(Id)
{
	for(i=1;i<8;++i)
	{
		document.getElementById("sps"+i).style.display = "none";
		document.getElementById("search_group_"+i).className = "";
	}
	document.getElementById("sps"+Id).style.display = "block";
	document.getElementById("search_group_"+Id).className = "s-cur";
	switch(Id)
	{
	case 1:
		search_type = "baidu1";
		break;
	case 2:
		search_type = "baidu2";
		break;
	case 3:
		search_type = "xunlei3";
		break;
	case 4:
		search_type = "xunlei4";
		break;
	case 5:
		search_type = "baidu5";
		break;
	case 6:
		search_type = "tieba6";
		break;
	}
	ChangeSearchTab(search_type);
}
function ChangeSearchTab(type)
{
	search_type = type;
	switch (type)
	{
		case 'taobao':
		document.getElementById('search_form').action = 'http://s8.taobao.com/search';
		document.getElementById('keyword').name = 'q';
		break;

		case 'laiba6':
		document.getElementById('search_form').action = 'http://laiba.tianya.cn/searchGroup.jsp';
		document.getElementById('keyword').name = 'nameOrStockCode';
		break;

		case 'tieba6':
		document.getElementById('search_form').action = 'http://tieba.baidu.com/f';
		document.getElementById('keyword').name = 'kw';
		break;

		case 'google5':
		document.getElementById('search_form').action = 'http://www.google.com.hk/images';
		document.getElementById('keyword').name = 'q';
		break;

		case 'google4':
		document.getElementById('search_form').action = 'http://www.google.com.hk/search';
		document.getElementById('keyword').name = 'q';
		break;

		case 'xunlei4':
		document.getElementById('search_form').action = 'http://video.gougou.com/search';
		document.getElementById('keyword').name = 's';
		break;

		case 'youku3':
		document.getElementById('search_form').action = 'http://www.soku.com/search_video/';
		document.getElementById('keyword').name = 'q';
		break;

		case 'xunlei3':
		document.getElementById('search_form').action = 'http://movie.gougou.com/search';
		document.getElementById('keyword').name = 'search';
		break;

		case 'sougou2':
		document.getElementById('search_form').action = 'http://mp3.sogou.com/music.so';
		document.getElementById('keyword').name = 'query';
		break;

		case 'google2':
		document.getElementById('search_form').action = 'http://www.google.cn/music/search';
		document.getElementById('keyword').name = 'q';
		break;

		case 'xunlei2':
		document.getElementById('search_form').action = 'http://mp3.gougou.com/search';
		document.getElementById('keyword').name = 'search';
		break;

		case 'sougou1':
		document.getElementById('search_form').action = 'http://www.sogou.com/sogou';
		document.getElementById('keyword').name = 'query';
		break;

		case 'google1':
		document.getElementById('search_form').action = 'http://www.google.com.hk/search';
		document.getElementById('keyword').name = 'q';
		break;

		case 'baidu1':
		document.getElementById('search_form').action = 'http://www.baidu.com/s';
		document.getElementById('keyword').name = 'word';
		break;

		case 'baidu2':
		document.getElementById('cts').value = '134217728';
		document.getElementById('search_form').action = 'http://mp3.baidu.com/m';
		document.getElementById('keyword').name = 'word';
		break;

		case 'baidu5':
		document.getElementById('cts').value = '201326592';
		document.getElementById('search_form').action = 'http://image.baidu.com/i';
		document.getElementById('keyword').name = 'word';
		break;

		case 'zhidao':
		document.getElementById('tns').value = 'ikaslist';
		document.getElementById('cts').value = '17';
		document.getElementById('search_form').action = 'http://zhidao.baidu.com/q';
		document.getElementById('keyword').name = 'word';
		break;

		case 'news':
		document.getElementById('search_form').action = 'http://news.baidu.com/ns';
		document.getElementById('tns').value = 'news';
		document.getElementById('keyword').name = 'word';
		break;

		case 'baidu4':
		document.getElementById('cts').value = '301989888';
		document.getElementById('search_form').action = 'http://video.baidu.com/v';
		document.getElementById('keyword').name = 'word';
		break;

	}
}

function ShowDate()
{
	var day = "";
	var year = "";
	var month = "";
	var myweekday = "";
	mydate = new Date();
	myweekday = mydate.getDay();
	mymonth = mydate.getMonth() + 1;
	myday = mydate.getDate();
	myyear = mydate.getYear();
	year = (myyear>200) ? myyear : 1900 + myyear;
	if(myweekday == 0) 
		weekday="星期日";
	else if(myweekday == 1)
		weekday="星期一";
	else if(myweekday == 2)
		weekday="星期二";
	else if(myweekday == 3)
		weekday="星期三";
	else if(myweekday == 4)
		weekday="星期四";
	else if(myweekday == 5)
		weekday="星期五";
	else if(myweekday == 6)
		weekday="星期六";
	document.getElementById("date").innerHTML  =  year+"年 "+mymonth+"月 "+myday+"日 "+weekday;
	return true;
}
window.onload = function()
{
	ShowDate();
}
