﻿function Check(str,execStr)
{
    if (execStr.exec(str))
    {
        return true;
    }
    else
    {
        return false;
    }
}

function getXMLHTTPRequest()
{ 
	var xRequest = null; 
	if (window.XMLHttpRequest)
	{
		xRequest=new XMLHttpRequest();
	}
	else if (typeof ActiveXObject != "undefined")
	{
		xRequest=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return xRequest;
}

function sendXMLHTTPRequest(url,parameter,success,fail)
{
	var xmlhttp=getXMLHTTPRequest();
	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
		    if(xmlhttp.status==200)
		    {
		        success.call(this,xmlhttp);
		    }
		    else
		    {
		        fail.call(this);
		    }
		}
	};
	
	xmlhttp.open("post",url,true);
	xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
	xmlhttp.send(parameter);
}

function ShowDialog(str)
{
    return showModalDialog("/js/CheckBox.htm",str,"dialogWidth=500px;dialogHeight=220px;scroll=no;status=no")
}

function ShowLetter(str)
{
    if (str.length > 0)
    {
        showModalDialog("/js/ShowLetter.htm",str,"dialogWidth=500px;dialogHeight=220px;scroll=yes;status=no;");
    }
    else
    {
        alert("该应聘者没有付求职信！");
    }
}

function showInfor()
{
    window.returnValue=false;
    document.getElementById("ShowInfor").innerHTML=window.dialogArguments;
}

function DialogReturnTure()
{
    window.returnValue=true;
    window.close();
}

function DialogReturnFalse()
{
    window.returnValue=false;
    window.close();
}

function BackHome()
{
    if(ShowDialog("请问您确定要取消注册，并且返回首页吗？"))
    {
        location.href("/");
    }
}

function getType()
{
    var type1=document.getElementById("SeaPost1");
    var type2=document.getElementById("SeaPost2");
    var type=type2.value;
    if(type == "00" && type1.value!="00")
    {
        type = type2.value;
    }
    if (type != "00")
    {
        document.getElementById("form_sea").action="/Web/User_Sea.aspx?SeaPost="+type;
    }
    document.getElementById("form_sea").submit();
}

function getType_2008()
{
//    var ActUrl = "/Web/User_Sea_2008.aspx?a=a";
//    var type=document.getElementById("SeaPost").value;
//    alert(type);
//    if (type != "")
//    {
//        document.getElementById("form_sea").action=ActUrl+"&"+type;
//    }
//    
//    type = document.getElementById("SeaAddr").value;
//    alert(type);
//    if (type != "")
//    {
//        document.getElementById("form_sea").action=ActUrl+"&"+type;
//    }
    var str=document.getElementById("SeaText").value;
    if (str.indexOf("<") > 0 || str.indexOf(">") > 0)
    {
        alert("谢谢你对本系统的测试，请不要输入敏感字符！");
        document.getElementById("SeaText").value = "";
        return;
    }
    document.getElementById("form_sea").submit();
}

function setFormTarget(form,target)
{
    var Form = document.getElementById(form);
    if (Form.target != target);
    {
        Form.target = target;
    }
}