function BASEtrim(str) 
{ 
	//去掉空格 
	lIdx=0;rIdx=str.length; 
	if (BASEtrim.arguments.length==2) 
		act=BASEtrim.arguments[1].toLowerCase(); 
	else 
		act="all"; 
	for(var i=0;i<str.length;i++){ 
		thelStr=str.substring(lIdx,lIdx+1); 
		therStr=str.substopenwindowring(rIdx,rIdx-1); 
		if ((act=="all" || act=="left") && thelStr==" "){ 
			lIdx++; 
		} 
		if ((act=="all" || act=="right") && therStr==" "){ 
			rIdx--; 
		} 
	} 
	str=str.slice(lIdx,rIdx); 
	return str; 
}

function showhide(argg)
{
    var x=$(argg).style
    if (x.display=="none")
    {
        x.display="inline";
   
    }
    else {
            x.display="none";
          }
}

function choose_license(para1){
	var s = $(para1).value;
	mywindow = window.open("user_openwindow/openlicense.php?para1="+para1+"&s="+s,"tiger", "height=500,width=540,scrollbars=yes");
	mywindow.moveTo(300,200);
}

function choose_ittech(para1){
	var s = $(para1).value;
	mywindow = window.open("user_openwindow/open_it.php?para1="+para1+"&s="+s,"tiger", "height=500,width=540,scrollbars=yes");
	mywindow.moveTo(300,200);
}

function collect_resume(jobID,userid){
	mywindow = window.open("cor_openwindow/collect.php?jobID="+jobID+"&userid="+userid,"tiger", "height=500,width=540,scrollbars=yes");
	mywindow.moveTo(300,200);
}

function del_applyjob(jobID,userid){
	mywindow = window.open("user_openwindow/del_applyjob.php?jobID="+jobID+"&userid="+userid,"tiger", "height=500,width=540,scrollbars=yes");
	mywindow.moveTo(300,200);
}

function set_value(settext,sethidden,settext_value,sethidden_value){
	window.opener.document.getElementById(settext).value=settext_value;
	window.opener.document.getElementById(sethidden).value = sethidden_value;
	window.close();
}


function alert2gourl(message,href){
	alert(message);
	location.href=href;
}


function Cbg(obj, objColor)
{
	obj.className=objColor
}

function showopendel(message,url){
	if(confirm(message)){
		mywindow = window.open(url,"tiger", "height=400, width=500");
		mywindow.moveTo(300,200);
	}
	
}

function regInput(obj, reg, inputStr)
{
	var docSel	= document.selection.createRange()
	if (docSel.parentElement().tagName != "INPUT")	return false
	oSel = docSel.duplicate()
	oSel.text = ""
	var srcRange	= obj.createTextRange()
	oSel.setEndPoint("StartToStart", srcRange)
	var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
	return reg.test(str)
}

function checkjob(){
	var Position = $('Position').value;
	var Depart_big = $('Depart_big').value;
	var Employee_qty = $('Employee_qty').value;
	var Interview_mode = $('Interview_mode').value;
	if(Position==''){
		alert("请选择一个职位");
		return false;
	}
	
	if(Depart_big==''){
		alert("请选择职位所属部門");
		return false;
	}
	
	if(Employee_qty<1){
		alert("招聘人数至少大于0");
		return false;
	}
	if(Interview_mode=='V003'){
	  code1=trim($('Other_email').value);
	  var len = code1.length;
	  
	  if(len == 0 ){
	    alert('其它email填寫不可为空白 !');
	    return false;}
	  else{
	    if (code1.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi)==null){ 
	      alert('其它email填寫地址格式错误，请正确填写。');
	      return false;
	  	} 
	  }
	}
	return true;
}


function set_value1(settext,sethidden,settext_value,sethidden_value)
{
	window.opener.document.getElementById(sethidden).value = sethidden_value;
	window.opener.document.getElementById(settext).innerHTML = settext_value;
	var str = sethidden+'_str';
	window.opener.document.getElementById(str).value = settext_value;
	window.close();
}




function fninvsh(Lay){
    var tagName = document.getElementById(Lay);
    tagName.style.visibility = 'hidden';
    tagName.style.display = 'none';
}

function fnvshNrm(Lay,jobID){
    var tagName = document.getElementById(Lay);
    tagName.style.visibility = 'visible';
    tagName.style.display = 'block';
    $('jobID').value=jobID;
}
