
	function FontColor(name,colorname)
	{
		window.alert(name);
		//name.style.color=colorname;
		return true;
	}

  function openwindow(url)
  {
	  //alert(url);
      window.open(url,"open","width=430,height=430,scrollbars=1");  
  }
  
   function openwindow2(url,value)
  {
	  //alert(url);
      window.open(url,value,"width=620,height=630,scrollbars=1");  
  }
  function openwindow1(url)
  {
	   //window.showModalDialog(url,window,"scrollbars=yes;resizable=no;help=no;status=no;dialogTop=25; dialogLeft=0;dialogWidth=430px;dialogHeight=330px");
	   //window.showModalDialog(url,open);
  }
	//判断为空，如果为空则弹出提示框
	function PageNONull(objname,mess)
  	{		
		var NullValue=objname.value;
		//alert(NullValue);
		if(NullValue=="")
		{
			//alert(mess);
			objname.focus();
			return false;
		}
		return true;
 	 }
	 //不能出现为下拉框中为0值的情况
	function PageNODefault(objname,mess)
  	{
		var NullValue=objname.value;
		//alert(NullValue);
		if(NullValue=="0")
		{
			//alert(mess);
			objname.focus();
			return false;
		}
		return true;
 	 }
	 //true为mail
	  function ismail(mail,mess)
      { 		  
        if(!new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(mail))
		{			
			alert(mess);
			return false;
		}
		return true;
      }

//判断字符数是否达到最在限制
function checkStrLen(value,maxLen){
	var str,Num = 0;
	for (var i=0;i<value.length;i++){
		str = value.substring(i,i+1);
		if (str<="~") //判断是否双字节
			Num+=1;
		else
			Num+=2;
	}
	if (Num>=maxLen+1)
	{ 
	return false;		
	}
	else
	{
		return true;
	}	
}
//取字符数
function StrLen(value){
	var str,Num = 0;
	for (var i=0;i<value.length;i++){
		str = value.substring(i,i+1);
		if (str<="~") //判断是否双字节
			Num+=1;
		else
			Num+=2;
	}
	return Num;
}

//判断字符数是否达到最在限制及字数统计及显示	  
function changeText3(objElement,objDisplayer,maxLen) 
{
	///////////
	//window.alert('c'.charCodeAt(0));
	//var currLen;
	var str,currLen = 0;
	var value=objElement.value;
	for (var i=0;i<value.length;i++){
		str = value.substring(i,i+1);
		if (str<="~") //判断是否双字节
			currLen+=1;
		else
			currLen+=2;
	}
   // currLen=objElement.value.length;
    if (currLen>maxLen){
		objDisplayer.innerHTML = "" + currLen;
	}else{
		objDisplayer.innerHTML = "" + currLen;
	}
	///////////
	var currValue;
	currValue=new String();
	currValue=objElement.value;
	currLen=currValue.length;
    if (currLen>=maxLen+1){
		if((event.keyCode>="0".charCodeAt(0) && event.keyCode<='9'.charCodeAt(0)) || (event.keyCode>='A'.charCodeAt(0) && event.keyCode<='Z'.charCodeAt(0)) || (event.keyCode>='a'.charCodeAt(0) && event.keyCode<='z'.charCodeAt(0))){			
			window.alert("字数已经超过最大长度！Max."+maxLen+" Letters,Please retry!");				
			//currValue=currValue.substring(0,maxLen);
			//objElement.value=currValue;		
		}else{
			//do nothing
			
		}		
	}
}
function Apply_OutLook(mailto,position_id,lang_id)
{
	var subject;
	var disclaim;
	var body;
    var doc;
	if(lang_id=="E")
	{
  	 subject = "Job Application";
     disclaim = "\n**Please note that 1010job Reading Service is aimed at " +
                   "benefiting the job seekers as well as the general public at large. \n" +
                   "If you do not wish to continue with the service provided, please notify \n"+
                   "us at readingservice@1010job.com and we will make necessary arrangement accordingly.\n";  
                  
     body    = "Dear Sir/Madam, \n\n" +
	          " I write to apply for a position in your company [Ref. no.: "+position_id+"]\n" +
	          "as described in the 1010job.com recruitment website. \n"+ 
	          " Herewith is my CV. \n\n " +
                  "Thank you for your kind attention. \n" +
                  "\n\n\r"+
                  "Yours sincerely\n"+	
                  " \n\n\r ";
	doc = "mailto:"+escape(mailto) +
        "?subject=" + escape(subject)  + 
        "&cc=" + 'visitor@1010job.com' +
        "&body=" + escape(body);
	 }
	 else
	 {
		subject = "职位申请";
    	disclaim = "1010job提供更多工作机会!" ;  
		body    = "尊敬的人事部负责人, 您好!%0A%0A" +
	          "感谢您予以关注。我特此前来应聘贵公司刊登在1010job招聘网站上的职位 [职位编号："+position_id+"]。%0A" +	          
	          " %0A附上我的个人简历。祝工作顺利!%0A%0A" + 
			  "谨上%0A";	
		doc = "mailto:"+escape(mailto) +
        "?subject=" + subject  + 
        "&cc=" + 'visitor@1010job.com' +
        "&body=" + body;

		 }	          
	       
	//alert(doc);
    // POP UP EMAIL MESSAGE WINDOW
  window.location = doc;   
}

function Apply_Contactus(position_id,lang_id)
{
	var subject;
	var disclaim;
	var body;
    var doc;
    var mailto;
    mailto = "customer@1010job.com";
	if(lang_id=="E")
	{
  	 subject = "Job Application";
     disclaim = "\n**Please note that 1010job Reading Service is aimed at " +
                   "benefiting the job seekers as well as the general public at large. \n" +
                   "If you do not wish to continue with the service provided, please notify \n"+
                   "us at readingservice@1010job.com and we will make necessary arrangement accordingly.\n";  
                  
     body    = "Dear Sir/Madam, \n\n" +
	          " I write to apply for a position in your company [Ref. no.: "+position_id+"]\n" +
	          "as described in the 1010job.com recruitment website. \n"+ 
	          " Herewith is my CV. \n\n " +
                  "Thank you for your kind attention. \n" +
                  "\n\n\r"+
                  "Yours sincerely\n"+	
                  " \n\n\r ";
	doc = "mailto:"+escape(mailto) +
        "?subject=" + escape(subject)  + 
        "&cc=" + 'visitor@1010job.com' +
        "&body=" + escape(body);
	 }
	 else
	 {
		subject = "求助职位申请";
    	disclaim = "1010job提供更多工作机会!" ;  
		body    = "您好!%0A%0A" +
	          "我无法申请1010job招聘网站上的职位 [职位编号："+position_id+"]。%0A";	
		doc = "mailto:"+escape(mailto) +
        "?subject=" + subject  + 
        "&cc=" + 'webmaster@1010job.com' +
        "&body=" + body;

		 }	          
	       
	//alert(doc);
    // POP UP EMAIL MESSAGE WINDOW
  window.location = doc; 
}