/*大有*/
var map_maker = Array();
$(document).ready(function(){
	Initialize();
	//物品兑换
	$(".quantity").change(function(){
		var quantity=$(this).val();
		var id=$(this).parent().parent().attr('name');
		 var data= {quantity:quantity,id:id,cmd:'quantity_change'};
		$.ajax({
			type:'POST',
			url:'ajax.php',
			data:data,
			dataType:'text',
			success:function(msg){
				if(msg == 0){
					//成功。
				}
			}
		});
	})
	
	//会员登录
	$("#login").click(function(){
		var offset = $(this).offset();
		var data = getFormData("#header");
		data['cmd'] = 'login';
		$.ajax({
			type:'POST',
			url:'ajax.php',
			data:data,
			dataType:'text',
			success:function(msg){
				//保存成功
				if(msg == 0){
					document.location.reload();
				}
				else
					document.location.href='login.html';
					//$("#walt").html("登录失败,稍后再试！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
			}
		});
	})
	
	//经销商门户
	$("#dealer").click(function(){
		var offset = $(this).offset();
		var data = getFormData("#header");
		data['cmd'] = 'islogin';
		$.ajax({
			type:'POST',
			url:'ajax.php',
			data:data,
			dataType:'text',
			success:function(msg){
				//保存成功
				if(msg == 0){
					alert("还未登录，请先注册！");
					document.location.href='login.html';
				}
				else
					document.location.href='integral.php';
					//$("#walt").html("").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
					//$("#walt").html("登录失败,稍后再试！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
				}
		});
	})
	//确认兑换
	$(".ckeckend img").bind("click",ckeckend);
	$("#btnreg").bind("click",memberreg);
	//新产品
	if($(".product_list01").length == 1){
		newproduct_click($(".product_list01 a").eq(0));
		//事件绑定
		$(".product_list01 a").click(function(){
			newproduct_click($(this));
		})
	}
	$(".join_table02 tr").css("cursor","pointer").click(function(){
		window.open($(this).attr("href"),'_self');
	});
	//合作加盟
	$("#expert_btn").attr("href","javascript:;;").find("img").bind("click",join_union);
	//加载地图
	if($("#map").length == 1){
		//事件绑定
		$("#map_search").click(function(){
			var typeid = $(this).attr("typeid");
			var pidx = $("select[name=province]").attr("selectedIndex");
			var cidx = $("select[name=city]").attr("selectedIndex");
			var aidx = $("select[name=area]").attr("selectedIndex");
			var data = {province:$("select[name=province] option").eq(pidx).val(),
						city:$("select[name=city] option").eq(cidx).val(),
						area:$("select[name=area] option").eq(aidx).val(),
						cmd:'map',typeid:typeid};
			$.ajax({
				type:'POST',
				dataType:'json',
				data:data,
				url:'ajax.php',
				success:function(msg){
					while(map_maker.length >0){
						var m = map_maker.shift();
						map.removeOverlay(m);//删除标点
					}
					var xl = xr = yt = yb = 0;
					for(i=0;i<msg.length;i++){
						var m = msg[i].map.split("/");
						var point = new GLatLng(m[0],m[1]);
						if(i==0){
							xl = m[0];
							xr = m[0];
							yt = m[1];
							yb = m[1];
						}
						else{
							if(xl>m[0]) xl = m[0];
							if(xr<m[0]) xr = m[0];
							if(yt>m[1]) yt = m[1];
							if(yb<m[1]) yb = m[1];
						}
			         	map.addOverlay(createMarker(point, i+1,msg[i].title+"<br>地址："+msg[i].address+"<br>电话："+msg[i].phone));
					}
					//设置聚焦
					xl = parseFloat(xl);
					xr = parseFloat(xr);
					yt = parseFloat(yt);
					yb = parseFloat(yb);
					x = (xl+xr)/2;
					y = (yt+yb)/2;
					var str = "";
					z = 6;
					if(pidx){
						z = 8;
						str = $("select[name=province] option").eq(pidx).text()
					}
					if(cidx != 0){
						z = 10;
						str += $("select[name=city] option").eq(cidx).text();
					}
					if(aidx != 0){
						z =12;
						str += $("select[name=area] option").eq(aidx).text();
					}
					if(str == '') str = "全国一共";
					if(typeid == 17)
						$("#map_result").html(str+"有 <span class='red'>"+msg.length+"</span> 处维修点");
					else
						$("#map_result").html(str+"有 <span class='red'>"+msg.length+"</span> 经销商");
					if(msg.length >0)
					map.setCenter(new GLatLng(x, y), z);
				}
			})
		})
		if(GBrowserIsCompatible())
		{
			var mapElem = document.getElementById("map");
			window.map     = new GMap2(mapElem);
			window.latlng  = new GLatLng(32.04184006520709, 118.7841796875);
			window.baseIcon = new GIcon();
			baseIcon.shadow = "http://www.google.cn/mapfiles/shadow50.png";
	        baseIcon.iconSize = new GSize(20, 34);
	        baseIcon.shadowSize = new GSize(37, 34);
	        baseIcon.iconAnchor = new GPoint(9, 34);
	        baseIcon.infoWindowAnchor = new GPoint(9, 2);
	        baseIcon.infoShadowAnchor = new GPoint(18, 25);
			var zoom    = 12;
			map.addControl(new GSmallMapControl());
			map.setCenter(latlng, zoom);
		}

	}
	//大有足迹
	if($(".about03_kuang #left").length == 1) {
		$(".about03_kuang #left").click(function(){
			step = -1;
			if(parseInt($("#projectsShow_list_div").css("left")) == 0)
			{
				var width = $("#projectsShow_list_div li:last").outerWidth(true) * -1;
				//for(var i=0;i<4;i++)
				$("#projectsShow_list_div").prepend($("#projectsShow_list_div li:last"));
				$("#projectsShow_list_div").css("left",width);
			}
			moves(-1);
		})
		$(".about03_kuang #right").click(function(){
			var width = $("#projectsShow_list_div li:first").outerWidth(true) * -1;
			if(parseInt($("#projectsShow_list_div").css("left")) == width)
			{
				//for(var i=0;i<4;i++)
				$("#projectsShow_list_div").append($("#projectsShow_list_div li:first"));
				$("#projectsShow_list_div").css("left",0);
			}
			step = 1;
			moves(1);
			//moveInt = window.setInterval(scroll,10);
		})
	}
	
	
	
	$("#btn_msg").click(function(){
		var title = $.trim($("#title").val());
		var name = $.trim($("#name").val());
		var phone = $.trim($("#phone").val());
		var email = $.trim($("#email").val());
		var content = $.trim($("#content").val());
			var res=new RegExp("([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+","g");
		if(title==''){
			alert("标题不能为空！");
			$("#title").focus();
			return false;
		}
		if(name==''){
			alert("姓名不能为空！");
			$("#name").focus();
			return false;
		}
		if(phone==''){
			alert("联系电话不能为空！");
			$("#phone").focus();
			return false;
		}
		if(email==''){
			alert("电子邮箱不能为空！");
			$("#email").focus();
			return false;
		}
		if(!res.test(email)){
			alert("电子邮箱格式错误！");
			$("#email").focus();
			return false;
		}
		if(content==''){
			alert("详细内容不能为空！");
			$("#content").focus();
			return false;
		}
		var data = {title:title,name:name,phone:phone,email:email,content:content,cmd:'liuyan'};
		$("#load").fadeTo(200,0.7,function(){
			$.ajax({
				type:'POST',
				url:'/ajax.php',
				dataType:'text',
				data:data,
				complete:function(){
					$("#load").hide();
				},
				success:function(msg){
						alert("留言成功！");
						document.frm.reset();
						document.location.href = "expert.php?about=4";
				}
			});
		});
	})
	
	$("#btn_submit").click(function(){
		var offset = $(this).offset();
		var data = getFormData("#r_frm");
		data['cmd'] = 'r_frm';
		
		$.ajax({
			type:'POST',
			url:'ajax.php',
			data:data,
			dataType:'text',
			success:function(msg){
				//保存成功
				if(msg == 0){
					document.r_frm.reset();
					$(".res_div").css("display","none");
					$("#wmast").remove();
				}
				else
					//document.location.href='integral.php';
					$("#walt").html(msg).css({left:offset.left+90,top:offset.top}).fadeTo(200,0.8,walt_fadeOut);
					//$("#walt").html("登录失败,稍后再试！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
				}
		});
		return false;
	});
	$("#btn_reset").click(function(){
		document.r_frm.reset();
		return false;
	});
})
function moves(direction){
	var width = $("#projectsShow_list_div li:first").outerWidth(true) * -1;
	if(direction == 1){
		$("#projectsShow_list_div").animate({left:width},500,function(){
			//for(var i=0;i<7;i++)
				$("#projectsShow_list_div").append($("#projectsShow_list_div li:first"));
			$("#projectsShow_list_div").css("left","0px");
		});
	}
	else{
		$("#projectsShow_list_div").animate({left:0},500,function(){
			//for(var i=0;i<7;i++)
				$("#projectsShow_list_div").prepend($("#projectsShow_list_div li:last"));
			$("#projectsShow_list_div").css("left",width);
		});
	}
}
function memberreg(){
	var offset = $(this).offset();
	var data = getFormData(".login_right");
	data['cmd'] = 'reg';//d(data);return;
	$.ajax({
		type:'POST',
		url:'ajax.php',
		data:data,
		dataType:'text',
		success:function(msg){
			//保存成功
			if(msg == "0"){
				document.location.href='index.php';
			}
			else
				$("#walt").html(msg+ "<br>稍后再试！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
		}
	});
}
/**
* PAP介绍及使用预约
*/
function checkpap(){
	if($("#username").val() ==''){
		$("#username").focus();
		alert("用户姓名不能为空！");
		return;
	}else if($("#units_name").val() ==''){
		$("#units_name").focus();
		alert("单位名称不能为空！");
		return;
	}else if($("#address").val() ==''){
		$("#address").focus();
		alert("联系地址不能为空！");
		return;
	}else if($("#zip").val() ==''){
		$("#zip").focus();
		alert("邮编不能为空！");
		return;
	}else if($("#mobilephone").val() ==''){
		$("#mobilephone").focus();
		alert("移动电话不能为空！");
		return;
	}else if($("#telephone ").val() ==''){
		$("#telephone ").focus();
		alert("固定电话不能为空！");
		return;
	}else{
		$("#frm").submit();
	}
}
/*
*百科知识
*//*
$(document).ready(function(){
	$("#knowledge").change(function(){
	
	})
})*/
function checkguest(){
			document.frm.submit();	
}
function newproduct_click(obj){
	setTimeout(function(){
		var str = $(obj).attr("swf");
		var flv = $(obj).attr("flv");
		thisMovie("newproduct").loadSWF(str);
		//加载数据
		var id = $(obj).attr("id");
		var data = {cmd:'newproduct',id:id};
		$.ajax({
			type:'POST',
			data:data,
			url:'/ajax.php',
			dataType:'text',
			success:function(msg){
				$("#product_right01").html(msg);
			}
		});
		//播放新的flv
		if(flv.substr(0,1) == "/"){
			thisMovie("flv").playnew(flv);	
		}
		else{
			thisMovie("flv").playnew("/images/empty.flv");	
		}
	},1000);
	
}
function thisMovie(movieName) {
     if (navigator.appName.indexOf("Microsoft") != -1) {
         return window[movieName];
     } else {
         return document[movieName];
     }
 }
function createMarker(latlng, number,content) 
{
		var marker = new GMarker(latlng);
		marker.value = number;
		GEvent.addListener(marker,"click", function() 
		{
			map.openInfoWindowHtml(latlng, content);
		});
		map_maker.push(marker);
		return marker;
}
function join_union(){
	var offset = $(this).offset();
	var data = getFormData(".product_right04");
	if(JSON.stringify(data)=="{}") 
		return;
	data['cmd'] = 'join_union';
	$.ajax({
		type:'POST',
		url:'ajax.php',
		data:data,
		dataType:'text',
		beforeSend:function(){
			//提交前，屏蔽按钮，删除按钮事件绑定
			$("#expert_btn img").unbind('click',join_union).attr("src","/images/loading.gif");
		},
		complete:function(){
			//重新换回图片
			//重新绑定事件
			$("#expert_btn img").attr("src","/images/submit.gif").bind("click",join_union);
		}, 
		success:function(msg){
			//保存成功
			if(msg == 1){
				$("#walt").html("保存资料失败,稍后再试！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
			}
			else if(msg == 0){
				//保存成功，进入第三步
				$("#walt").html("保存资料成功！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
				document.frm.reset();
			}
			else
				alert(msg);
		}
	});
}
function Initialize(){
	//初始化加载信息
	init_loading();
	//初始化提示框
	init_walt();
	//单行文本或密码框，删除空格，如果必填则显示提示信息
	init_text_bind();
	//
}
//单行文本或密码框，删除空格，如果必填则显示提示信息
function init_text_bind(){
	$("input[Optional=0]").each(function(i,n){
		var name = $(this).attr("id");
		$("#"+name+"_tip").hide();
	});
	$("input[type=text]").blur(function(){
		$(this).val(KillSpace($(this).val()));
		if($(this).attr("Optional") == 0){
			//如果内容必填
			var name = $(this).attr("id");
			if($(this).val() == "")
				$("#"+name+"_tip").show();
			else
				$("#"+name+"_tip").hide();
		}
	});
	$("input[type=password]").blur(function(){
		$(this).val(KillSpace($(this).val()));
		if($(this).attr("Optional") == 0){
			//如果内容必填
			var name = $(this).attr("id");
			if($(this).val() == "")
				$("#"+name+"_tip").show();
			else
				$("#"+name+"_tip").hide();
		}
	});
}
//初始化加载信息
function init_loading(){
	if($("#load").length == 0)
	{
		var w = $(document).width();
		var h = $(document).height()- ($.browser.msie?4:0);
		var load = $('<div id="load" style="position:absolute;left:0px;top:0px;width:100%;height:100px;text-align:center;background:#fff;z-index:999;"></div>').appendTo("body");
		$("#load").html("<img src='/images/loading.gif'>").css({height:h});	
		$("#load img").css({marginTop:h/2});
		$("#load").hide();
	}
}
function init_walt(){
	if($("#walt").length == 0){
		var load = $('<div id="walt" style="position:absolute;left:0px;top:0px;width:300px;height:50px;padding:4px;color:#f00;background:#c0c0c0;z-index:20000;"></div>').appendTo("body");
		$("#walt").hide();
	}
}
function walt_fadeOut(){
	window.setTimeout(function(){
		$("#walt").fadeOut(200,function(){$("#walt").hide();})
	},3000);
}
function KillSpace(Str,list){
	if(typeof(list) == 'undefined')
		list = ' ';
		
	while((Str.length>0) && list.indexOf(Str.charAt(0))!=-1 )
		 Str = Str.substring(1,Str.length);
	while((Str.length>0) && list.indexOf(Str.charAt(Str.length-1))!=-1)
	     Str = Str.substring(0,Str.length-1);
	
    return Str;
}
function GetCookie(Name) 
{
     var search = Name + "=";
     var returnvalue = "";
     if (document.cookie.length > 0) {
           offset = document.cookie.indexOf(search);
           if (offset != -1) {      
                 offset += search.length;
                 end = document.cookie.indexOf(";", offset);                        
                 if (end == -1)
                       end = document.cookie.length;
                 returnvalue=unescape(document.cookie.substring(offset,end));
           }
     }
     return returnvalue;
}
function SetCookie(name,value)
{
     var argv=SetCookie.arguments;
     var argc=SetCookie.arguments.length;
     var expires=(2<argc)?argv[2]:null;
     var path=(3<argc)?argv[3]:null;
     var domain=(4<argc)?argv[4]:null;
     var secure=(5<argc)?argv[5]:false;
     document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
}
//聚合表单内容
function getFormData(id){
	var data = {};
	//单行文本
	$(id+" input[type=text]").each(function(i,n){
		$(this).val(KillSpace($(this).val()));
		if($(this).attr("Optional") == 0){
			//如果内容必填
			var name = $(this).attr("id");
			if($(this).val() == "")
			{
				$("#"+name+"_tip").show();
				$(this).focus();
				return false;
			}
			else
				$("#"+name+"_tip").hide();
		}
		data[$(this).attr("id")] = $(this).val();
	});
	//密码区域
	$(id+" input[type=password]").each(function(i,n){
		if($(this).attr("Optional") == 0){
			//如果内容必填
			var name = $(this).attr("id");
			if($(this).val() == "")
			{
				$("#"+name+"_tip").show();
				$(this).focus();
				return false;
			}
			else
				$("#"+name+"_tip").hide();
		}
		data[$(this).attr("id")] = $(this).val();
	});
	//单选框
	$(id+" select").each(function(i,n){
		if($(this).attr("multiple") == true){
			var opt = $(this).find("option");
			var len = $(opt).length;
			var str = "";
			for(i=0;i<len;i++)
				str += "," + $(opt).eq(i).val();
			if(str != '') str = str.substr(1,str.length);
			data[$(this).attr("id")] = str;
		}
		else
			data[$(this).attr("id")] = $(this).val();
	});
	//多行文本
	$(id+" textarea").each(function(i,n){
		if($(this).attr("Optional") == 0){
			//如果内容必填
			var name = $(this).attr("id");
			if($(this).val() == "")
			{
				$("#"+name+"_tip").show();
				return false;
			}
			else
				$("#"+name+"_tip").hide();
		}
		data[$(this).attr("id")] = $(this).val();
	});
	var key = new Array();
	//单选按钮
	$(id+" input[type=radio]").each(function(i,n){
		var id = $(this).attr('name');
		if(key.search(id)==-1) {
			key.push(id);
			data[id] = '';
		}
		if($(this).attr('checked') == true) data[id] = $(this).val();
	});
	//多选框
	$(id+" input[type=checkbox]").each(function(i,n){
		var id = $(this).attr('name');
		if(key.search(id)==-1) {
			key.push(id);
			data[id] = '';
		}
		if($(this).attr('checked') == true) {
			if(data[id] == '')
				data[id] = $(this).val();
			else
				data[id] += "," + $(this).val();
		}
	});
	
	return data;
}

function d(value){
	alert(JSON.stringify(value));
}

Array.prototype.indexOf=function(substr,start){
 var ta,rt,d='\0';
 if(start!=null){ta=this.slice(start);rt=start;}else{ta=this;rt=0;}
 var str=d+ta.join(d)+d,t=str.indexOf(d+substr+d);
 if(t==-1)return -1;rt+=str.slice(0,t).replace(/[^\0]/g,'').length;
 return rt;
}

Array.prototype.lastIndexOf=function(substr,start){
 var ta,rt,d='\0';
 if(start!=null){ta=this.slice(start);rt=start;}else{ta=this;rt=0;}
 ta=ta.reverse();var str=d+ta.join(d)+d,t=str.indexOf(d+substr+d);
 if(t==-1)return -1;rt+=str.slice(t).replace(/[^\0]/g,'').length-2;
 return rt;
}

Array.prototype.replace=function(reg,rpby){
 var ta=this.slice(0),d='\0';
 var str=ta.join(d); str=str.replace(reg,rpby);
 return str.split(d);
}

Array.prototype.search=function(reg){
	var ta=this.slice(0);
	var d='\0';
	var str=d+ta.join(d)+d;
	var regstr=reg.toString();
	var flag = "g";
	var re = /\/((.|\n)+)\/(.+)/g;
	if(regstr.search(re) !=-1){
		flag = regstr.replace(/\/((.|\n)+)\/(.*)/,'$3');
	}
	re = /\/((.|\n)+)\/.*/g;
	regstr = regstr.replace(re,'\\0$1\\0');
	reg=new RegExp(regstr,flag);
	t=str.search(reg);
	if(t==-1)
	return -1;
	return str.slice(0,t).replace(/[^\0]/g,'').length;
}

function wswf(src,width,height,id){
	if (AC_FL_RunContent == 0) {
		alert("此页需要 AC_RunActiveContent.js");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', width,
			'height', height,
			'src', src,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', id,
			'name', id,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','always',
			'movie', src,
			'salign', ''
			); //end AC code
	}
	var str = '<noscript>';
	str += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="middle">';
	str += '<param name="allowScriptAccess" value="always" />';
	str += '<param name="allowFullScreen" value="false" />';
	str += '<param name="wmode" value="transparent" />';
	str += '<param name="name" value="'+id+'" />';
	str += '<param name="id" value="'+id+'" />';
	str += '<param name="movie" value="'+src+'.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	';
	str += '<embed wmode="transparent" id="'+id+'" src="'+src+'.swf" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	str += '</object></noscript>';
	document.write(str);
}


function ckeckend(){
	var offset = $(this).offset();
		var data = getFormData(".ckeckend");
		data['cmd'] = 'checkout';
		$.ajax({
			type:'POST',
			url:'ajax.php',
			data:data,
			dataType:'text',
			success:function(msg){
				//保存成功
				if(msg == "0"){
					//document.location.href='member.php';
					$("#walt").html("兑换申请保存成功，我们将通过快件邮件给您！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,function(){
						document.location.href='member.php';
					});
				}
				else
					$("#walt").html(msg+ "<br>稍后再试！").css({left:offset.left+150,top:offset.top}).fadeTo(200,0.6,walt_fadeOut);
			}
		});
}

function banner(url){
	 var str = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"1000\" height=\"360\">";
	str += "  <param name=\"movie\" value=\"/images/banner.swf?config=/"+url+"\" />";
	str += "  <param name=\"quality\" value=\"high\" />";
	str += "  <param name=\"wmode\" value=\"transparent\" />"
	str += "  <param name=\"allowFullscreen\" value=\"true\" />";
	str += "  <embed src=\"/images/banner.swf?config=/"+url+"\" wmode = \"transparent\" allowFullscreen=\"true\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"1000\" height=\"360\"></embed></object>";
	document.write(str);
}

function WMast()
{
	if($("#wmast").length == 0)
	{
		var w = $(document).width();
		var h = $(document).height()- ($.browser.msie?4:0);
		var mast = $('<div id="wmast" style="position:absolute;left:0px;top:0px;width:100%;height:100px;text-align:center;background:#fff;filter: Alpha(Opacity=70); -moz-opacity:0.7; opacity:0.7;z-index:999;"></div>').appendTo("body");
		$("#wmast").css({height:h});	
	}
}
function mess_show(){
	WMast();
	$(".message_show_div").css("display","block");
	$(".message_show_div").css("position","absolute");
	$(".message_show_div").css("z-index","9999");
	$(".message_show_div").css("left","420px");
	var top=document.documentElement.scrollTop;
	$(".message_show_div").css("top",top+200);
}

//搜索
function check_search(){
	 var keyword=$("#keyword").val();	
    if(keyword==''){
    	alert('搜索关键词不能为空！');
		$("#keyword").focus();
		return;
    }if(keyword=='_'){
    	alert('请输入正确的搜索关键词！');
		$("#keyword").focus();
		return;
    }
    document.search_frm.submit();
}

function res_show(){
	WMast();
	$(".res_div").css("display","block");
	$(".res_div").css("position","absolute");
	$(".res_div").css("z-index","9999");
	$(".res_div").css("left","320px");
	var top=document.documentElement.scrollTop;
	$(".res_div").css("top",top+5);
	
}
function close_res_div(){
	$(".res_div").css("display","none");
	$("#wmast").remove();
}
