$(document).ready(function(){sameh();basesz();/* qqfudong();*/});function test(){}function basesz(){$("#Sethome").click(function(){this.style.behavior='url(#default#homepage)';this.setHomePage("http://www.jsgzzs.com.cn");});$("#AddFavorite").click(function(){window.external.addFavorite('www.jsgzzs.com.cn','中国宁波勒克斯照明电器有限公司');});$("a.blank").click(function(){window.open($(this).attr("href"));return false;});$("#message").submit(function(){check_form2()});$("#gcal").load("marquee.asp");$("body").pngFix();}function huishe(){$("#dds").addclass("huishe");}function qqfudong(){var menuYloc = $("#QQ").offset().top;$(window).scroll(function (){ var offsetTop = menuYloc + $(window).scrollTop() +"px";$("#QQ").animate({top : offsetTop },{ duration:600 , queue:false });});}function check(){if($("#name").val()==""){alert("请输入你的名称！");$("#name").focus();return(false);}if($("#title").val()==""){alert("请输入你的主题！");$("#title").focus();return(false);}if($("#email").val()!=""&&!isemail($("#email").val())){alert("请输入正确的电子邮箱！");$("#email").focus();return(false);}if($("#message").val()==""){alert("请输入你的留言内容！");$("#message").focus();return(false);}return(true);}function isemail(mail){return(new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(mail));}function isEmail(strEmail) {if (strEmail.search(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/) == -1){return false;}else{return true;}}function check_tel(tels) {if (tels.search(/^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$|^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/) == -1){return false;}else{return true;}}function check_zip(zip){if (zip.search(/^[1-9]\d{5}$/)==-1){return false;}else{return true;}}function check_zip2(zip2){if (zip2.search(/^[1-9]\d{3}$/)==-1){return false;}else{return true;}}function check_form2(){name=$("#name").val();tel=$("#tel").val();phone=$("#phone").val();address=$("#address").val();yzm=$("#yanzm").val();email=$("#email").val();content=$("#content").val();if (name==""){alert("姓名不能为空！");$("#name").focus();return false;}else if(tel!="" && check_tel(tel)==false ){alert("请输入正确电话号码");$("#tel").focus();return false;}else if(email!="" && isEmail(email)==false ){alert("请输入正确电子邮件");$("#email").focus();return false;}else if(phone!="" && check_num(phone)==false ){alert("请输入正确手机号码");$("#phone").focus();return false;}else if(content==""){alert("留言内容不能为空！");$("#content").focus();return false;}else if(yzm!="" && check_zip2(yzm)==false ){alert("验证码错误！");$("#yzm").focus();return false;}else{$("form").attr("action","_update.asp?action=yes");return true;}}function get(id){return document.getElementById(id);}function check_num(value){if (value.search(/^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/)==-1 && value!="") {return false;}else{return true;}}function ppRoll(a){this.myA = a;this.myA.IsPlay = 1;
this.$(a.demo).style.overflow = "hidden";
	this.$(a.demo).style.width = a.width;
	this.$(a.demo).style.height = a.height;
	this.$(a.demo2).innerHTML=this.$(a.demo1).innerHTML;
	this.$(a.demo).scrollTop=this.$(a.demo).scrollHeight;
	this.Marquee();
	this.$(a.demo).onmouseover=function() {eval(a.objStr+".clearIntervalpp();");}
	this.$(a.demo).onmouseout=function() {eval(a.objStr+".setTimeoutpp();")}}
ppRoll.prototype.$ = function(Id){return document.getElementById(Id);}
ppRoll.prototype.getV = function(){ alert(this.$(this.myA.demo2).offsetWidth-this.$(this.myA.demo).scrollLeft);alert(this.$(this.myA.demo2).offsetWidth);alert(this.$(this.myA.demo).scrollLeft);}
ppRoll.prototype.Marquee = function(){this.MyMar=setTimeout(this.myA.objStr+".Marquee();",this.myA.speed);
	if(this.myA.IsPlay == 1){if(this.myA.direction == "top")
		{if(this.$(this.myA.demo).scrollTop>=this.$(this.myA.demo2).offsetHeight)
				this.$(this.myA.demo).scrollTop-=this.$(this.myA.demo2).offsetHeight;
			else{this.$(this.myA.demo).scrollTop++;}}
		if(this.myA.direction == "down")
		{if(this.$(this.myA.demo1).offsetTop-this.$(this.myA.demo).scrollTop>=0)
				this.$(this.myA.demo).scrollTop+=this.$(this.myA.demo2).offsetHeight;
			else{this.$(this.myA.demo).scrollTop--;}}
		if(this.myA.direction == "left")
		{if(this.$(this.myA.demo2).offsetWidth-this.$(this.myA.demo).scrollLeft<=0)
				this.$(this.myA.demo).scrollLeft-=this.$(this.myA.demo1).offsetWidth;
			else{this.$(this.myA.demo).scrollLeft++;}}
		if(this.myA.direction == "right")
		{if(this.$(this.myA.demo).scrollLeft<=0)
				this.$(this.myA.demo).scrollLeft+=this.$(this.myA.demo2).offsetWidth;
			else{this.$(this.myA.demo).scrollLeft--;}}}}
ppRoll.prototype.clearIntervalpp = function(){this.myA.IsPlay = 0;}
ppRoll.prototype.setTimeoutpp = function(){this.myA.IsPlay = 1;}
function flash(url,width,height){document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='"+width+"' height='"+height+"'><param name='movie' value='"+url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><embed src='"+url+"' quality='high' wmode='transparent' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed></object>");	}
function huishe(){$("body:not(.qq)") .addclass("huishe");}
function sameh(){
var lheight=$(".nm1").height()+193;
var rheight=$(".nm2").height();
if (lheight>rheight){
$(".nm2").height(lheight);
}
else{$(".nm1").height(rheight-193);
}	
}
