function GETOBJ(OBJID){if(document.getElementById && document.getElementById(OBJID)){return document.getElementById(OBJID);}else if(document.all && document.all(OBJID)){return document.all(OBJID);}else if(document.layers && document.layers[OBJID]){return document.layers[OBJID];}else{return false;}}
//---------------------------------------------------------------
function Ajax2(path2,txt2,obj2){var AJAX1;var AJAX1_Val;obj2.innerHTML='&nbsp;&nbsp;<img src="/images/common/onloading.gif" />&nbsp;正在处理数据...&nbsp;';if (window.ActiveXObject){AJAX1= new ActiveXObject("Microsoft.XMLHTTP");}else if(window.XMLHTTPRequest){AJAX1=new XMLHTTPRequest();}else{alert("");return false;}if (!AJAX1){alert("");}AJAX1.open("POST",path2,false); AJAX1.setRequestHeader("If-Modified-Since","0");AJAX1.setRequestHeader("Content-Length", txt2.length); AJAX1.setRequestHeader("Content-Type","application/x-www-form-urlencoded");AJAX1.send(txt2); AJAX1_Val=unescape(AJAX1.responseText);obj2.innerHTML=AJAX1_Val;}
//---------------------------------------------------------------
function vchar(str){str=str.replace(/\+/g,"%2B");str=str.replace(/\&/g,"%26");return str;}
//---------------------------------------------------------------
//function time_show(){var ds,y,m0,d,h,w,s,mi;var datebox=GETOBJ("datebox");ds=new Date();y=ds.getYear();mo=ds.getMonth()+1;d=ds.getDate();h=ds.getHours();mi=ds.getMinutes();s=ds.getSeconds();datebox.innerHTML="现在是："+y+"年"+mo+"月"+d+"日"+d+"点"+mi+"分"+s+"秒";window.setTimeout("time_show()",1000);}
//---------------------------------------------------------------
//function vcode(vcn,vco) {var cf = "/common/vcode.asp";var img=GETOBJ(vco);if(img){img.innerHTML = '<img src="'+cf+'?t='+Math.random()+'" alt="看不清楚？点击刷新验证码" class="hover" onclick="this.src=\''+cf+'?t=\'+Math.random()" />'}var obj_vc=GETOBJ(vcn);if(obj_vc.value=="点击此处"){obj_vc.value="";}}
//---------------------------------------------------------------
function flash_show(file,width,height,marginleft,margintop,style){var obj;if (style==1){obj='<embed src="'+file+'"; quality="high" wmode="transparent" style="width:'+width+'px;height:'+height+'px; position:absolute;margin-left:'+marginleft+'px;margin-top:'+margintop+'px;"></embed>';}else if(style==2){obj='<object id="flash_obj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'"><param name="movie" value="'+file+'" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed></object>';}document.write(obj);}
function flash_show2(file,width,height,marginleft,margintop,style){var obj;if (style==1){obj='<embed src="'+file+'"; quality="high" wmode="transparent" style="width:'+width+'px;height:'+height+'px; position:absolute;margin-left:'+marginleft+'px;margin-top:'+margintop+'px;"></embed>';}else if(style==2){obj='<object id="flash_obj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'"><param name="movie" value="'+file+'" /><param name="quality" value="high" /><param name="wmode" value="opaque" /><param name="loop" value="false" /><embed src="'+file+'" quality="high" loop="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed></object>';}document.write(obj);}
//---------------------------------------------------------------
//function AutoSmallImg(ImgD,W,H){var image=new Image();var iwidth = W;var iheight = H;image.src=ImgD.src;if(image.width>0 && image.height>0){if(image.width/image.height>= iwidth/iheight){if(image.width>iwidth){ImgD.width=iwidth;ImgD.height=(image.height*iwidth)/image.width;}else{ImgD.width=image.width;ImgD.height=image.height;}}else{if(image.height>iheight){ImgD.height=iheight;ImgD.width=(image.width*iheight)/image.height;}else{ImgD.width=image.width;ImgD.height=image.height;}}}} 
//---------------------------------------------------------------
//function startmarquee(obj,lh,speed,delay,index){var t;var p=false;var o=document.getElementById(obj+index);o.innerHTML+=o.innerHTML;o.onmouseover=function(){p=true;}o.onmouseout=function(){p=false;}o.scrollTop = 0;function start(){t=setInterval(scrolling,speed);if(!p) o.scrollTop += 2;}function scrolling(){if(o.scrollTop%lh!=0){o.scrollTop += 2;if(o.scrollTop>=o.scrollHeight/2) o.scrollTop = 0;}else{clearInterval(t);setTimeout(start,delay);}}setTimeout(start,delay);}
//---------------------------------------------------------------
function val(paranum,paraname){var obj_1,obj_2;obj_2="";for(var i=1;i<=paranum;i++){obj_1=GETOBJ(paraname+i).value;obj_2=obj_2+"&"+paraname+i+"="+escape(vchar(obj_1));}return obj_2;}
//---------------------------------------------------------------
function communicate(tips){var tip=GETOBJ(tips);var str='<ul>';str=str+'<li><label>您的称呼：</label>';str=str+'<input type="text" id="cmm1" class="inpt1" /></li>';str=str+'<li><label>联系电话：</label>';str=str+'<input type="text" id="cmm2" class="inpt1" /></li>';str=str+'<li><label>电子邮件</label>';str=str+'<input type="text" id="cmm3" class="inpt1" /></li>';str=str+'<li><label>联系地址</label>';str=str+'<input type="text" id="cmm4" class="inpt1" /></li>';str=str+'<li><label>个人主页</label>';str=str+'<input type="text" id="cmm5" class="inpt1" /></li>';str=str+'<li><label>QQ号码：</label>';str=str+'<input type="text" id="cmm6" class="inpt1" /></li>';str=str+'<li><label>MSN：</label>';str=str+'<input type="text" id="cmm7" class="inpt1" /></li>';str=str+'<li><label>留言内容：</label>';str=str+'<textarea id="cmm8" class="inpt2"></textarea></li>';str=str+'<li><input type="hidden" id="cmm9" value="30" />';str=str+'您的表情：<span id="face_show"><img src="/images/common/face/30.gif" /></span><br />可选表情：';for (var i=1;i<=30;i++){str=str+'<img src="/images/common/face/'+i+'.gif" onclick="val_set('+i+')"  />';}str=str+'</li>';str=str+'</ul>';str=str+'<input type="button" id="bnt1" value="提交留言" class="bnt1" onclick="communicate_hk()" /> <span id="tip1"></span>';tip.innerHTML=str}
//---------------------------------------------------------------
function val_set(i){var obj1=GETOBJ("cmm9");obj1.value=i;obj1=GETOBJ("face_show");obj1.innerHTML='<img src="/images/common/face/'+i+'.gif" /> <font color=#ff0000>表情设置成功</font>'}
//---------------------------------------------------------------
function communicate_hk()
{
	var obj_1=GETOBJ("cmm1");
	var obj_2=GETOBJ("cmm2");
	var obj_3=GETOBJ("cmm8");
	if (obj_1.value=="")
	{
		alert("请填写您的称呼");
		obj_1.focus();
		return false;
	}else if(obj_2.value==""){
		alert("请填写您的联系电话");
		obj_2.focus();
		return false;
	}else if(obj_3.value==""){
		alert("请填写您的留言内容");
		obj_3.focus();
		return false;
	}else{
		var bnt1=GETOBJ("bnt1");
		bnt1.disabled="disabled";
		//-----
		var obj="act="+escape("communicate_chk");
		obj=obj+val(9,"cmm");
		var path="../class/bandt_ajax.asp";
		var tips=GETOBJ("tip1");
		Ajax2(path,obj,tips);
		alert("感谢您的留言！");
		window.location.reload();
	}
}
