﻿    var _t; 
    var _h = 0; 
    var _m = 0; 
    var _s = 10; 
    var _v = formatTime('正在为您登陆...请稍后...!'); 
    var istimeout = true;
    function doTime() {
        _s --; 
        if (_s == -1) { 
             _m --; 
             _s = 59; 
        } 
        if (_m == -1) { 
             _h --; 
             _m = 59; 
        } 
        var _b = ((_h == 0) && (_m == 0) && (_s == 0)); 
        if (_b && istimeout) { 
            _v = userLogOutStr; 
            clearTimeout(_t); 
        } else { 
            _v = formatTime("正在为您登陆...请稍后...!"); 
            _t = setTimeout('doTime()', 1000); 
        }  
        document.getElementById("td_UserLog").innerHTML=_v;
    } 
   
    function formatTime(_time) { 
        return _time;
    }
var divwait;
var divwait2;
function DoSearch()
{
	if(document.getElementById("input_search_text"))
    var search_text = document.getElementById("input_search_text").value;
    
    if(search_text == "" || search_text == "请输入关键字")
    {
        alert('请输入关键字');
        return false;
    }
    else
    {
       
       var search_type = document.getElementById("select_type1");
       UShow_MsgShow('正在为您搜索相关数据,请您稍后...!',0);
       if(search_type.checked)
       {
            location.href = "/sell/SellRecordList.aspx?By=KeyWord&key="+escape(search_text)+"&page=1";
       }
       else
       {
            location.href = "/buy/BuyRecordList.aspx?By=KeyWord&key="+escape(search_text)+"&page=1";
       }
	}
	
}

function openchat(u)	{
		window.open("../Go2Aspx.aspx?m=/Chat/&tourl=WebChatCust.aspx?OwnerId=" + u,"WebChatCust","width=650,height=470,fullscreen=0,toolbar=0,scrollbars=0,"+
			"location=0,directories=0,titlebar=0,status=0,menubar=0,resizable=1");
	}

function OpenSetupWindow(url, winName, w, h)
{		    
    window.open(url, winName, 'width='+w+',height='+h+',resizable=0,scrollbars=no,menubar=no,status=yes');
}

function HotKey_click(key)
{
    document.getElementById("input_search_text").value=key;
    DoSearch();
}

 //广告词显示
    document.write('<style type="text/css"><!--#div_AdMsg {width: 339px;margin: 0 auto;text-align: left;}');
    document.write('#adb1 {width: 339px;height: 43px;background-image: url(/img/guanggao_001.gif);background-repeat: no-repeat;}');
    document.write('.adb2 {background-image: url(/img//guanggao_002.gif);background-repeat: repeat-y;font-size: 12px;line-height: 19px;color: #000000;padding: 11px 22px 0 27px;}');
    document.write('#adb3 {width: 339px;height: 28px;background-image: url(/img/guanggao_003.gif);background-repeat: no-repeat;}--></style>');
        document.write("<div id='div_AdMsg' style='position: absolute;  display: none;'><div id='adb1'></div><div class='adb2' id='admsgInfo' >neirong</div><div id='adb3'></div></div>");


  //设置广告显示DIV
    function ShowMsg(msgStr)
    {   
        if(msgStr!=null && msgStr!="")
        {
            var dv=document.getElementById("div_AdMsg");
         
            if(dv.style.display=="none")
            {               
                document.getElementById("admsgInfo").innerHTML=msgStr;
                dv.style.left=window.screen.width/2-170;
                        
                dv.style.top=180;
                dv.style.display="";
            }
        }
    }
    
    //隐藏广告内容显示
    function hidAdMsg()
    {
        //Hid AdMsg
        document.getElementById("div_AdMsg").style.display="none";
    }

function UShow_DivHid()
{
    document.getElementById("UShow_div_Msg").style.display="none";
    document.getElementById("UShow_msg_Page").style.display="none";
}
	
    
function UShow_MsgShow(msgString,sTime)
{
    document.getElementById("UShow_msg_Page").style.width=document.body.clientWidth;
    document.getElementById("UShow_msg_Page").style.height=document.body.clientHeight;        
    document.getElementById("UShow_msg_Page").style.display="block";
                    
    document.getElementById("UShow_div_Msg").style.display="block";		        
    document.getElementById("UShow_div_Msg").innerHTML='<img src="/images/indicator.gif" />'+msgString;
    if(sTime!=0)
    {
        window.setTimeout("UShow_DivHid();",sTime);
    }
}

document.write('<div id="UShow_msg_Page" style="display: none; position: absolute; height: 100%;width: 100%; left: 0px; top: 0px; background-color: #6B6B6B; filter: alpha(Opacity=50);"></div>');
document.write('<div id="UShow_div_Msg" style="position: absolute; padding: 12px; width: 400px; height: 40px;border: #000000 1px solid; background-color: White; text-align: justify; display: none; left: 279px; top: 183px;"><div align="center">操作中请稍后!</div></div>');

function CleanText()
{
    if(document.getElementById("input_search_text").value=='请输入关键字')
    {
        document.getElementById("input_search_text").value = "";
    }
}

function txtkey_out()
{
	if(document.getElementById("input_search_text").value == "")
	{
		document.getElementById("input_search_text").value="请输入关键字";
	}
}

/*Index UserLogin Ver 0.1 By JT*/
var userLogOutStr= "<table width='100%' border='0' align='right' cellpadding='0' cellspacing='0'>";
    userLogOutStr+="<tr align='left'>";
    userLogOutStr+="<td width='98' align='right' class='black_12_19'>";
    userLogOutStr+="用户ID：</td>";
    userLogOutStr+="<td width='72' align='left'>";
    userLogOutStr+="<input id='txt_UserId' type='text' size='11' /></td>";
    userLogOutStr+="<td width='45' align='right' class='black_12_19'>";
    userLogOutStr+="密码：</td>";
    userLogOutStr+="<td width='97' align='left'>";
    userLogOutStr+="<input id='txt_UserPass' type='password' onkeydown='JavaScript:index_UserLog_Enter(event);' size='11' /></td>";
    userLogOutStr+="<td width='60' align='left'>";
    userLogOutStr+="<a href='#'>";
    userLogOutStr+="<img src='img/1_022.gif' width='48' height='20' border='0' onclick='JavaScript:index_UserLog();' /></a></td>";
    userLogOutStr+="<td width='81' align='left'>";
    userLogOutStr+="<a href='MemberCenter/UserReg.aspx' target='_blank'>";
    userLogOutStr+="<img src='img/1_023.gif' width='71' height='20' border='0' /></a></td>";
    userLogOutStr+="<td width='82' align='left'><a href='#'><img src='img/1_024.gif' width='82' height='20' border='0' /></a></td>";
    userLogOutStr+="<td width='35' align='left'><img src='img/free.gif' width='23' height='12' /></td></tr></table>";
                
function openlogin()
{
    var userminilog=window.open('JudiciaryLogin.aspx', 'openScript', 'width=300px,height=200px;resizable=1,scrollbars=yes,menubar=no,status=yes');
}

function showUserInfo()
{
    index.userIsLogin(UserIsLog_callback);
}

function UserIsLog_callback(res)
{
    if(res)
    {
        document.getElementById("td_UserLog").innerHTML=res.value;
    }
}
showUserInfo();

function index_UserLog()
{
    var userId=document.getElementById("txt_UserId").value;
    
    var UserPass = document.getElementById("txt_UserPass").value;
    
    if(userId=="")
        alert("用户ID 不能为空！");
    else if(UserPass=="")
        alert("密码不能为空！");
    else
    {
        index.UserLogin(userId,UserPass,UserLogin_callback);
        document.getElementById("td_UserLog").innerHTML=_v;
        _t = setTimeout('doTime()', 1000);
    }
}

function UserLogin_callback(res)
{
    var tr=document.getElementById("td_UserLog");
    if(res)
    {
        if(res.value=="logErro")
        {
            tr.innerHTML="登陆失败！请<a href='JavaScript:showUserInfo();' color='red'>重新登陆</a>";
            clearTimeout(_t);   
        }
        else
        {
            tr.innerHTML=res.value;
            clearTimeout(_t);   
            IsLogin=true;
        }            
    }
}   

function LogOut()
{
    index.UserLogout(UserLogout_callback);
}

function UserLogout_callback(res)
{
    var tr=document.getElementById("td_UserLog");
    if(res && res.value=="ok")
    {
        tr.innerHTML=userLogOutStr;
        IsLogin=false;
    }

}

function index_UserLog_Enter(evt)
{
    if(evt.keyCode==13)index_UserLog();        
}
function addHome()
{
    document.body.style.behavior='url(#default#homepage)';
    document.body.setHomePage('http://www.u1d1.com');
}


document.onkeydown=function() {
    var e = event.srcElement;
    var k = event.keyCode;
    if (k == 13 && e.type != "textarea") 
    {
        document.all.img_searchBtn.click(); 
        event.cancelBubble = true; 
        event.returnValue = false; 
    }
}
  function showi_lt(id)
        {        
            
            for(var i=1;i<=4;i++)
            {                            
                document.getElementById("dv_i_"+i).style.display="none";
                if(i==1)document.getElementById("dv_i_l_"+i).style.backgroundImage="url(/img/index_Right-11.gif)";
                else document.getElementById("dv_i_l_"+i).style.backgroundImage="url(/img/index_Right-22.gif)";
            }
            var bt=document.getElementById("dv_i_l_"+id);
            var msg=document.getElementById("dv_i_"+id);
            msg.style.display="block";
            if(id==1)
            {bt.style.backgroundImage="url(/img/index_Right-1.gif)";}
            else
            {bt.style.backgroundImage="url(/img/index_Right-2.gif)";}
            
        }
        
         function setImgSerchType(tp)
        {
            if(tp==1)
            {
                document.getElementById("Index_Control_jobSearchBar1_hid_serachType").value="job";
                document.getElementById("img_search_res").src="img/index/dt_006.gif ";
                document.getElementById("img_search_job").src="img/index/dt_0077.gif ";
            }
            else
            {
                document.getElementById("Index_Control_jobSearchBar1_hid_serachType").value="res";       
                 document.getElementById("img_search_res").src="img/index/dt_0066.gif ";
                document.getElementById("img_search_job").src="img/index/dt_007.gif "
            }
        }
       
       
        
      var hot_key=new Array()
      hot_key[0]="服装";
      hot_key[1]="皮具";
      hot_key[2]="食品";      
      hot_key[3]="家具";
      hot_key[4]="厨卫";
      hot_key[5]="家电";
      hot_key[6]="礼品";
      hot_key[7]="家居";
      hot_key[8]="数码";
      hot_key[9]="办公";
      hot_key[10]="保健";
      hot_key[11]="设备";
      hot_key[12]="五金";
      hot_key[13]="建材";
      hot_key[14]="电子";
      hot_key[15]="鞋帽";
      
      
      var hot_key_more=new Array()
      hot_key_more[0]="女装 时装 内衣 内裤 衬衣 T恤 睡衣 服饰 孕妇装 牛仔裤  男装 童装 制服 西服 袜子 领带 夹克";
      hot_key_more[1]="商务包 旅行包 皮包 手提包 男包 女包 手包 背包 挎包 腰包 钱包 运动包 箱包 要带 书包 电脑包";      
      hot_key_more[2]="美食 快餐 奶茶 饮料 冰淇淋 酒 咖啡 蔬菜 果汁 牛奶 花生油 火腿 调味 纯净水 矿泉水 牛羊";
      hot_key_more[3]="沙发 双人床 餐桌 书桌 衣柜 梳妆台 写字台 吧台 茶几 橱柜 衣柜 红木 椅子 书柜 展示柜 户外";
      hot_key_more[4]="油烟机 灶具 厨具 洁具 水龙 马桶 浴缸 浴盆 电饭煲 电磁炉 换气扇 消毒柜 豆浆机 榨汁机";
      hot_key_more[5]="热水器 洗衣机 冰箱 风扇 空调 电视 音箱 饮水机 太阳能 熨斗 按摩器 干手器 净水器 吸尘器";
      hot_key_more[6]="工艺品 景泰蓝 瓷器 陶瓷 杯 饰品 画 相册 水晶 首饰 项链 手表 钻戒 酒具 摆件 鲜花 手表";
  hot_key_more[7]="窗帘 床盖 毛巾 护肤 护发 假发 洗涤 饰品 沐浴 香水 玩具 灯具 餐具 茶具 搬家 快递 维修";
      hot_key_more[8]="相机 显示器 电脑 mp3 上网本 笔记本 硬盘 U盘 鼠标 键盘 手机 麦克 对讲机 功放 摄像 投影";
      hot_key_more[9]="传真机 打印机 复印机 碎纸机 文具 隔断 耗材 墨盒 硒鼓 文件柜 电脑桌 签字笔 文件夹 咖啡机";
      hot_key_more[10]="医疗 按摩 减肥 健身器 美容 护理 整容 纹身 不孕 磁疗 颈椎 中成药 视力 眼镜 增高 活络 蒸熏";
      hot_key_more[11]="仪器 仪表 机械 电动 铲车 叉车 吊车 升降机 机床 车床 刨床 发动机 发电机 制冷 冲压 平衡";
      hot_key_more[12]="阀门 泵 轴承 工具 扳手 钳子 射钉枪 锤子 螺丝刀 丝网 护栏 铁艺  车棚 配件 管件 磨具 电焊";
      hot_key_more[13]="钢材 不锈钢 铝合金 涂料 漆 门窗 瓷砖 地板 木材 装修 装饰 黏合剂 施工 吊顶 石材 防水";
      hot_key_more[14]="语音 报警 录音 门铃 门禁 开关 遥控 安防 监控 解码 贴片 温控 稳压 感应 光电 激光 电磁";
      hot_key_more[15]="皮鞋 女鞋 男鞋 高跟鞋 运动鞋 旅游鞋 休闲鞋 拖鞋 布鞋 棒球帽 帽子 太阳帽 高尔夫帽";
      hot_key_more[16]="求购 设备 塑料 纸 水 钢 胶 服装 配件 棉 电子 MP3 背包 首饰 饰品 灯具 美容 休闲鞋";
      
      function showHotkey()
      {
        var tmp="";
        var i=0;
        for(i=0;i<hot_key.length;i++)
        {
            tmp+="<span style='margin-left:5px;'><a href='JavaScript:showMoreHotKey("+i+");'>"+hot_key[i]+"</a><span>";
        }
        //alert(tmp);
        tmp="<div style='margin:5px 5px 0px 5px;high:80px;'>"+tmp+"</div><div style='margin:5px 0px 0px 90px;'><a href='JavaScript:showMoreHotKey(16);' style='color:red;'>热门关键词</a><div>";
        showMsgTip ("a_index_hot_key",tmp,250,95,-3,20)
      }
      
      function showMoreHotKey(i)
      {
        var tmp="";
        isShowTip=false;
        HidMsgTip();
        if(hot_key[i]!=null)
        {
        tmp="<a style='color: White;' href='/sell/search-list.html?By=KeyWord&key="+hot_key[i]+"'>"+hot_key[i]+"</a> ";
        }
        
        
        var k=hot_key_more[i].split(" ");
        var i=0;
        for(i=0;i<k.length;i++)
        {
        /*if(tmp!="")
        {tmp+=" | ";}*/
            if(k[i]!="")
            {
            tmp+=" <a style='color: White;' href='/sell/search-list.html?By=KeyWord&key="+k[i]+"'>"+k[i]+"</a>"
            }
        }
        
        document.getElementById("dv_hotkey").innerHTML=tmp;
      }
         
      function ShowIndexInfoCheng(si,count,cssName,obj_name)
      {
            var i=1;
            for(i=1;i<=count;i++)
            {
                document.getElementById("td_"+obj_name+"_"+i).className=cssName+i;
                document.getElementById("dv_"+obj_name+"_"+i).style.display="none";
            }
            
            if(si==3)
            {
               document.getElementById("td_"+obj_name+"_2").className="index_Levon0222";
            }
            document.getElementById("td_"+obj_name+"_"+si).className=cssName+si+""+si;
            document.getElementById("dv_"+obj_name+"_"+si).style.display="block";
            
      }
        function setSerachType_Res()
        {
            setImgSerchType(2);
            document.getElementById("select_type1").checked="checked";
        }
        function setSerachType_Job()
        {
            setImgSerchType(1);
            document.getElementById("select_type").checked="checked";
        }        
        function opnedg(url,w,h)
        {
            window.showModalDialog(url, "desc", "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; directories:yes;scrollbars:no;Resizable=no;");
        }
        function toKey(key)
	        {
	            window.open("sell/SellRecordList.aspx?By=KeyWord&key="+escape(key));	            
	        }
	        
	        function go2(toUrl,toPage)
            {        
    	        location.href="/Go2Aspx.aspx?m="+toUrl+"&tourl="+toPage;

            }
            function opnedg(url,w,h)
            {
                window.showModalDialog(url, "desc", "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; directories:yes;scrollbars:no;Resizable=no;");
            }       
    function GetCenterXY_ForLayer(objdiv){
     objdiv.style.display='block';
     var styleWidth=objdiv.clientWidth;
     var clientHeight=objdiv.clientHeight;
     
     var objLeft = parseInt(document.documentElement.scrollLeft+(document.documentElement.clientWidth - styleWidth)/2)+'px';
     var relTop=(document.documentElement.clientHeight-clientHeight)/2 > 0 ? (document.documentElement.clientHeight-clientHeight)/2:0;
     //var objTop = parseInt(document.documentElement.scrollTop+relTop)-100+'px';
     var objTop =240; 
     objdiv.style.top = objTop+"px";
     objdiv.style.left = objLeft;
     checkAndResetStyleTop(objdiv);
}   