﻿// JavaScript Document
//远煌科技 http://www.yefor.com

//信息反馈表单验证
function checkFeedBack(){
if(document.form10.name.value==""){
alert("请输入您的姓名！");
document.form10.name.focus();
return false;
}
if(document.form10.tel.value==""){
alert("请您的联系电话!");
document.form10.tel.focus();
return false;
}
if(document.form10.thetype.value==""){
alert("请选择留言类型!");
document.form10.thetype.focus();
return false;
}
if(document.form10.Content.value==""){
alert("请输入详细内容!");
document.form10.Content.focus();
return false;
}
if(document.form10.FeedbackVerify.value==""){
alert("为确保信息的有效性,请输入验证码!");
document.form10.FeedbackVerify.focus();
return false;
}
 if(document.form10.email.value=="")
	{
	  alert("联系信箱不能为空。")
	  document.form10.email.focus()
	  return false
	 }
else if (document.form10.email.value.charAt(0)=="." ||        
         document.form10.email.value.charAt(0)=="@"||       
         document.form10.email.value.indexOf('@', 0) == -1 || 
         document.form10.email.value.indexOf('.', 0) == -1 || 
         document.form10.email.value.lastIndexOf("@")==document.form10.email.value.length-1 || 
         document.form10.email.value.lastIndexOf(".")==document.form10.email.value.length-1)
     {
      alert("Email地址格式不正确！");
      document.form10.email.focus();
      return false;
	 }
return true
}

//招聘职位申请验证表单
function CheckJob_Apply(){
if(document.form10.send_name.value==""){
alert("请填写您的姓名！");
document.form10.send_name.focus();
return false;
}
if(document.form10.job_name.value==""){
alert("请选择申请的职位!");
document.form10.job_name.focus();
return false;
}
if(document.form10.send_sex.value==""){
alert("请填写您的性别!");
document.form10.send_sex.focus();
return false;
}  
if(document.form10.send_tel.value==""){
alert("请填写您的联系电话!");
document.form10.send_tel.focus();
return false;
} 
if(document.form10.send_addr.value==""){
alert("请填写联系地址!");
document.form10.send_addr.focus();
return false;
}
if(document.form10.send_jl.value==""){
alert("请填写您的简历!");
document.form10.send_jl.focus();
return false;
} 
if(document.form10.JobVerify.value==""){
alert("为确保信息的有效性,请输入验证码!");
document.form10.JobVerify.focus();
return false;
}
 if(document.form10.send_mail.value=="")
	{
	  alert("联系信箱不能为空。")
	  document.form10.send_mail.focus()
	  return false
	 }
else if (document.form10.send_mail.value.charAt(0)=="." ||        
         document.form10.send_mail.vale.charAt(0)=="@"||       
         document.form10.send_mail.vale.indexOf('@', 0) == -1 || 
         document.form10.send_mail.vale.indexOf('.', 0) == -1 || 
         document.form10.send_mail.vale.lastIndexOf("@")==document.form10.send_mail.vale.length-1 || 
         document.form10.send_mail.vale.lastIndexOf(".")==document.form10.send_mail.vale.length-1)
     {
      alert("Email地址格式不正确！");
      document.form10.send_mail.focus();
      return false;
	 }
return true
}

//输入翻页跳转数字验证
function checkPageGo(){
if(document.formPage.page.value==""){
alert('请跳转页数');
document.formPage.page.focus();
return false;
}
var txt = formPage.page.value; 
if(checknumber(txt)) 
{ 
alert("跳转页数必须为数字"); 
return false; 
} 
return true; 
} 
//验证输入框必须为数字
function checknumber(String) 
{ 
var Letters = "1234567890"; 
var i; 
var c; 
for( i = 0; i < String.length; i ++ ) 
{ 
c = String.charAt( i ); 
if (Letters.indexOf( c ) ==-1) 
{ 
return true; 
} 
} 
return false; 
} 
//验证数字框非数字无法输入
function JHshNumberText()
{
if ( !(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) 
|| (window.event.keyCode == 13) || (window.event.keyCode == 46) 
|| (window.event.keyCode == 45)))
{
window.event.keyCode = 0 ;
}
}


//详细内容文字大中小变化JS
function ContentSize(size)
{
	var obj=document.all.ContentBody;
	obj.style.fontSize=size+"px";
}
//显示FLASH代码

// Show Hide Poll
function WriteFlash(flash,_width,_height) {
document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"" + _width + "\" height=\"" + _height + "\">");
document.writeln("   <param name=\"movie\" value=\"" + flash + "\" />");
document.writeln("   <param name=\"quality\" value=\"high\" />");
document.writeln("   <param name=\"wmode\" value=\"transparent\" />");
document.writeln("   <embed src=\"" + flash + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + _width + "\" height=\"" + _height + "\" wmode=\"transparent\"></embed>");
document.writeln("</object>");
}
//时间显示

function writeDateInfo()
{
         var day="";
         var month="";
         var ampm="";
         var ampmhour="";
         var myweekday="";
         var year="";
         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.write(year+"年"+mymonth+"月"+myday+"日"+weekday);
}
