//注册查询
function checkaccount()
{
  var vale;
  vale = document.add.uname.value;
  if (vale==""){
	alert("请输入用户名再查询！");
	document.add.uname.focus();
	return false;
  }
  window.open("checkuser.asp?valu="+vale,"","width=400,height=200,top=180,left=300")
}
//注册验证
function check(){
	
	if (document.add.uname.value==""){
		alert("请输入用户名！");
		document.add.uname.focus();
		return false;
		}

	if (document.add.upwd.value==""){
		alert("请输入密码！");
		document.add.upwd.focus();
		return false;
		}
		
	if (document.add.upwd1.value==""){
		alert("请输入确认密码！");
		document.add.upwd1.focus();
		return false;
		}
		
	if (document.add.upwd.value!=document.add.upwd1.value){
	    alert("两次输入的密码不一致！请重新输入密码！");
		document.add.upwd.value="";
		document.add.upwd1.value="";
		document.add.upwd.focus();
	    return false;
	   }

	if (document.add.iname.value==""){
		alert("请输入您的真实姓名！");
		document.add.iname.focus();
		return false;
		}	
	/*	
	if (document.add.tel.value==""){
		alert("请输入您的电话号码！");
		document.add.tel.focus();
		return false;
		}
		
	if (document.add.email.value==""){
		alert("请输入您的电子邮件！");
		document.add.email.focus();
		return false;
		}
	
	if (document.add.email.value!=""){
		if ((document.add.email.value.indexOf("@") == -1) || (document.add.email.value.indexOf(".") == -1)){
			alert("您输入的Email可能有误！" );
			document.add.email.value="";
			document.add.email.focus();
			return false;
			}
		}
		
	if (document.add.add.value==""){
		alert("请输入地址！");
		document.add.add.focus();
		return false;
		}*/
	
	return true;
	}
//登录验证
function check_login()
{
	if (document.form.usname.value=="")
	{
	alert("请输入用户名？");
	document.form.usname.focus();
	return false;
	}
	else if (document.form.passwd.value==""){
	alert("请输入密码？");
	document.form.passwd.focus();
	return false;
	} 
	else if (document.form.vercode.value==""){
	alert("请输入验证码？");
	document.form.vercode.focus();
	return false;
	}
	else
	{
	return true;
	}
  }


//预约验证
function check_order(){
	
	/*if (document.order.product.value==""){
		alert("请输入产品名称！");
		document.order.product.focus();
		return false;
		}*/

	if (document.order.user.value==""){
		alert("请输入您的姓名，以便我们和你联系！");
		document.order.user.focus();
		return false;
		}
		
	if (document.order.tel.value==""){
		alert("请输入您的电话号码，以便我们和你联系！");
		document.order.tel.focus();
		return false;
		}
	
		
	/*if (document.order.mail.value==""){
		alert("请输入您的电子邮件！");
		document.order.mail.focus();
		return false;
		}*/
	
	if (document.order.mail.value!=""){
		if ((document.order.mail.value.indexOf("@") == -1) || (document.order.mail.value.indexOf(".") == -1)){
			alert("您输入的Email可能有误！" );
			document.order.mail.value="";
			document.order.mail.focus();
			return false;
			}
		}
		
	if (document.order.addre.value==""){
		alert("请输入您的地址，以便我们和你联系！");
		document.order.addre.focus();
		return false;
		}
		
	if (document.order.post.value==""){
		alert("请输入您的邮政编码，以便我们和你联系！");
		document.order.post.focus();
		return false;
		}
		
	if (document.order.content.value==""){
		alert("请输入订单详细说明！");
		document.order.content.focus();
		return false;
		}
	
	return true;
	}
	
//留言验证
function check_form(){/*
 if(document.form1.subject.value==""){
    alert("你的主题不能为空!");
	document.form1.subject.focus();
	return false; 
 }*/
 function checkr(){
	var ooo=document.getElementsByName('subject');
	for (i=0;i<ooo.length;i++){
		   if (ooo[i].checked){
		   return true;
		   }
	}
	alert('请选择留言类型，你的姓名不能为空!');
	document.form1.subject[0].focus();
	return false;
	}
 checkr();
 if(document.form1.name.value==""){
    //alert("");
	//document.form1.name.focus();
	return false; 
 }/*
 if(document.form1.email.value.indexOf("@")==-1 || document.form1.email.value.indexOf(".")==-1){
    alert("电子邮箱不能为空和格式不正确!");
	document.form1.email.focus();
	document.form1.email.value="";
	return false; 
 }
 if(document.form1.qq.value!=""){
   if(document.form1.qq.value.match(/\D/)){
    alert("你的QQ号填写不正确!");
	document.form1.qq.focus();
	document.form1.qq.value="";
	return false;
	}
 }
 if(document.form1.phone.value==""){
    alert("你的电话号码不能为空或填写不正确!");
	document.form1.phone.focus();
	document.form1.phone.value="";
	return false;
 }*/
 if(document.form1.content1.value==""){
    alert("你的留言内容不能为空!");
	document.form1.content1.focus();
	return false; 
 }
   return true;
}

function resizeimg(ImgD,iwidth,iheight) {
     var image=new Image();
     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;
                }
               ImgD.alt=image.width+"×"+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;
                     }
                ImgD.alt=image.width+"×"+image.height;
            }
　　　　　ImgD.style.cursor= "pointer"; //改变鼠标指针
　　　　　ImgD.onclick = function() { window.open(this.src);} //点击打开大图片
　　　　if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) { //判断浏览器，如果是IE
　　　　　　ImgD.title = "请使用鼠标滚轮缩放图片，点击图片可在新窗口打开";
　　　　　　ImgD.onmousewheel = function img_zoom() //滚轮缩放
　　　　　 {
　　　　　　　　　　var zoom = parseInt(this.style.zoom, 10) || 100;
　　　　　　　　　　zoom += event.wheelDelta / 12;
　　　　　　　　　　if (zoom> 0)　this.style.zoom = zoom + "%";
　　　　　　　　　　return false;
　　　　　 }
　　　  } else { //如果不是IE
　　　　　　　     ImgD.title = "点击图片可在新窗口打开";
　　　　　　   }
    }
}

function ContentSize(size)
{
var obj=document.getElementById("size");obj.style.fontSize=size+"px";
}

//禁止鼠标右键
/*
if (window.Event) 
  document.captureEvents(Event.MOUSEUP); 
 
function nocontextmenu() 
{
 event.cancelBubble = true
 event.returnValue = false;
 
 return false;
}
 
function norightclick(e) 
{
 if (window.Event) 
 {
  if (e.which == 2 || e.which == 3)
   return false;
 }
 else
  if (event.button == 2 || event.button == 3)
  {
   event.cancelBubble = true
   event.returnValue = false;
   return false;
  }
 
}
 
document.oncontextmenu = nocontextmenu;  // for IE5+
document.onmousedown = norightclick;  // for all others

*/
/*去掉flash的激活控件*/
if(typeof(dm)!="object"){var dm={}}
dm.$=function(objId){if(!objId){throw new Error("dm.$(String objId)参数必须")}
if(document.getElementById){return eval('document.getElementById("'+objId+'")')}else if(document.layers){return eval("document.layers['"+objId+"']")}else{return eval('document.all.'+objId)}}
dmFlash=function(C,v,x,V,c,X,i,O,I,l,o){var z=this;if(!document.createElement||!document.getElementById){return}
z.id=v?v:"";z.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";z.codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+(c?c:"7")+",0,0,0";z.width=x;z.height=V;z.movie=C;z.bgcolor=X?X:null;z.quality=O?O:"high";z.src=z.movie;z.pluginspage="http://www.macromedia.com/go/getflashplayer";z.type="application/x-shockwave-flash";z.useExpressInstall=i?i:null;z.xir=(I)?I:window.location;z.redirectUrl=l?l:null;z.detectKey=o?o:null;z.escapeIs=false;z.objAttrs={};z.params={};z.flashVars=[];z.flashVarsStr="";z.embedAttrs={};z.forSetAttribute("id",z.id);z.objAttrs["classid"]=z.classid;z.forSetAttribute("codebase",z.codebase);z.forSetAttribute("width",z.width);z.forSetAttribute("height",z.height);z.forSetAttribute("movie",z.movie);z.forSetAttribute("quality",z.quality);z.forSetAttribute("pluginspage",z.pluginspage);z.forSetAttribute("type",z.type);z.forSetAttribute("bgcolor",z.bgcolor)}
dmFlash.prototype={getFlashHtml:function(){var I=this,i='<object ';for(var l in I.objAttrs){i+=l+'="'+I.objAttrs[l]+'" '}
i+='>';for(var l in I.params){i+='<param name="'+l+'" value="'+I.params[l]+'" /> '}
if(I.flashVarsStr!=""){i+='<param name="FlashVars" value="'+I.flashVarsStr+'" /> '}
i+='<embed ';for(var l in I.embedAttrs){i+=l+'="'+I.embedAttrs[l]+'" '}
i+=' ></embed></object>';return i},forSetAttribute:function(I,i){var l=this;I=I.toLowerCase();switch(I){case "classid":break;case "pluginspage":l.embedAttrs["pluginspage"]=i;break;case "src":l.embedAttrs["src"]=i;l.params["movie"]=i;break;case "movie":l.params["movie"]=i;l.embedAttrs["src"]=i;break;case "onafterupdate":case "onbeforeupdate":case "onblur":case "oncellchange":case "onclick":case "ondblClick":case "ondrag":case "ondragend":case "ondragenter":case "ondragleave":case "ondragover":case "ondrop":case "onfinish":case "onfocus":case "onhelp":case "onmousedown":case "onmouseup":case "onmouseover":case "onmousemove":case "onmouseout":case "onkeypress":case "onkeydown":case "onkeyup":case "onload":case "onlosecapture":case "onpropertychange":case "onreadystatechange":case "onrowsdelete":case "onrowenter":case "onrowexit":case "onrowsinserted":case "onstart":case "onscroll":case "onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "type":l.embedAttrs["type"]=i;break;case "codebase":l.objAttrs["codebase"]=i;break;case "width":l.objAttrs["width"]=i;l.embedAttrs["width"]=i;break;case "height":l.objAttrs["height"]=i;l.embedAttrs["height"]=i;break;case "align":l.objAttrs["align"]=i;l.embedAttrs["align"]=i;break;case "vspace":l.objAttrs["vspace"]=i;l.embedAttrs["vspace"]=i;break;case "hspace":l.objAttrs["hspace"]=i;l.embedAttrs["hspace"]=i;break;case "class":l.objAttrs["class"]=i;l.embedAttrs["class"]=i;break;case "title":l.objAttrs["title"]=i;break;case "accesskey":l.objAttrs["accesskey"]=i;break;case "name":l.objAttrs["name"]=i;l.embedAttrs["name"]=i;break;case "id":l.objAttrs["id"]=i;l.embedAttrs["name"]=i;break;case "tabindex":l.objAttrs["tabindex"]=i;break;default:l.params[I]=l.embedAttrs[I]=i}},forGetAttribute:function(i){var I=this;i=i.toLowerCase();if(I.objAttrs[i]!=undefined){return I.objAttrs[i]}else if(I.embedAttrs[i]!=undefined){return I.embedAttrs[i]}else if(I.embedAttrs!=undefined){return I.embedAttrs[i]}else{return null}},setAttribute:function(I,i){this.forSetAttribute(I,i)},getAttribute:function(i){return this.forGetAttribute(i)},addVariable:function(I,i){var l=this;if(l.escapeIs){I=escape(I);i=escape(i)}
if(l.flashVarsStr==""){l.flashVarsStr=I+"="+i}else{l.flashVarsStr+="&"+I+"="+i}
l.embedAttrs["FlashVars"]=l.flashVarsStr},getVariable:function(I){var o=this,i=o.flashVarsStr;if(o.escapeIs){I=escape(I)}
var l=new RegExp(I+"=([^\\&]*)(\\&?)","i").exec(i);if(o.escapeIs){return unescape(RegExp.$1)}
return RegExp.$1},addParam:function(I,i){this.forSetAttribute(I,i)},getParam:function(){return this.forGetAttribute(name)},write:function(i){var I=this;if(typeof i=="string"){dm.$(i).innerHTML=I.getFlashHtml()}else if(typeof i=="object"){i.innerHTML=I.getFlashHtml()}}}
