// JavaScript Document
<!--
function imageXY(myimg, mywidth, myheight) {
	var tmp_img = new Image();
	tmp_img.src = myimg.src;
	image_x = tmp_img.width;
	image_y = tmp_img.height;
	if (image_x > mywidth) {
		tmp_img.height = image_y * mywidth / image_x;
		tmp_img.width = mywidth;
		if (tmp_img.height > myheight) {
			tmp_img.width = tmp_img.width * myheight / tmp_img.height;
			tmp_img.height = myheight;
		}
	} else {
		if (image_y > myheight) {
			tmp_img.width = image_x * myheight / image_y;
			tmp_img.height = myheight;
			if (tmp_img.width > mywidth) {
				tmp_img.height = tmp_img.height * mywidth / tmp_img.width;
				tmp_img.width = mywidth;
			}
		}
	}
	myimg.width = tmp_img.width;
	myimg.height = tmp_img.height;
}

function H_Search_Check()
{
	if (H_Search.keywords.value=="")
	{
		alert("请输入关键字！")
		document.H_Search.keywords.focus;
		return false;
	}
	if (H_Search.ST[0].checked==true){
	document.H_Search.action="/info/search.asp"
	}
	else
	{
	document.H_Search.action="/ask/list.asp"
	}
document.H_Search.submit()
return true;
}

function R_Search_Check(id){var S = $("#RST > a");S.removeClass();S.toggle(function () {$(this).addClass("W");$("#RightST").val(id);},function (){$(this).addClass("W");$("#RightST").val(id);});return true;}
function Show()
{
	var p = $("#Nav3");
	var offset = p.offset();
	//p.html( "left: " + offset.left + ", top: " + offset.top ); 
	$("#Nav3").hover(
  function () {
    //alert(1);
//	$("#nav_d").show();
//	//var A = $("#Nav3").scrollLeft();
//	//alert(offset.left);
//	$("#nav_d").css("top", offset.top+20);
//	$("#nav_d").css("left", offset.left-26)
	//$(this).addClass("W");
  },
  function () {
    $(this).removeClass("hover");
  }
); 
	}


function checkInput(nForm){
  if(nForm.txtName.value==""){
  		alert("对不起，请输入您的姓名，或者登录！");
		nForm.txtName.focus();
		return false;  
  }
  if(nForm.txtTitle.value==""){
  		alert("主题不能为空，请填写！");
		nForm.txtTitle.focus();
		return false;  
  }
  if ((nForm.txtTitle.value).length < 6|| (nForm.txtTitle.value).length > 20)
	{
	alert("主题应该长度应该是6-20个字符！")
	nForm.txtTitle.focus()
	nForm.txtTitle.select()
	return false;
	}
  if(nForm.txtContent.value==""){
  		alert("内容不能为空，请填写！");
		nForm.txtContent.focus();
		return false;  
  }
  if (nForm.VCode.value==""){
      alert("请输入验证码!");
      nForm.VCode.focus();
      return false;
  }
  return true;
}

function f_focus(){ }

function Ask_Clear()
{
alert($(this).html());
//if (this.value=="提交您的问题，邦研专家将在24小时内回答您的咨询!"){this.value=="";}

}
//检测合法email;
   function chkemail(a) 
   {var i=a.length;
  var temp = a.indexOf('@');
  var tempd = a.indexOf('.');
  if (temp >= 1) {
      if ((i-temp) > 3){
          
              if ((i-tempd)>0){
                  return 1;
              }
          
      }
  }
  return 0;
}

function checkOrderInput(nForm)  
{   

if(nForm.Contact.value==""){
	alert("姓名不能为空,请填写!");
	nForm.Contact.focus();
	return false;
}

if(nForm.Mobile.value==""){
	alert("手机不能为空,请填写!");
	nForm.Mobile.focus();
	return false;
}
var my_str=nForm.Mobile.value;
for(var i=0;i<my_str.length;i++){
	var c=my_str.charAt(i);
	if(c<"0"||c>"9"){
		alert("手机应为数字,请填写正确的内容!");
		nForm.Mobile.focus();
		nForm.Mobile.select();
		return false;
	}
}
if(nForm.Field_4.value==""){
	alert("预约时间不能为空,请填写!");
	nForm.Field_4.focus();
	return false;
}

if (nForm.email.value == ""||chkemail(nForm.email.value)==0)
      {
      alert("请输入正确的，可以联络到您的E-mail");
      nForm.email.focus();
      return false;
}

if (nForm.VCode.value==""){
      alert("请输入验证码!");
      nForm.VCode.focus();
      return false;
}
 
return true;
}

//========================= 设置字体大中小 start =============
	function doZoom(size){
		var artibody = document.getElementById('artibody');
		if(!artibody){
			return;
		}
		var artibodyChild = artibody.childNodes;
		artibody.style.fontSize = size + 'px';
		//再对artibody div内的直接html节点设置fontSize属性
		for(var i = 0; i < artibodyChild.length; i++){
			if(artibodyChild[i].nodeType == 1){
				artibodyChild[i].style.fontSize = size + 'px';
			}
		}
	}
//========================= 设置字体大中小 end =============
	function Addme(){
		var url = document.location; 	
		window.external.AddFavorite(url,document.title);
	}
	function sendmail(id){//2.0弹出显示 
		window.open("/Info/send_mail.asp?id="+id+"&title="+document.all.MyTitle.value,"send_mail","menubar=no,toolsbar=no,scrollbars=0,top=100,left=100,width=544,height=320,location=no");
	}

function left(){
	LorR=0;
}
function right(){
	LorR=1;
}
function spd(n){
	speed=n;
	clearInterval(MyMar);
	MyMar=setInterval(Marqueepic,speed); 
}	
function Marqueepic(){
if(LorR) MarqueeRight();
else MarqueeLeft();
}
function MarqueeLeft(){
	with (demos) {
        if(scrollLeft>=marquePic1.scrollWidth){ 
            scrollLeft=0
        }else{ 
            scrollLeft++
        }
    }
}
function MarqueeRight(){
	with (demos) {
        if(scrollLeft<=0){ 
            scrollLeft=marquePic1.scrollWidth 
        }else{ 
            scrollLeft--
        }
    }
}

  function show_cart(Url){
      window.open(Url,"my_cart","toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=yes, status=no,width=580,height=280,top=100,left=180");
  }

  function addto_cart(catalogid,productid){
      var url="/shop/gb/addto_cart.asp?catalogid="+catalogid+"&productid="+productid;
      show_cart(url);
  }

function addtocart(id){
	$("#Ret").html("<img src=\"/images/loading.gif\" width=\"20\" />");
	$.ajax({type: "POST",url: "addcart.asp",data: "id="+id+"&n="+Math.random()+"",success: function(msg){$("#Ret").html(msg);},error:function(){$("#Ret").html("添加错误");}}); } 

function TabShow(TabName,n,TotalNum,Bcss,Ecss){for (i=0;i<=TotalNum;i++){if (i!=n){if(Ecss!=""){$("#"+TabName+i).removeClass(Ecss);}$("#"+TabName+'-'+i).hide();}else{$("#"+TabName+'-'+i).fadeIn("fast");if(Bcss!=""){$("#"+TabName+i).addClass(Bcss);}};}}

function killErrors() {
    return true;
}
window.onerror = killErrors;

-->
