
function trim(s){return  s.replace(/(^\s*)|(\s*$)/g,  "");} 

function get_tuangou(t1)
{
	$('#'+t1).html("信息装载中，请稍后...");
	$.ajax({
	type: "get",
	cache:false,
	url: "tuangou.asp",
	timeout: 200000,
	error: function(){$('#'+t1).html("信息装载失败")},
	success: function(t0){$('#'+t1).html(t0);}
	})
return false
}


function get_book(t1)
{
	$('#'+t1).html("信息装载中，请稍后...");
	$.ajax({
	type: "get",
	cache:false,
	url: "book.asp",
	timeout: 20000,
	error: function(){$('#'+t1).html("信息装载失败")},
	success: function(t0){$('#'+t1).html(t0);}
	})
}




function checktuangou(theform)
{
	if (trim(theform.C_Name.value)=='')
	{   
		alert('姓名不能为空');
		theform.C_Name.focus();
		theform.C_Name.value='';
		return false
	}
	if (trim(theform.C_Tel.value)=='')
	{
		alert('对不起，请填写联系电话!');
		theform.C_Tel.focus();
		theform.C_Tel.value='';
		return false
	}

var cellphone=/^([\d-+]*)$/;
if(!cellphone.test(theform.C_Tel.value))
{
alert('提示\n\n您输入的电话号码格式不正确！');
	theform.C_Tel.focus();
theform.C_Tel.value='';
return false;
}
	if (trim(theform.num.value)=='')
	{   
		alert('请填写参加人数!');
		theform.num.focus();
		theform.num.value='';
		return false
	}
	if (trim(theform.C_TxtContent.value)=='')
	{   
		alert('对不起，请选择关注楼盘!');
		return false
	}
	if (trim(theform.tujing.value)=='')
	{   
		alert('请填写了解途径!');
		theform.tujing.focus();
		theform.tujing.value='';
		return false
	}
	var param;
	param="/kanfangtuan/kanfang.asp?action=save";
	param+="&C_Name="+escape(trim(theform.C_Name.value));
	param+="&C_Tel="+escape(trim(theform.C_Tel.value));
	param+="&num="+escape(trim(theform.num.value));
	param+="&C_TxtContent="+escape(trim(theform.C_TxtContent.value));
	param+="&tujing="+escape(trim(theform.tujing.value));
	
	$('#showmsg').html("<img src=/images/loading.gif> 信息提交中...");
	$.ajax({
	type:"get",
	cache:false,
	url:param,
	timeout:20000,
	error:function(){alert("获取失败!") ;},
	success:function(t0)
	{
		alert(t0.substring(1));
		if(t0.substring(0,1)==0){theform.C_Name.value='';theform.C_Tel.value='';theform.C_Address.value='';theform.C_TxtContent.value='';theform.num.value='';theform.tujing.value='';window.location.href='/';}
		}
	});
	return false
}


function checkbook(theform)
{  
	if (trim(theform.username.value)=='')
	{   alert('姓名不能为空');
		theform.username.focus();
		theform.username.value='';
		return false
	}
	if (trim(theform.userTel.value)=='')
	{   alert('联系电话不能为空');
		theform.userTel.focus();
		theform.userTel.value='';
		return false
	}
	if (trim(theform.Title.value)=='')
	{   alert('标题不能为空');
		theform.Title.focus();
		theform.Title.value='';
		return false
	}
	if (trim(theform.content.value)=='')
	{   alert('内容不能为空');
		theform.content.focus();
		theform.content.value='';
		return false
	}
	var param;
	param="book.asp?action=save";
	param+="&username="+escape(trim(theform.username.value));
	param+="&userTel="+escape(trim(theform.userTel.value));
	param+="&Title="+escape(trim(theform.Title.value));
	param+="&content="+escape(trim(theform.content.value));
	$('#bookmsg').html("<img src=/images/loading.gif> 信息提交中...");
	$.ajax({
	type:"post",
	cache:false,
	url:param,
	timeout:20000,
	error:function(){alert("发布失败!") ;},
	success:function(t0)
	{
        alert(t0.substring(1));
	if(t0.substring(0,1)==0){theform.username.value='';theform.userTel.value='';theform.Title.value='';theform.content.value='';$('#bookmsg').html("留言发布成功");setTimeout("window.location.href='/';","3000");}
		}
	});
	return false
}

//快速发布
        $(function() {
            $("#mini_fabu div:first").toggle(function() {
				$("#mini_fabu").stop().animate({ width: "26px" }, { queue: false, duration: 100 });
                $(this).removeClass("fabu_no").addClass("fabu_hover");
            },function() {
				$("#mini_fabu").stop().animate({ width: "270px" }, { queue: false, duration: 100 });
                $(this).removeClass("fabu_hover").addClass("fabu_no");
            });
        });
        //快速发布招标随屏滚动
        $(function() {
        var menuYloc = $("#mini_fabu").offset().top;
        $(window).scroll(function() {
            var offsetTop = menuYloc + $(window).scrollTop() + "px";
            $("#mini_fabu").animate({ top: offsetTop }, { duration: 400, queue: false });
        });
       });
	  
//快速发布招标
