function tabmenu(n) {//滑门
	var title = document.getElementById("tabmenu_title").getElementsByTagName("span");
	var content = document.getElementById("tabmenu_content").getElementsByTagName("div");
	for (i=0;i<title.length;i++) {
		title[i].className = i==n?"current":"";
		content[i].style.display = i==n?"block":"none";
	}
}
function select_link(select) {//下拉菜单链接
	if(select.options[select.selectedIndex].value!='#') {
		window.open(select.options[select.selectedIndex].value,'_blank');
	}
}
/*
function navMouseOver(id,type) {
	$('faNavL'+id).style.background="url('images/nav_bg2_l.jpg')";
	$('faNavM'+id).style.background="url('images/nav_bg2_m.jpg')";
	$('faNavR'+id).style.background="url('images/nav_bg2_r.jpg')";
	if(type==1) {
		showSubNav(id);
	}
}

function navMouseOut(id) {
	$('faNavL'+id).style.background="url('images/nav_bg_l.jpg')";
	$('faNavM'+id).style.background="url('images/nav_bg_m.jpg')";
	$('faNavR'+id).style.background="url('images/nav_bg_r.jpg')";
}
*/
function showSubNav(id) {
	for(i=1;i<=10;i++) {
		if( $('subNav'+i)!=undefined )
		$('subNav'+i).style.display = "none";
	}
	$('subNav'+id).style.display = "block";
}


function navMouseOver(id,type) {
	navChange(id,2);
	if(type==1) {
		showSubNav(id);
	}
}

function navMouseOut(id) {
	navChange(id,1);
}

function navChange(id,type) {
	$('faNav'+id).style.background = "url('images/faNav"+id+"_"+type+".jpg')";
}

function clickSubNav(id) {
	navChange(id,2);
	showSubNav(id);
}

function refreshRandom(){
	$('RandomCode').src = 'random.class.php?' + Math.random();
}

function gbookCheck() {
	if($('txt').value==''){
		alert('请输入留言内容！');
		return false;
	}
	return true;
}

function exeVote(id,stype) {
	if( ((stype==0) && (!getIsRadionChecked('vote'))) || ((stype==1) && (getCheckboxNum('vote')==0)) ) {
		alert('请选择!');
		return false;
	} else {
		value = (stype==0) ? getRadioValue('vote') : getCheckboxValue('vote');
	}
	new Ajax.Request(
		'inc/ajax_exeVote.php',
		{
			method:'post',
			postBody:'value='+value+'&id='+id+'&stype='+stype,
			onComplete: function(response) {
				var tmp = response.responseText;
				if(!tmp) {
					alert('投票失败！');
				} else {
					alert('投票成功！');
				}
			}
		}
	);
}

function viewVote(id) {
	window.open('inc/vote.php?id='+id,'查看投票结果','height=250,width=500,top=200,left=200,toolbar=no,menubar=no,scrollbars=no,resizable=yes,location=no');
}

function showList(num,id) {
	for(i=1;i<=num;i++) {
		$('list'+i).style.display = "none";
	}
	$('list'+id).style.display = "block";
}

function searchCheck() {
	if($('keyword').value=="") {
		alert('请输入搜索关键字！');
		return false;
	}
	return true;
}
