function JugeComment(myform)
{
	if (document.myform.UserName.value==""){
		alert ("你的用户名不可为空！");
		document.myform.UserName.focus();
		return(false);
	}
	if (document.myform.content.value == "")
	{
		alert("评论内容不能为空！");
		document.myform.content.focus();
                return (false);
	}
}
function CheckAll(form) {  
	for (var i=0;i<form.elements.length;i++)  
	{  
		var e = form.elements[i];  
		if (e.name != 'chkall')  
		e.checked = true // form.chkall.checked;  
	}  
} 
 
function ContraSel(form) {
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked=!e.checked;
	}
}
function bbimg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}
function imgzoom(img,maxsize){
	var a=new Image();
	a.src=img.src
	if(a.width > maxsize * 4)
	{
		img.style.width=maxsize;
	}
	else if(a.width >= maxsize)
	{
		img.style.width=Math.round(a.width * Math.floor(4 * maxsize / a.width) / 4);
	}
	return false;
}

function storePage() {
	d=document;
	t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');
	void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=52z.com&title='+escape(d.title)+'&url='+escape(d.location.href)+'&desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));
	vivi.focus();
}

//搜索下拉菜单
var Se_Hidden_Div = '';
Se_Hidden_Div = '<div id="HiddenDiv" style="display:none; z-index:999;margin:0 auto;margin-left:956px !important;margin-left:820px; margin-top:142px; width:65px; height:140px; position:absolute; border:solid 1px #A3BFE7; background-color:#F0F9FF;"><span style="width:65px; height:20px; text-align:center; line-height:20px; cursor:hand;" onclick="Hidden_DivAValue(\'\/pic\/search.asp?act=topic&keyword=\',\'图片门户\');">图片门户<\/span><br><span style="width:65px; height:20px; text-align:center; line-height:20px; cursor:hand;" onclick="Hidden_DivAValue(\'\/flv\/search.asp?act=topic&keyword=\',\'视频分享\');">视频分享<\/span><br><span style="width:65px; height:20px; text-align:center; line-height:20px; cursor:hand;" onclick="Hidden_DivAValue(\'\/flash\/search.asp?act=topic&keyword=\',\'游戏动画\');">游戏动画<\/span><br><span style="width:65px; height:20px; text-align:center; line-height:20px; cursor:hand;" onclick="Hidden_DivAValue(\'\/mobile\/search.asp?act=topic&keyword=\',\'手机桌面\');">手机桌面<\/span><br><span style="width:65px; height:20px; text-align:center; line-height:20px; cursor:hand;" onclick="Hidden_DivAValue(\'\/joke\/search.asp?act=topic&keyword=\',\'幽默笑话\');">幽默笑话<\/span><br><span style="width:65px; height:20px; text-align:center; line-height:20px; cursor:hand;" onclick="Hidden_DivAValue(\'\/article\/search.asp?act=topic&keyword=\',\'四博学院\');">四博学院<\/span><br><span style="width:65px; height:20px; text-align:center; line-height:20px; cursor:hand;" onclick="Hidden_DivAValue(\'\/soft\/search.asp?act=topic&keyword=\',\'四博下载\');">四博下载<\/span></div>';
document.write(Se_Hidden_Div);

//选择值并且关闭隐藏层
function Hidden_DivAValue(Types,NameStr)
{
	if (Types == '' || NameStr == '')
	{
		return;
	}
	else
	{
		$('Setype').value = '搜索类型';
		$('SeTypeTxt').value = Types;
		$('Setype').value = NameStr;
		$('HiddenDiv').style.display = 'none';
	}
}

//显示隐藏层
function Dis_HiddenDiv()
{
	$('HiddenDiv').style.display = '';
}

//提交搜索表单
function myCheckSearch()
{
	var KeyStr = document.Search_form.keyword.value;
	var Se_Type = document.Search_form.SeTypeTxt.value;
	if (KeyStr == '')
	{
		alert('搜索关键字不能为空！');
		return;
	}
	if (Se_Type == '')
	{
		alert('请选择搜索类型！');
		return;
	}
	document.Search_form.action = document.Search_form.SeTypeTxt.value+document.Search_form.keyword.value
	document.Search_form.submit();
}

//提交登陆表单
function myCheckLogin()
{
	var username = document.mytopform.username.value;
	var password = document.mytopform.password.value;
	if (username == '')
	{
		alert('用户名不能为空！');
		return;
	}
	if (password == '')
	{
		alert('密码不能为空！');
		return;
	}
	document.mytopform.submit();
}



