﻿function ongetfocus(id,t){

if($("#"+id).val()=="" || $("#"+id).val()==t)
{
$("#"+id).val("");
$("#"+id).css("color","#000");
}


}

function onlosefocus(id,t){

if($("#"+id).val()=="" || $("#"+id).val()==t)
	{
	$("#"+id).css("color","#999");
	$("#"+id).val(t);
	}
}



function topsearch(){
showdoing();
var zwtype=$("#Hidden1_zwtype").val();
var key=$("#Text1_tediankey").val();
var zwnum=$("#Text1_num").val();
var zwhao=$("#Text_zwhao").val();
var infotype=1;
var addtime=$("#ctl00_top11_DropDownList1_addtime").val();
if($("#top1Radio2").attr("checked"))
{
infotype=2;
}
if(zwnum!="展位数量")
{
zwnum="&zwnum="+zwnum;
}
else{
zwnum="";
}

if(zwhao!="展位号码")
{
	zwhao="&zwhao="+zwhao;
}
else 
{
	zwhao="";
}
//var zwaddtime=$("#Select1_addtime").val();
var zwprice=$("#Select2_zwprice").val();
if(key=="请选择或输入展位关键字"){key="";}else{key="&key="+key;}
window.location.href="/infoList.aspx?infotype="+infotype+"&days="+addtime+"&zwtype="+zwtype+zwprice+key+zwnum+zwhao;
}

function gettypeinfo(textid,spanid)
{
var r = window.showModalDialog('/doaspx/getTypeInfo.aspx',window,"dialogWidth:610px;dialogHeight:550px;scroll:no");
if(r==null || r==""){
//document.getElementById("ctl00_ContentPlaceHolder1_TextBox4_pic").value="";
}else{
var arr=r.split("|");
var infotype=1;
if($("#top1Radio2").attr("checked"))
{
infotype=2;
}
document.getElementById(textid).value=arr[0];
document.getElementById(spanid).value=arr[1];
topsearch();
//window.location.href="/infolist.aspx?infotype="+infotype+"&zwtype="+arr[0];
}
}


function settegiantig(){
//tediandiv



 var objtd= $("#Button1_tedian").offset();
   $("#hotkeytig").css("top",objtd.top+21);
   $("#hotkeytig").css("left",objtd.left-200);
    
 // $("#hotkeytig").jqDrag();
   $("#hotkeytig").show();
}

function setzwhaotig()
{
 var objtd= $("#Text_zwhao").offset();
   $("#zwhaotig").css("top",objtd.top+21);
   $("#zwhaotig").css("left",objtd.left);
    
 // $("#hotkeytig").jqDrag();
   $("#zwhaotig").show();
}
function showzwtypetig()
{
 var objtd= $("#Text3_zwtypename").offset();
   $("#jiantou").css("top",objtd.top+21);
   $("#jiantou").css("left",objtd.left);
    
 // $("#hotkeytig").jqDrag();
   $("#jiantou").show();
   $("#zwtypedivlist").css("background","#EAD7B0");
}
function hidezwhaotig()
{
$("#zwhaotig").hide("fast");
}
function hidezwtypetig()
{
 $("#jiantou").hide("fast");
   $("#zwtypedivlist").css("background","#ffffff");

}

function showdivabs(id,objid,top,left)
{
 var objtd= $("#"+objid).offset();
   $("#"+id).css("top",objtd.top+top);
   $("#"+id).css("left",objtd.left+left);
    
 // $("#hotkeytig").jqDrag();
   $("#"+id).show();
}
function hidedivabs(id)
{
$("#"+id).hide("fast");
}


function hidetediantig(evt){

var ev = evt || window.event;


$("#hotkeytig").hide("fast");


}

function settedian(id,v){



if(v==""){
document.getElementById(id).value=v;


return;
}

var isin=false;
if(document.getElementById(id).value=="" || document.getElementById(id).value=="请选择或输入展位关键字"){
	document.getElementById(id).value=v;
}else{

	var s=document.getElementById(id).value;
	var arr=s.split(" ");
	document.getElementById(id).value=v;
	for(var i=0;i<arr.length;i++)
	{

		if(arr[i]==v)
		{
			isin=true;
		}
		else

		{
			document.getElementById(id).value+=" "+arr[i];
		}
	}
	if(isin)
	{ 
	hidetediantig();
		return;
	}
	//document.getElementById("Text5_tedian").value+=","+v;
}

document.getElementById(id).focus();
hidetediantig();



}
function chkentersearch(e) {
    var ev = e || window.event;
    var c = ev.keyCode || ev.which;
    if (c == 13) {
        topsearch();
        return false;
    }

}