﻿// JScript 文件
window.IncludeFile={"header":"head.html","tailer":"tail.html"}; 
window.JsModule=["system/jqframe.js","plugins/grid/js/jqModal.js","plugins/grid/js/jqDnR.js","js/all_jpgys.js"];
window.EhaiGrid={curPage:1,curRowNum:1,totalRecord:-1,curFun:null,bDiv:null,sc:null};
function WebMain()
{ 
    $.SetFormat("zh","settypesmal2","<p><a href=\"zlpricelist.html?{'Sort':'#1#'}\">#0#</a></p>","","");
    $.SetFormat("zh","settypesmall","<div class='quo_type2'><a style='font-weight:bold;' href=\"zlpricelist.html?{'Sort':'#1#'}\">#0#</a></div><div id=\"quo_typep#2#\"><p></p></div>","","");
    $.SetFormat("zh","zxcpbj","<ul><li><a style='width:110px;height:20px;color:#666666;background:none;padding:0px 5px;font-weight:lighter;line-height:180%;' href=\"propricedetaile.html?{'id':#2#}\" target=\"_blank\">#0#</a>#1#</li></ul>","","");
    $.SetFormat("zh","zlxxnews","<li class='linkover'><a style='width:530px;' href=\"news.html?{'id':#0#}\" target=\"_blank\">#1#</a></li>","","");
    /*产品分类列表*/$.SendMessage({callback:setbigtype,bLoading:false,type:"DBSelect",id:"getproducttypebig",pm :"<@ehai_typetable%16Id%16eName,Class,Id%16%16%16Class asc%160%16Sort=2 and LENGTH(Class)=2%16@>"});
    /*产品报价--最新产品报价*/$("#zxcpbj").SendMessage({bLoading:false,type:"DBSelect",id:"zxcpbj",pm :"<@ehai_product%16Id%16ProductName,Price,Id%16%16%16PubTime desc%160%16IsCheck=1 and IsShow=1@>%16",format:"zxcpbj",start:0,total:6});
    /*产品报价--产品租赁价格列表*/$("#cpbjlist").SendMessage({callback:cpbjlist,bLoading:false,type:"DBSelect",id:"cpbjlist",pm :"<@ehai_product left join ehai_user on ehai_product.UserName=ehai_user.UserName%16ehai_product.Id%16ehai_product.Id,ehai_product.Pic,ehai_product.ProductName,ehai_user.Company,ehai_product.prozlprice,prozlunit%16%16%16ehai_product.PubTime desc%160%16ehai_product.IsShow=1 and ehai_product.IsCheck=1 and ispricheck=1@>%16"});
	/*租赁中心*/$("#zlxxnews").SendMessage({bLoading:false,type:"DBSelect",id:"zlxxnews",pm :"<@ehai_detail%16Id%16Id,Title%16%16%16Isup desc,CreateTime desc%160%16MenuId=25 and IsCheck=1 and IsShow=1@>%16",format:"zlxxnews",start:0,total:8});
	getAdsInfo(23);
	

}
function cpbjlist(re)
{
    var cpbj="";
    for(i=0;i<5;i++)
    {
        if(re[i][1]=="" || re[i][1]== "undefinedundefined" || re[i][1]=="ProductImg/")
            picimg="images/nophoto.gif";
        else
            picimg=re[i][1];    
        cpbj+="<div class=\"ckprice\"><span class=\"ckprice1\"><img style=\"width:48px;height:32px;display:block;border:1px solid #D9D9D9;\" src=\""+picimg+"\" alt=\"图片\" /></span><a href=\"propricedetaile.html?{'id':"+re[i][0]+"}\" style=\"font-weight:bold;\"><span class=\"ckprice1\" style=\"cursor:pointer;padding-left:10px;width:250px;color:#07556C;\">"+re[i][2]+"</span></a><span class=\"ckprice1\" style=\"width:130px;\">"+re[i][3]+"</span><span class=\"ckprice1\" style=\"width:100px;padding-left:20px;\">"+re[i][4]+re[i][5]+"</span></div>";
    }
     $("#cpbjlist").html(cpbj);
}
function setbigtype(re)
{
    if(re)
    {
        var h=""
        for(i=0;i<re.length;i++)
        {

            h+="<div><a style='color:#1A679D;font-weight:bold;clear:both;margin-left:5px;'  href=\"zlpricelist.html?{'Sort':'"+re[i][1]+"'}\">"+re[i][0]+"</a></div><div id=\"bigtypeli"+re[i][1]+"\" ></div>";
        }
         $("#quo_type").html(h);
        for(i=0;i<re.length;i++)
        {
            /*产品二级类*/$("#bigtypeli"+re[i][1]).SendMessage({bLoading:false,type:"DBSelect",pm :"<@ehai_typetable%16Id%16eName,Class,Id%16%16%16Class asc%160%16Sort=2 and LENGTH(Class)=4 and left(Class,2)='@>"+re[i][1]+"'%16",format:"settypesmall"});
        }
        /*产品分类列表*/$.SendMessage({callback:setsmalltype,bLoading:false,type:"DBSelect",id:"getproducttypesmall",pm :"<@ehai_typetable%16Id%16eName,Class,Id%16%16%16Class asc%160%16Sort=2 and LENGTH(Class)=4%16@>"});
    }
};
function setsmalltype(re)
{
    if(re)
    {
        for(i=0;i<re.length;i++)
        {
            /*产品三级类*/$("#quo_typep"+re[i][2]).SendMessage({bLoading:false,type:"DBSelect",pm :"<@ehai_typetable%16Id%16eName,Class,Id%16%16%16Class asc%160%16Sort=2 and LENGTH(Class)=6 and left(Class,4)='@>"+re[i][1]+"'%16",format:"settypesmal2"});
        }
    }
};
function getarea(area)
{
    window.location="zlpricelist.html?{'area':'"+area+"'}";
}
//页内搜索
window.tjtype=1;
function prosearch()
{
    var aimUrl;
    var pro_keys=$("#pro_keys").val();
    if(tjtype==1)
    {
        aimUrl="zlpricelist.html?{'keys1':'"+pro_keys+"'}";
    }else if(tjtype==2)
    {
        aimUrl="zlpricelist.html?{'keys2':'"+pro_keys+"'}";
    } 
    else if(tjtype==3)
    {
        aimUrl="zlpricelist.html?{'keys3':'"+pro_keys+"'}";
    }
    else if(tjtype==4)
    {
        aimUrl="zlpricelist.html?{'keys4':'"+pro_keys+"'}";
    }   
    window.location=aimUrl;
};
function settype(ra)
{
    tjtype=ra;
};
