document.write("<style type=\"text/css\">"); 
document.write(".content_in,.content_in p,.content_in2,ul.list2 li p{text-justify: inter-ideograph; text-align: justify;}");
document.write(".submenu ul li a{filter:Alpha(Opacity=80);}");
document.write("#subcom{filter:Alpha(Opacity=95);}"); 
document.write("#subcom a.sn{*top:0!important;*padding-top:0important}"); 
document.write("</style>"); 

$(function(){
	if ($("body").attr("id") == "P00"){
		$("#general").load("default_ajax.asp?action=menu02");
		$("#general2").load("default_ajax.asp?action=menu05");
		$("#member").load("default_ajax.asp?action=member",function(){p0Ok();});
	}

	$("#logo").append("<span id=\"sresult\"><img src=\"images/lightbox-ico-loading.gif\" width=\"24\" height=\"24\" alt=\"正在传送数据...\" /></span>");
	$("#sresult").css("opacity","0.95");
	$("#frmsearch").submit(function(){searchinput();return false;});
	$("searchGo").click(function(){searchinput();return false;});
	$("#searchArea").click(function(){
		if ($("input[name='keywords']").val() == "请输入搜索文字"){
		$("input[name='keywords']").val("");
		}
	});

     var leng  = $("#flash > ul > li").length;
	 var inde = 0;
	 var introTimer;
	 $('#flash').hover(function(){
			 clearInterval(introTimer);
		 },function(){
			 introTimer = setInterval(function(){
	 $("#flash > ul > li").eq(inde).stop(true,false).animate({opacity:"show"},1000)
		                      .siblings().hide();
				inde++;
				if(inde==leng){inde=0;}
			  } , 4000);
	 }).trigger("mouseleave");
	$("ul.list0 li:even").css("background-color","#EBF4FA");

	if(document.getElementById("flash")){document.getElementById("flash").innerHTML = fplay("images/index.swf", "977px", "265px","full");}
	if(document.getElementById("scontent")){$("div.stitle").eq(0).html(fplay("images/" + ($("#subcomul a.ac").eq(0)).index("#subcomul a") + ".swf", "787px", "120px"));}

	$("#contentNews ul li div").click(function(){window.location = $(this).prev().attr("href");});

	if ($("body").attr("id").length > 4 ){$("#menu04").addClass("menu04Hover");}

	$("#subcom > a.sname,#subcom > a.sn").mouseover(function(){$("#subcomul").show();});
	$("#subcom > a.sname,#subcom > a.sn").mouseout(function(){$("#subcomul").hide();});
	$("#subcomul").mouseover(function(){$(this).show();$("#subcom > a.sname > strong").addClass("ac")});
	$("#subcomul").mouseout(function(){$(this).hide();$("#subcom > a.sname > strong").removeClass("ac")});

	$("#submitjob a").click(function(){$("#submitjob div").show();$(this).addClass("ac");$("div.pagenav").css("bottom","18px");});

	if ($("ul.list1").length > 0) {	$("ul.list1 li a.thumb").lightBox();}
	if ($("ul.list2").length > 0) {	$("ul.list2 li a.thumb").lightBox();}
})

function p0Ok(){
	var aLength = $("#member > ul > li:has(div) > a").length;
	var objTemp;
	for (var i=0; i<aLength; i++){
		objTemp = $("#member > ul > li:has(div) > a").eq(i);
		objTemp.attr("href",objTemp.next(0).eq(0).children("ol").eq(0).children("li").eq(0).children("a").eq(0).attr("href"));
	}

	$("#menu > ul > li > a").bind({	'focus':function(){if(this.blur){this.blur();};}
	});
	$("#member > ul > li:even").addClass("even");
	$("#member > ul > li:gt(7)").addClass("up8");

   $("#menu > ul > li > div > ol >li:first > div.introduction").show();
   $("#menu > ul > li#menu05 > div > ol >li:first > div.introduction").show();
   $("#product ol li").eq(0).find("p").show();
   $("#general ol li").eq(0).addClass("generalHover");
   $("#general2 ol li").eq(0).addClass("generalHover");
   $("#product ol li").eq(0).find("span").css("color","#0089fb");
   $("#product ol li").eq(0).find("a.subn").css("background-color","#E0EBF5");
   $("#contentNews ul li").eq(0).find("div").show();
   $("#contentNews ul li").eq(0).find("a").addClass("newsHover");
   $(".member01 div").show();
   $(".member01").addClass("member01Hover");

   $("#menu01").addClass("menu01Hover");
   $("#menu01 > a").mouseover(function(){
		$(this).parents("#menu01").addClass("menu01Hover");
		$("#menu02").removeClass("menu02Hover");
		$("#menu03").removeClass("menu03Hover");
		$("#menu04").removeClass("menu04Hover");
		$("#menu05").removeClass("menu05Hover");
		$("#menu06").removeClass("menu06Hover");
		$(this).parents("#menu01").siblings().children("div").hide();
		$(this).next("div").show();
	});
   $("#menu02 > a").mouseover(function(){
		$(this).parents("#menu02").addClass("menu02Hover");
		$("#menu01").removeClass("menu01Hover");
		$("#menu03").removeClass("menu03Hover");
		$("#menu04").removeClass("menu04Hover");
		$("#menu05").removeClass("menu05Hover");
		$("#menu06").removeClass("menu06Hover");
		$(this).parents("#menu02").siblings().children("div").hide();
		$(this).next("div").show();
	});
   $("#general ol li a").mouseover(function(){
		$(this).parents("#general ol li").addClass("generalHover");
		$(this).parents("#general ol li").siblings().removeClass("generalHover");
		$(this).parents("#general ol li").siblings().children("div").hide();
		$(this).next("div").show();
	});
   $("#general2 ol li a").mouseover(function(){
		$(this).parents("#general2 ol li").addClass("generalHover");
		$(this).parents("#general2 ol li").siblings().removeClass("generalHover");
		$(this).parents("#general2 ol li").siblings().children("div").hide();
		$(this).next("div").show();
	});
	$("#menu03 > a").mouseover(function(){
		$(this).parents("#menu03").addClass("menu03Hover");
		$("#menu01").removeClass("menu01Hover");
		$("#menu02").removeClass("menu02Hover");
		$("#menu04").removeClass("menu04Hover");
		$("#menu05").removeClass("menu05Hover");
		$("#menu06").removeClass("menu06Hover");
		$(this).parents("#menu03").siblings().children("div").hide();
		$(this).next("div").show();
	});
	$("#menu04 > a").mouseover(function(){
		$(this).parents("#menu04").addClass("menu04Hover");
		$("#menu01").removeClass("menu01Hover");
		$("#menu02").removeClass("menu02Hover");
		$("#menu03").removeClass("menu03Hover");
		$("#menu05").removeClass("menu05Hover");
		$("#menu06").removeClass("menu06Hover");
		$(this).parents("#menu04").siblings().children("div").hide();
		$(this).next("div").show();
	});
	$("#menu05 > a").mouseover(function(){
		$(this).parents("#menu05").addClass("menu05Hover");
		$("#menu01").removeClass("menu01Hover");
		$("#menu02").removeClass("menu02Hover");
		$("#menu03").removeClass("menu03Hover");
		$("#menu04").removeClass("menu04Hover");
		$("#menu06").removeClass("menu06Hover");
		$(this).parents("#menu05").siblings().children("div").hide();
		$(this).next("div").show();
	});
	$("#menu06 > a").mouseover(function(){
		$(this).parents("#menu06").addClass("menu06Hover");
		$("#menu01").removeClass("menu01Hover");
		$("#menu02").removeClass("menu02Hover");
		$("#menu03").removeClass("menu03Hover");
		$("#menu04").removeClass("menu04Hover");
		$("#menu05").removeClass("menu05Hover");
		$(this).parents("#menu06").siblings().children("div").hide();
		$(this).next("div").show();
	});

  $("li.member01").mouseover(function(){
	$(this).addClass("member01Hover");
	$("#member ul li div ol li.member02").removeClass("member02Hover");
	$("#member ul li div ol li.member03").removeClass("member03Hover");
	$(this).siblings().children("div").hide();
	$(this).children("div").show();
});
  $("#member ul li div ol li.member02").mouseover(function(){
	$(this).addClass("member02Hover");
	$("#member ul li div ol li.member01").removeClass("member01Hover");
	$("#member ul li div ol li.member03").removeClass("member03Hover");
	$(this).siblings().children("div").hide();
	$(this).children("div").show();
});
  $("#member ul li div ol li.member03").mouseover(function(){
	$(this).addClass("member03Hover");
	$("#member ul li div ol li.member02").removeClass("member02Hover");
	$("#member ul li div ol li.member01").removeClass("member01Hover");
	$(this).siblings().children("div").hide();
	$(this).children("div").show();
});
  $("#member > ul > li:has(div)").hover(function(){
	$(this).addClass("memberHover");
	$(this).css("z-index","2");
	$(this).children("div").eq(0).children("ol").eq(0).children("li").eq(1).removeClass("member02Hover");
	$(this).children("div").eq(0).children("ol").eq(0).children("li").eq(2).removeClass("member03Hover");
	$(this).children("div").eq(0).children("ol").eq(0).children("li").eq(0).addClass("member01Hover");
	$(this).children("div").eq(0).children("ol").eq(0).children("li").children("div").hide();
	$(this).children("div").eq(0).children("ol").eq(0).children("li").children("div").eq(0).show();
	$(this).children("div").show();
},function(){
	$(this).css("z-index","1");
	$(this).removeClass("memberHover");
	$(this).children("div").hide();
   });

   $("#product > ol > li > a").mouseover(function(){
		if($(this).attr("href")=="#"){$(this).attr("href",$(this).next("p").children("a").eq(0).attr("href"));}
		$(this).css("background-color","#E0EBF5");
		$(this).children("span").css("color","#0089fb");
		$(this).next("p").stop(true,true).show();
		$(this).parents("#product ol li").siblings().children("a").css("background","none");
		$(this).parents("#product ol li").siblings().find("span").css("color","#003366");
		$(this).parents("#product ol li").siblings().children("p").hide();
	});
   $("#contentNews ul li a").mouseover(function(){
	$(this).parents("#contentNews ul li").siblings().find("a").removeClass("newsHover");
	$(this).addClass("newsHover");
	$(this).parents("#contentNews ul li").siblings().children("div").hide();
	$(this).next().show();
	return false;
	});
	$("#tjobs thead a").click(function(){
		if ($(this).attr("id") == 'availabe_date'){
			jsort($(this).attr("id"),'desc');
		}else{
			jsort($(this).attr("id"),'asc');					
		}
	});
}

function jsort (sortname,sort_d){
	showrequest("_jobs_ajax.asp?sort=" + sortname + "&sort_d=" + sort_d,"jobs",true);
}

function fplay(swf, swfwidth, swfheight,full) {
    if (navigator.userAgent.indexOf('Firefox') > - 1) {
		if (full == "full"){
	        return('<embed src="' + swf + '" width="' + swfwidth + '" height="' + swfheight + '" quality="high" wmode="Opaque" allowFullScreen="true" allowScriptAccess="always"></embed>');
		}else{
        return('<embed src="' + swf + '" width="' + swfwidth + '" height="' + swfheight + '" quality="high" wmode="transparent"></embed>');}
    } else {
		if (full == "full"){
			return('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + swfwidth + '" height="' + swfheight + '"><param name="movie" value="' + swf + '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="Opaque" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>');
		}else{
        return('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + swfwidth + '" height="' + swfheight + '"><param name="movie" value="' + swf + '" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="wmode" value="transparent" /></object>');}
    }
}

function searchinput(){
	if ($("input[name='keywords']").attr("value") == "" || $("input[name='keywords']").attr("value") == "请输入搜索文字"){
		alert("请输入搜索文字");
		$("input[name='keywords']").val("");
	    $("input[name='keywords']").focus();
		return false;
    }else{
		$("input[name='keywords']").attr("value",trim($("input[name='keywords']").attr("value")));
		$("#sresult").css("display","block");
		$("#sresult").html("<img src=\"images/lightbox-ico-loading.gif\" width=\"24\" height=\"24\" alt=\"正在传送数据...\" />");

		showrequest("search_ajax.asp?keywords=" + encodeURIComponent(escape($("input[name='keywords']").attr("value"))),"sresult",false);
		cls_button();
	}
}

function trim(a_strVarContent) {
var pos1, pos2, newstring;pos1 = 0;pos2 = 0;newstring = "";
	if ( a_strVarContent.length > 0 ) {
		for( i=0; i<=a_strVarContent.length; i++) { 
			if ( a_strVarContent.charAt(i) == " " ) pos1 = pos1 + 1;
			else break;
		} 
		for( i=a_strVarContent.length; i>=0 ; i--) {
			if ( a_strVarContent.charAt(i) == " " ) pos2 = pos2 + 1;
			else break;
		}
		newstring = a_strVarContent.substring(pos1, a_strVarContent.length-pos2) 
	} 
	return newstring; 
} 

function searchp(keywords,r,p,ttype){
	showrequest("search_ajax.asp?keywords=" + keywords + "&r=" + r + "&p=" + p + "&type=" + ttype,"sresult",false);cls_button();
	return false;
}

function cls_button(){
	nCol = $("#sresult > A");
	for (i=0;i<nCol.length;i++){
		if (nCol[i].className == "cls"){
			nCol[i].onclick = function(){
				this.parentNode.style.display = "none";
			}
		}
	}
}

var http_request = false;
function showrequest(url,element,asyn) {
	var isFFCLS = true;
	http_request = false;
    if (window.XMLHttpRequest) {
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {
            http_request.overrideMimeType('text/xml');
        }
    } else if (window.ActiveXObject) {
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
            http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    if (!http_request) {alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
    http_request.onreadystatechange = sub_showrequest;
    http_request.open('GET', url, asyn);
    http_request.send(null);
	if ((!asyn) && (isFFCLS)) sub_showrequest();
	function sub_showrequest(){
	    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
			isFFCLS = false;
			document.getElementById(element).innerHTML = http_request.responseText;
        } else {alert('There was a problem with the request.');}
		}	
	}
}

/**/
function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  for (var i = 0; i<form.elements.length; i++) {
    field = form.elements[i];
    if (field.type.toUpperCase() != 'FILE') continue;
    checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
    if (field.value == '') {
      if (requireUpload) {alert('File is required!');document.MM_returnValue = false;field.focus();return;}
    } else {
      if(extensions != '' && !re.test(field.value)) {
        alert('This file type is not allowed for uploading.\nOnly the following file extensions are allowed: ' + extensions + '.\nPlease select another file and try again.');
        document.MM_returnValue = false;field.focus();return;
      }
    document.PU_uploadForm = field.form;
    re = new RegExp(".(gif|jpg|png|bmp|jpeg)$","i");
    if(re.test(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
      checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
    } }
}

function showImageDimensions(fieldImg) { //v2.09
  var isNS6 = (!document.all && document.getElementById ? true : false);
  var img = (fieldImg && !isNS6 ? fieldImg : this);
  if (img.width > 0 && img.height > 0) {
  if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
    alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); return;}
  if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
    alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); return;}
  if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
    alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); return;}
  if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
  if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
  document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
  if (!document.layers) {
    var isNS6 = (!document.all && document.getElementById ? true : false);
    document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
    if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
		   with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
  	   gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
	 } else showImageDimensions(field.gp_img);}
}

function IsDigit(cCheck)
    {
    return (('0'<=cCheck) && (cCheck<='9'));
    }

function IsAlpha(cCheck)
    {
    return ((('a'<=cCheck) && (cCheck<='z')) || (('A'<=cCheck) && (cCheck<='Z')))
    }

function year2k(d) {
   return (d < 1000) ? d + 1900 : d;
   }

function isDate (year, month, day)
{
   // month argument must be in the range 1 - 12
   month = month - 1;  // javascript month range : 0- 11
   var tempDate = new Date(year,month,day);

   if ( (year2k(tempDate.getYear()) == year) &&
      (month == tempDate.getMonth()) &&
      (day == tempDate.getDate()) )
	{

      return true;
	}
   else
	{
      return false;
     }
}

function chklogin()
{
var newDateObj = new Date()

    if (document.job_form.surname.value == "")
		{
		alert("尊姓？");
		document.job_form.surname.focus();
		return false;
		}
    if (document.job_form.f_name.value == "")
		{
		alert("大名？");
		document.job_form.f_name.focus();
		return false;
		}

    if (isNaN(document.job_form.year.value) || document.job_form.year.value > newDateObj.getFullYear()  || document.job_form.year.value < 1910)
		{
		alert("请输入正确的出生年份");
		document.job_form.year.focus();
		return false;
		}

	if (isNaN(document.job_form.month.value) || document.job_form.month.value > 12  || document.job_form.month.value < 1)
		{
		alert("请输入正确的出生月份");
		document.job_form.month.focus();
		return false;
		}

	if (isNaN(document.job_form.day.value) || document.job_form.day.value > 31  || document.job_form.day.value < 1)
		{
		alert("请输入正确的出生日期");
		document.job_form.day.focus();
		return false;
		}

	if (!isDate(document.job_form.year.value, document.job_form.month.value, document.job_form.day.value)){
		  alert("日期组合错误，请检查生日组合。\r\n\r\n[ 提示：某些月份没有31日，二月没有30日，有的没有29日]");
		  document.job_form.day.focus();
		  return false;
		}

	strage = document.job_form.year.value + "-" + document.job_form.month.value + "-" + document.job_form.day.value;
	document.job_form.birth.value = strage;

	if (document.job_form.tel.value == "" && document.job_form.mobile.value =="")
    {
        alert("请输入您的联系电话或者手机号码");
        document.job_form.tel.focus();
        return false;
    }
	if (document.job_form.email.value==""){
		alert("请输入您的电子信箱，请留下正确的电子信箱。\n因为我们要通过EMAIL与您联系，如果您收不到我们的邮件，您的应聘不会成功。\n不用担心垃圾邮件，因为您的Email不会出现在公开的网页上。");
		document.job_form.email.focus();
		return false;
	}
	if (document.job_form.xuexiao1.value==""){
		alert("请输入毕业学校");
		document.job_form.xuexiao1.focus();
		return false;
	}
	if (document.job_form.zhuanye1.value==""){
		alert("请输入您所学专业");
		document.job_form.zhuanye1.focus();
		return false;
	}
	if (document.job_form.jingli.value==""){
		alert("请输入您的工作经历");
		document.job_form.jingli.focus();
		return false;
	}
	if (document.job_form.dongji.value==""){
		alert("胜任该工作的理由？");
		document.job_form.dongji.focus();
		return false;
	}
	if (document.job_form.nextyear.value==""){
		alert("您在未来一年的工作规划？");
		document.job_form.nextyear.focus();
		return false;
	}


	return true;
}


function chkmail(aa, graf)
{
   var pos = 0;
   var num = -1;
   var i = -1;
   var email = new Array()
   
   while (pos != -1)
   {
      pos = graf.indexOf(";",i+1);
      num += 1;
      if (pos == -1) { email[num] = graf.substring(i+1,graf.length); }
      else { email[num] = graf.substring(i+1,pos); }
      i = pos;
   }
   for ( i = 0 ; i <= num ; i++ )
   {
     if (email[i].length > 0)
     {
       l=email[i].indexOf("@");
       j=email[i].indexOf(".",l);
       k=email[i].indexOf(",");
       kk=email[i].indexOf(" ");
       jj=email[i].lastIndexOf(".") + 1;
       ll=email[i].indexOf(":");
       mm=email[i].indexOf("(");
       nn=email[i].indexOf(")");
       oo=email[i].indexOf("");
       len=email[i].length;

       if ((l <= 0) || (j <= (1+1)) || (k != -1) || (kk != -1) || (len-jj < 2) || (len-jj > 3) || (ll != -1) || (mm != -1 ) || (nn != -1) || (oo != -1))
       {
       	   if ( aa == "" ) { alert("您输入的 email 地址不正确，不用担心垃圾邮件，因为您的Email不会出现在公开的网页上。");
		   		document.job_form.email.focus();}
       	   else { alert("您输入的 email 地址不正确，不用担心垃圾邮件，因为您的Email不会出现在公开的网页上。");
		   		document.job_form.email.focus();}
           return false;
       }
     }
   }
   return true;
}

function noerror()
{
     if (document.job_form.surname.value == "")
		{
		alert("姓名？");
		document.job_form.surname.focus();
		return false;
		}

     if (document.job_form.attachment.value == "")
		{
		alert("请填写应聘表");
		document.job_form.attachment.focus();
		return false;
		}

	return confirm('简历无误？');
    return( true ) ;
}

