$(function(){
	$("#fontsizeplus").click(function(){
		$("#newstxt").css({"font-size":10+"px"});
	});
});


//登录验证
function CheckFormUserLogin()
{
	if(document.UserLogin.UserName.value=="")
	{
		alert("请输入用户名！");
		document.UserLogin.UserName.focus();
		return false;
	}
	if(document.UserLogin.Passwd.value == "")
	{
		alert("请输入密码！");
		document.UserLogin.Passwd.focus();
		return false;
	}
	if(document.UserLogin.verifycode.value == "")
	{
		alert("请输入验证码！");
		document.UserLogin.verifycode.focus();
		return false;
	}
}

//新闻详细页面
function validateMode()
{
  if (!bTextMode) return true;
  alert("请先取消查看HTML源代码，进入“编辑”状态，然后再使用系统编辑功能!");
  message.focus();
  return false;
}
function validateModea()
{
  if (!bTextMode) return true;
  alert("请先取消查看HTML源代码!");
  message.focus();
  return false;
}

function sign()
{if (!validateMode()) return;
message.focus();

var range =message.document.selection.createRange();
str1="<font color='red'><b>|签收|</b>文件已经阅读</font>"
   range.pasteHTML(str1);
}

function img_zoom(e, o)		//图片鼠标滚轮缩放
{
	var zoom = parseInt(o.style.zoom, 10) || 100;
	zoom += event.wheelDelta / 12;
	if (zoom > 0) o.style.zoom = zoom + '%';
		return false;
}

function user_login()
{
	document.UserLogin.UserName.focus();
	return false;
}

var size=14;			//字体大小
function fontZoom(fontsize){	//设置字体
	size=fontsize;
	document.getElementById('fontZoom').style.fontSize=size+'px';
}

function fontMax(){	//字体放大
	size=size+2;
	document.getElementById('fontZoom').style.fontSize=size+'px';
}

function fontMin(){	//字体缩小
	size=size-2;
	if (size < 2 ){
		size = 2
	}
	document.getElementById('fontZoom').style.fontSize=size+'px';
}

function changedata() {
	if ( document.AddReview.none.checked ) {
		document.AddReview.name.value = "游客";
	}
}
function changedata1() {
	if ( document.AddReview.none1.checked ) {
		document.AddReview.email.value = "guest@ftsys.net";
	}
}

function CheckFormAddReview()	//检测评论发表栏填写项目是否为空
{
	if(document.AddReview.name.value=="")
	{
		alert("请输入用户名！");
		document.AddReview.name.focus();
		return false;
	}
	if(document.AddReview.email.value == "")
	{
		alert("请输入您的EMAIL！");
		document.AddReview.email.focus();
		return false;
	}
	if(document.AddReview.content.value == "")
	{
		alert("请输入评论内容！");
		return false;
	}
		if (document.AddReview.verifycode.value=="")
	{
	  alert("对不起，请输入验证码！")
	  document.AddReview.verifycode.focus()
	  return false
	}
}

//双击滚屏代码
var currentpos,timer;

function initialize()
{
timer=setInterval("scrollwindow()",50);
}

function sc(){
clearInterval(timer);
}

function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos != document.body.scrollTop)
	sc();
}
document.onmousedown=sc
document.ondblclick=initialize


//注册表单
function FrmAddLink_onsubmit() {
var i, n;
if (document.FrmAddLink.username.value=="")
	{
	  alert("对不起，请输入您的用户名！")
	  document.FrmAddLink.username.focus()
	  return false
	 }
else if (document.FrmAddLink.username.value.length < 2)
	{
	  alert("您的用户名能不能长一点！")
	  document.FrmAddLink.username.focus()
	  return false
	 }
else if (document.FrmAddLink.username.value.length > 30)
	{
	  alert("您的用户名太长了吧！")
	  document.FrmAddLink.username.focus()
	  return false
	 }
else if (document.FrmAddLink.username.value.indexOf('`') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('~') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('!') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('@') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('#') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('$') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('%') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('^') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('&') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('*') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('(') >= 0 ||
		  document.FrmAddLink.username.value.indexOf(')') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('+') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('{') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('}') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('|') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('[') >= 0 ||
		  document.FrmAddLink.username.value.indexOf(']') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('\\') >= 0 ||
		  document.FrmAddLink.username.value.indexOf(';') >= 0 ||
		  document.FrmAddLink.username.value.indexOf(':') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('>') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('<') >= 0 ||
		  document.FrmAddLink.username.value.indexOf(',') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('?') >= 0 ||
		  document.FrmAddLink.username.value.indexOf('/') >= 0 || 
		  document.FrmAddLink.username.value.indexOf('\'') >= 0 || 
		  document.FrmAddLink.username.value.indexOf('"') >= 0 || 
		  document.FrmAddLink.username.value.indexOf(' ') >= 0 || 
		  document.FrmAddLink.username.value.indexOf('=') >= 0 || 
		  document.FrmAddLink.username.value.indexOf('%') >= 0
		 )  
		  {
			alert("用户名中包含无效字符，请重新选择用户名！"); 
			document.FrmAddLink.username.focus();
			return false;
		  }
else if (document.FrmAddLink.passwd.value=="")
	{
	  alert("对不起，请您输入密码！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd.value.length < 4)
	{
	  alert("为了安全，您的密码应该长一点！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd.value.length > 16)
	{
	  alert("您的密码太长了吧！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.username.value==document.FrmAddLink.passwd.value)
	{
	  alert("为了安全，用户名与密码不应该相同！")
	  document.FrmAddLink.passwd.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd2.value=="")
	{
	  alert("对不起，请您输入验证密码！")
	  document.FrmAddLink.passwd2.focus()
	  return false
	 }
else if (document.FrmAddLink.passwd2.value !== document.FrmAddLink.passwd.value)
	{

	  alert("对不起，您两次输入的密码不一致！")
	  document.FrmAddLink.passwd2.focus()
	  return false
	 }
else if (document.FrmAddLink.question.value=="")
	{
	  alert("对不起，请您输入提示问题！")
	  document.FrmAddLink.question.focus()
	  return false
	 }
else if (document.FrmAddLink.answer.value=="")
	{
	  alert("对不起，请您输入问题答案！")
	  document.FrmAddLink.answer.focus()
	  return false
	 }
else if (document.FrmAddLink.question.value==document.FrmAddLink.answer.value)
	{
	  alert("为了安全，提示问题与问题答案不应该相同！")
	  document.FrmAddLink.answer.focus()
	  return false
	 }
else if (document.FrmAddLink.fullname.value=="")
	{
	  alert("对不起，请输入您的真实姓名！")
	  document.FrmAddLink.fullname.focus()
	  return false
	 }
else if (document.FrmAddLink.depid.value=="")
	{
	  alert("对不起，请选择您的工作单位！")
	  document.FrmAddLink.depid.focus()
	  return false
	 }
else if (document.FrmAddLink.sex.value=="")
	{
	  alert("对不起，请选择您的性别！")
	  document.FrmAddLink.sex.focus()
	  return false
	 }
else if (document.FrmAddLink.tel.value=="")
	{
	  alert("对不起，请输入您的联系电话！")
	  document.FrmAddLink.tel.focus()
	  return false
	 }
else if (document.FrmAddLink.email.value=="")
	{
	  alert("对不起，请输入您的电子邮件！")
	  document.FrmAddLink.email.focus()
	  return false
	 }
else if (document.FrmAddLink.email.value.indexOf("@",0)== -1||document.FrmAddLink.email.value.indexOf(".",0)==-1)
	  {
	  alert("对不起，您输入的电子邮件有误！")
	  document.FrmAddLink.email.focus()
	  return false
	 }
}

//Function to open pop up window
function openWin(theURL,winName,features) {
	window.open(theURL,winName,features);
}
