﻿/// <reference path="../jQuery-vsdoc.js" />
function setImgSize(img,width,height){
    var MaxWidth=width;//设置图片宽度界限
    var MaxHeight=height;//设置图片高度界限
    var HeightWidth=img.offsetHeight/img.offsetWidth;//设置高宽比
    var WidthHeight=img.offsetWidth/img.offsetHeight;//设置宽高比
    if(img.offsetWidth>MaxWidth){
        img.width=MaxWidth;
        img.height=MaxWidth*HeightWidth;
    }
    if(img.offsetHeight>MaxHeight){
        img.height=MaxHeight;
        img.width=MaxHeight*WidthHeight;
    }
}

function searchjob()
{
    var kw=$("#jobname").val();
    if(kw=="")
    {
        alert("职位名称不能为空");
    }
    else
    {
        window.location.href="job-"+$("#coltype").val()+".aspx?kw="+escape(kw);
    }
}

function searchjob2()
{
    var kw=$("#jobname").val();
    if(kw=="")
    {
        alert("职位名称不能为空");
    }
    else
    {
        window.location.href="job-"+$("#coltype").val()+".aspx?kw="+escape(kw)+"&workplace="+escape($("#workplace").val())+"&fabutime="+escape($("#fabutime").val())+"&endtime="+escape($("#endtime").val())+"&sex="+escape($("#sex").val());
    }
}

function setItem(tobj,prex) {

    if (!prex) prex = "";
    

    var obj = $("#" + tobj);
    var y;
    if (tobj == "tablefamily") {
        y = parseInt($("#" + prex + "tablefamilynum").val());
        $("<tr><td><input name=\"tablefamily_name" + y + "\" id=\"tablefamily_name" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:60px;\" /></td><td><input name=\"tablefamily_rel" + y + "\" id=\"tablefamily_rel" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:80px;\" /></td><td><input name=\"tablefamily_job" + y + "\" id=\"tablefamily_job" + y + "\" type=\"text\"  class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:80px;\" /></td><td><input name=\"tablefamily_tel" + y + "\" id=\"tablefamily_tel" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:130px;\" /></td><td><input name=\"tablefamily_address" + y + "\" id=\"tablefamily_address" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:300px;\" /></td></tr>").appendTo(obj);
        $("#" + prex + "tablefamilynum").val(y + 1);
    }
    else if (tobj == "tablejiaoyu") {
        y = parseInt($("#" + prex + "tablejiaoyunum").val());
        $("<tr><td><input id=\"tablejiaoyu_begintime" + y + "\" name=\"tablejiaoyu_begintime" + y + "\" type=\"text\" value =\"\" size=\"6\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\"   /> — <input id=\"tablejiaoyu_endtime" + y + "\" name=\"tablejiaoyu_endtime" + y + "\" type=\"text\" value =\"\" size=\"6\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\"   /></td><td><input name=\"tablejiaoyu_school" + y + "\" id=\"tablejiaoyu_school" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:90px;\" /></td><td><input name=\"tablejiaoyu_xueyuan" + y + "\" id=\"tablejiaoyu_xueyuan" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:90px;\" value=\"\" /></td><td><input name=\"tablejiaoyu_zy" + y + "\" id=\"tablejiaoyu_zy" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:70px;\" /></td><td><select name=\"tablejiaoyu_learn" + y + "\" id=\"tablejiaoyu_learn" + y + "\" ><option value=\"全日制重点大学\">全日制重点大学</option><option selected=\"selected\" value=\"全日制普通高校\">全日制普通高校</option><option value=\"自学考试\">自学考试</option><option value=\"成人大学\">成人大学</option><option value=\"电视大学\">电视大学</option><option value=\"网络大学\">网络大学</option><option value=\"函授大学\">函授大学</option><option value=\"夜大\">夜大</option><option value=\"职业大学\">职业大学</option><option value=\"其他\">其他</option></select></td><td><select id=\"tablejiaoyu_xueli" + y + "\" name=\"tablejiaoyu_xueli" + y + "\"><option value=\"小学\">小学</option><option value=\"初中\">初中</option><option value=\"高中\">高中</option><option value=\"中专\">中专</option><option value=\"大专\">大专</option><option selected=\"selected\" value=\"本科\">本科</option><option value=\"硕士\">硕士</option><option value=\"博士\">博士</option></select></td><td><select id=\"tablejiaoyu_xuewei" + y + "\" name=\"tablejiaoyu_xuewei" + y + "\"><option value=\"大专以下\">大专以下</option><option value=\"大专\">大专</option><option selected=\"selected\" value=\"学士\">学士</option><option value=\"双学士\">双学士</option><option value=\"硕士\">硕士</option><option value=\"博士\">博士</option></select></td></tr>").appendTo(obj);

        $("#" + prex + "tablejiaoyunum").val(y + 1);
    }
    else if (tobj == "tabletrain") {
        y = parseInt($("#" + prex + "tabletrainnum").val());
        $("<tr><td><input id=\"tabletrain_begintime" + y + "\" name=\"tabletrain_begintime" + y + "\" type=\"text\" value =\"\" size=\"6\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\"   /> — <input id=\"tabletrain_endtime" + y + "\" name=\"tabletrain_endtime" + y + "\" type=\"text\" value =\"\" size=\"6\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\"   /></td><td><input name=\"tabletrain_school" + y + "\" id=\"tabletrain_school" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:200px;\" /></td><td><input name=\"tabletrain_kc" + y + "\" id=\"tabletrain_kc" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:150px;\" /></td><td><input name=\"tabletrain_zs" + y + "\" id=\"tabletrain_zs" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:150px;\" /></td></tr>").appendTo(obj);
        $("#" + prex + "tabletrainnum").val(y + 1);
    }
    else if (tobj == "tableskll") {
        y = parseInt($("#" + prex + "tableskllnum").val());
        $("<tr><td><select name=\"tableskll_type" + y + "\" id=\"tableskll_type" + y + "\"><option value=\"职业技能\">职业技能</option><option value=\"语言技能\">语言技能</option><option value=\"计算机技能\">计算机技能</option><option value=\"其他技能\">其他技能</option></select></td><td><input name=\"tableskll_title" + y + "\" id=\"tableskll_title" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:150px;\" /></td><td><input name=\"tableskll_des" + y + "\" id=\"tableskll_des" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:300px;\" /></td><td><select name=\"tableskll_time" + y + "\" id=\"tableskll_time" + y + "\"><option value=\"1个月\">1个月</option><option value=\"2个月\">2个月</option><option value=\"3个月\">3个月</option><option value=\"4个月\">4个月</option><option value=\"5个月\">5个月</option><option value=\"6个月\">6个月</option><option value=\"9个月\">9个月</option><option value=\"1年\">1年</option><option value=\"2年\">2年</option><option value=\"3年或以上\">3年或以上</option></select></td></tr>").appendTo(obj);
        $("#" + prex + "tableskllnum").val(y + 1);
    }
    else if (tobj == "tablework") {
        y = parseInt($("#" + prex + "tableworknum").val());
        $("<tr><td><input id=\"tablework_begintime" + y + "\" name=\"tablework_begintime" + y + "\" type=\"text\" value =\"\" size=\"6\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\"   /> — <input id=\"tablework_endtime" + y + "\" name=\"tablework_endtime" + y + "\" type=\"text\" value =\"\" size=\"6\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\"   /></td><td><input name=\"tablework_company" + y + "\" id=\"tablework_company" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:100px;\" /></td><td><input name=\"tablework_zhich" + y + "\" id=\"tablework_zhich" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:60px;\"  value=\"\" /></td><td><input name=\"tablework_depart" + y + "\" id=\"tablework_depart" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:80px;\" /></td><td><input name=\"tablework_jw" + y + "\" id=\"tablework_jw0tablework_jw" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:80px;\" /></td><td><input name=\"tablework_zmr" + y + "\" id=\"tablework_zmr" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:80px;\" /></td><td><input name=\"tablework_tel" + y + "\" id=\"tablework_tel" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:80px;\" /></td></tr><tr><td style=\"text-align:right;padding-right:5px;\">主要工作内容</td><td colspan=\"6\"><input name=\"tablework_content" + y + "\" id=\"tablework_content" + y + "\" type=\"text\" class=\"FormBase\" onfocus=\"this.className='FormFocus';\" onblur=\"this.className='FormBase';\" style=\"width:500px;\" /></td></tr>").appendTo(obj);
        $("#" + prex + "tableworknum").val(y + 1);
    }
}


function sroom()
{
    if($("#start").val()==""||$("#end").val()=="")
    {
        alert("请选择时间!");
        return ;
    }
    var url="http://www.fliport.com/order.aspx?SubCompanyID="+$("#ddlHotel").val()+"&Start="+$("#start").val()+"&End="+$("#end").val()+"&Adult="+$("#ddlAdult").val()+"&Children="+$("#ddlChildren").val()+"&RoomNum="+$("#ddlRoomNum").val()+"&AddBed="+$("#ddlAddBed").val()+"";
    window.open(url);
    return false;
}

function sroom2()
{
    if($("#start").val()==""||$("#end").val()=="")
    {
        alert("请选择时间!");
        return ;
    }
    var url="http://www.fliport.com/order.aspx?SubCompanyID="+$("#ddlHotel").val()+"&Start="+$("#start").val()+"&End="+$("#end").val()+"&Adult=1&Children=0&RoomNum=1&AddBed=0";
    window.open(url);
    return false;
}

function gethb()
{
    if($("#chsxm").attr("checked"))
    {
        var SFZ=$("#SFZ").val();
        var MDZ=$("#MDZ").val();
        var GS_EZM="";
        window.location.href='oai_ques.aspx?SFZ='+SFZ+'&MDZ='+MDZ+'&GS_EZM='+GS_EZM;
    }
    else if($("#chsfz").attr("checked"))
    {
        var Area=$("#Area").val();
        var Host=$("#Host").val();
        window.location.href='oai_ques_fz.aspx?Area='+Area+'&Host='+escape(Host);
    }
    else if($("#chsly").attr("checked"))
    {
        window.location.href="oai_ques_ly.aspx";
    }
    return;
}

function gethbjh1()
{
    var SFZ=$("#SFZ_jf").val();
    if(SFZ=="")
    {
        return ;
    }
    window.location.href='flightInfo.aspx?SFZ='+SFZ;
}

function gethbjh2()
{
    var MDZ=$("#MDZ_jf").val();
    if(MDZ=="")
    {
        return ;
    }
    window.location.href='flightInfo2.aspx?MDZ='+MDZ;
}

function serch()
{
    var kws=$("#kws").val();
    if(kws!="" || kws=="请输入关键字")
    {
        window.location.href="search.aspx?kw="+escape(kws);
    }
    else
    {
        alert("请输入关键字");
    }
}

function chtab(obj,stab,oimg,otab)
{
    obj.src=obj.src.replace("index00","index0");
    var rl= $("#"+oimg).attr("src");
    if(rl.indexOf("index00")>0)
    {
    }else
    {
    $("#"+oimg).attr("src",rl.replace("index0","index00"));
    }
    $("#"+stab).show();
    $("#"+otab).hide();
}

function sethyno(obj)
{
    if($(obj).val()=="2"||$(obj).val()=="4")
    {
        $("#tbfno").show();
        $("#tbfytips").hide();
    }
    else
    {
        $("#tbfno").hide();
        $("#tbfytips").show();
    }
}

function gethygoods()
{
    var GoodsType=$("#GoodsType").val();
    var no=$("#no").val();
    var fno=$("#fno").val();
    if(GoodsType=="1"||GoodsType=="3")
    {
        if(no=="")
        {
            alert("请输入货单号");
            return ;
        }
    }
    else
    {
        if(no==""|| fno=="")
        {
            alert("请输入货单号");
            return ;
        }
    }
    if(GoodsType=="1"||GoodsType=="2")
    {
        window.location.href="hdresult.aspx?type="+GoodsType+"&no="+no+"&fno="+fno;
    }
    else
    {
        window.location.href="hdresultout.aspx?type="+GoodsType+"&no="+no+"&fno="+fno;
    }
}


function getfzoutgoods(type,getobj)
{
    var CargoNO=$("#"+getobj).val();
    if(CargoNO==""||CargoNO=="请输入货单号"  )
    {
        alert("请输入货单号");
        return ;
    }
    window.location.href='CargoQueryResult.aspx?CargoType='+type+'&CargoNO='+CargoNO;
    return false;
}
function tofliport()
{
    var txtUserName=$("#txtUserName").val();
    var txtPass=$("#txtPass").val();
    if(txtUserName==""||txtPass==""  )
    {
        alert("请输入用户名和密码！");
        return ;
    }
    //window.location.href='http://www.fliport.com//xiagc/xiagclogin.aspx?u='+txtUserName+'&p='+txtPass;
	window.open('http://www.fliport.com//xiagc/xiagclogin.aspx?u='+txtUserName+'&p='+txtPass);
	$("#txtUserName").val("");
	$("#txtPass").val("");
    return false;
}

function fGetStyleList(obj,fixleft,fixtop) {
	 if(!fixleft) fixleft=9;
	 if(!fixtop) fixtop=17;
	 var position = $(obj).position();
	 var _left=position.left-(fixleft);
	 var _top=position.top+(fixtop);
	 $("#dvStyleList").css({"left":_left,"top":_top});
	 $("#dvStyleList").slideDown(300);
}
function fSetStyle(v,obj)
{
    $("#stype").val(v);
    $("#lnkStyle").html($(obj).text()+"<b class=\"logTb_b\">&nbsp;&nbsp;&nbsp;&nbsp;</b>");
    $("#dvStyleList").hide();
}