sysinfo.share = '/share/'; function load_nav(s) { var onav=$('#nav a'); var curPage=s; $('#nav a').each(function(){ var t=$(this); if(curPage==t.attr('t')) { t.addClass('hover'); } }); } //获取页面可见区域宽度、高度(不包含边框) function fnGetDocumentClient() { return {width:top.document.documentElement.clientWidth||top.document.body.clientWidth,height:top.document.documentElement.clientHeight||top.document.body.clientHeight} } //获取页面正文区域宽度、高度 function fnGetDocumentScroll() { return {width:top.document.documentElement.scrollWidth||top.document.body.scrollWidth,height:top.document.documentElement.scrollHeight||top.document.body.scrollHeight} } (function(){ y=window._={ onload:function(b){var c=window.onload;window.onload=typeof window.onload!="function"?b:function(){c();b()}}, scroll:function(o) { o=o||document.documentElement; return {w:o.scrollWidth,h:o.scrollHeight} }, client:function(o) { o=o||document.documentElement; return {w:o.clientWidth,h:o.clientHeight} }, init:function(e,b,d){b=b||{};d=d||{};for(var c in d)e[c]=b[c]||b[c]==0?b[c]:d[c]} }; })() String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, "") }; String.prototype.format1 = function() { for (var a = arguments.length, b = this; a; ) b = b.replace(RegExp("\\{" + --a + "\\}", "g"), arguments[a]); return b }; String.prototype.format = function() { var args = arguments; return this.replace(/\{(\d+)\}/g, function(m, i) { return args[i]; }); }; String.prototype.trimStart = function(a) { a || (a = "\\s+"); return this.replace(RegExp("^(" + a + ")+", "g"), "") }; String.prototype.trimEnd = function(a) { a || (a = "\\s+"); return this.replace(RegExp("(" + a + ")+$", "g"), "") }; var floatFrame=function(pJso) { _.init(this,pJso,{ src:"",//框架路径 param:"",//参数 width:0,//框架宽度 height:0,//框架高度 title:'提示信息', fnClose:this.hide//关闭时触发的函数 }); this.fullDiv=top.document.getElementById("cFunllDiv")||top.document.createElement("div"); this.frameDiv=top.document.getElementById("cFrameDiv")||top.document.createElement("div"); this.frame=null; this.frameName='cFrame'; this.set(); } floatFrame.prototype= { set:function(){ this.frame=top.frames[this.frameName]; if(!this.frame) { this.fullDiv.style.cssText="position:absolute;top:0px;left:0px;display:none;background-color:#000;filter:alpha(opacity=10);-moz-opacity:0.1;opacity: 0.1;"; this.frameDiv.style.cssText="position:absolute;display:none;background-color:#fff;z-index:10000"; this.frameDiv.innerHTML= '
' +'
' +'
' +'
' +'
' +'' +'
' +'
' +'
'; this.fullDiv.setAttribute("id","cFunllDiv"); top.document.body.appendChild(this.fullDiv); this.frameDiv.setAttribute("id","cFrameDiv"); top.document.body.appendChild(this.frameDiv); this.frame=top.frames[this.frameName]; } }, hide:function() { this.fullDiv.style.display="none"; this.frameDiv.style.display="none"; top.document.getElementById(this.frameName).src=""; }, show:function() { top.document.getElementById('float01-title').innerHTML= '
'+ '
'+ '
'+this.title+'
'+ '
'; top.document.getElementById("cClose").onclick=function(o){return function(){o.fnClose()}}(this); var iClientWidth=fnGetDocumentClient().width; var iClientHeight=fnGetDocumentClient().height; var iScrollWidth=fnGetDocumentScroll().width; var iScrollHeight=fnGetDocumentScroll().height; var iFullDivWidth=iScrollWidth; var iFullDivHeight=iScrollHeight>iClientHeight?iScrollHeight:iClientHeight with(this.fullDiv.style) { width=iFullDivWidth+"px" height=iFullDivHeight+"px"; display=""; } var iTop=(iClientHeight-this.height)*(1-0.818); var iLeft=(iClientWidth-this.width)*0.5; iTop=iTop>0?iTop:0; iLeft=iLeft>0?iLeft:0; var f=top.document.getElementById(this.frameName); var ttt=this; top.document.onkeydown=document.onkeydown=function(e) { e=e||top.event||event; if(e.keyCode==27) ttt.hide(); } if(this.frameDiv["attachEvent"])//ie { f.onreadystatechange=function() { if(f.readyState === "complete") { ttt.frame.document.onkeydown=function() { if(ttt.frame.event.keyCode==27) ttt.hide(); } } } } else { f.onload=function() { ttt.frame.document.onkeydown=function(e) { if(e.keyCode==27) ttt.hide(); } } } f.src=this.src+"?"+this.param; /*f.width=this.width+"px"; f.height=this.height+"px"; */ with(this.frameDiv.style) { display="block"; } } } var FloatFrame=function(){}; FloatFrame.autoLocal=function() { var cFrame=top.document.getElementById('cFrame'); var cFloatDiv=top.document.getElementById('cFrameDiv'); var div_cFrame=top.document.getElementById('div_cFrame'); cFrame.style.width="1px"; cFrame.style.heght="1px"; var cur=_.scroll(); with(cFrame.style) { width=cur.w+'px'; height=cur.h+'px'; } var cli=_.client(top.document.documentElement); var iTop=(cli.h-cur.h)/2+(top.document.documentElement.scrollTop||top.document.body.scrollTop); var iLeft=(cli.w-cur.w)/2; iTop=iTop>0?iTop:0; iLeft=iLeft>0?iLeft:0; with(cFloatDiv.style) { top=iTop+"px"; left=iLeft+"px"; } var cur=_.scroll(); with(cFrame.style) { width=cur.w+'px'; height=cur.h+'px'; } with(div_cFrame.style) { width=(cur.w+30)+'px'; } }; var off; $(function(){ off=new floatFrame({title:'',src:''});}); function alertFloat(url) { off.src=url; off.show(); } //function alertUserLogin() //{ // alertFloat('user_login.asp'); //} //function alertUserReg() //{ // alertFloat('user_reg.asp'); //} //function alertFeedBack(id) //{ // off.src='ajax/feedback.asp'; // off.param='id='+id; // off.show(); //} //function userExit() //{ // $.ajax({ // url:'ajax/user_exit.asp', // type:'get', // success:function(data){load_webbar();} // }); //} function userLogin() { off.src = sysinfo.link + 'user/login/'; off.param = '' off.show(); } function userExit() { $.ajax( { url: sysinfo.link + 'user/cart/?action=userExit', type: 'get', success: function (data) { load_webbar(); } } );} function userReg() { off.src = sysinfo.link + 'user/register/'; off.param = '' off.show(); } function cartAdd(proID) { off.src=sysinfo.link+'user/cart/'; off.param = 'action=add&proID=' + proID off.show(); } function cartLoadEdit() { $('input[t=num]').change( function () { var val = $(this).val(); var cartID = $(this).attr('tid'); off.src = sysinfo.link + 'user/cart/'; off.param = 'action=edit&cartID=' + cartID + '&num=' + val off.show(); } ); } function cartDel(cartID) { if (!confirm('确认删除?')) { return false; } location.href = sysinfo.link + 'user/cart/?action=delete&cartID=' + cartID; return true; } //询盘 function userEnquiry(proID,proName) { off.src = sysinfo.link + 'user/enquiry/'; off.param = 'proID=' + proID + '&proName=' +encodeURIComponent(proName) off.show(); } //结算 function cartOrder() { off.src = sysinfo.link + 'user/cart/'; off.param = 'action=cartOrder' off.show(); } //function getCartCount() //{ // $.ajax({url:'ajax/get_cartcount.asp',type:'get',success:function(data){$('#cartCount').html(data);}}); //} function load_webbar(id) { $.ajax( { url: sysinfo.link + 'ajax/bar/', type: 'get', success: function (data) { $('#pagebar').html(data); } } ); } function countdown(sec_i,lastEvent,objName) { function run() { sec_i--; if(sec_i<1){ if(lastEvent()!='noclose') { top.off.hide(); } }else{ document.getElementById(objName).innerHTML=sec_i; setTimeout(run,1000); } } setTimeout(run,1000); } function piczoom() { $(function(){ //$("img.jqzoom").jqueryzoom(); $("img.jqzoom").jqueryzoom({ xzoom: 300, //zooming div default width(default width value is 200) yzoom: 300, //zooming div default width(default height value is 200) offset: 40, //zooming div default offset(default offset value is 10) position: "right" //zooming div position(default position value is "right") }); }); } //function ajax_action(jso) //{ // var ptext='ptext'; //// if(jso.flushName) // { // ptext=jso.flushName; // } //// var t=$(this); // jso.param.r=Math.random(); // $.ajax({ // url:jso.url, // type:jso.type, // data:jso.param, // success:function(data){ // $('#'+ptext).html(data); // }, // error:function(data){ // alert('error:'+data.responseText); // } // }); //} //function loadevent(jso) //{ // if(typeof(jso.click)=="undefined") // click='click'; // else // click=jso.click; //// $('a[t='+jso.param.actionAjax+'],input[t='+jso.param.actionAjax+']')[click](function(){ // var t=$(this); //// if(typeof(jso.event)!='undefined') // { // if(!jso.event(jso,t))//执行验证 // { // return;// } // } //// var url=jso.url; //// jso.param.id=t.attr('tid'); //// ajax_action({url:url,type:jso.type,param:jso.param,flushName:jso.flushName}); // }); //} //function loadclick_cartdel(jso) //{ // loadevent({url:jso.url,type:'post',param:{actionAjax:'del'},event:function(){return confirm('确定删除?\n删除后不可恢复。')}}); //} //function loadchange_cartnum(jso) //{ // loadevent({url:jso.url,click:'change',type:'post',param:{actionAjax:'num'},event:function(j,o){ // var v=o.val().trim(); // if(v.length==0 || isNaN(v)) // { // alert('排序值必须是数字或小数'); // return false; // } // j.param['num']=v; // return true; // }}); //} //---------------------------------------- /*(function(){ y=window._={ get:function(b,c){c=c||document;if(typeof b==="string")b=c.getElementById(b);return b}, init:function(e,b,d){b=b||{};d=d||{};for(var c in d)e[c]=b[c]||b[c]==0?b[c]:d[c]}, scroll:function(o) { o=o||document.documentElement; return {w:o.scrollWidth,h:o.scrollHeight} }, client:function(o) { o=o||document.documentElement; return {w:o.clientWidth,h:o.clientHeight} } }; })(); */ //swf ppt function loadswfppt(jso) { var simg = ''; var stext = ''; var slink = ''; var focus_width = jso.width; var focus_height = jso.height; var text_height = jso.text_height; var swf_height = focus_height + text_height; for (var i in jso.pic) { simg += jso.pic[i].img + '|'; stext += jso.pic[i].text + '|'; slink += jso.pic[i].link + '|'; } simg = simg.trimEnd('[|]'); stext = stext.trimEnd('[|]'); slink = slink.trimEnd('[|]'); var swfparam = 'pics=' + simg + '&links=' + slink + '&texts=' + stext + '&borderwidth=' + focus_width + '&borderheight=' + focus_height + '&textheight=' + text_height; document.write(''); } /*浮动功能*/ var Class = { create: function() { return function() { this.initialize.apply(this, arguments); } } } var Extend = function(destination, source) { for (var property in source) { destination[property] = source[property]; } } //获取页面被卷去部分的宽度、高度 function fnGetDocumentScrollPos() { return {x:top.document.documentElement.scrollLeft||top.document.body.scrollLeft,y:top.document.documentElement.scrollTop||top.document.body.scrollTop} } //类开始 var FloatDivMove=Class.create(); FloatDivMove.prototype= { initialize:function(options) { this.b=true;//hidden() 方法所用 this.setOptions(options) this.width=this.options.width; this.height=this.options.height; //this.rightX=this.options.rightX; this.topY=this.options.topY; this.content=this.options.content; this.speed=this.options.speed; this.inSpeed=this.options.inSpeed; this.slowSpeed=this.options.slowSpeed; this.moveID=this.options.moveID;//'cFloatDivMove'; this.falign=this.options.falign; this.div=top.document.getElementById(this.moveID)||top.document.createElement("div"); this.set(); }, //设置默认属性 setOptions: function(options) { this.options = { width:0,//宽度 height:0,//高度 //rightX:50,//距离右边的距离 topY:180,//距离上边的距离 content:"",//div里面的内容 //以下参数一般采用默认 speed:1,//速度 slowSpeed:80,//放慢的速度 inSpeed:15,//内部速度用于被除数 moveID:'cFloatDivMove', falign:'left' }; Extend(this.options, options || {}); }, set:function() { with(this.div.style) { position="absolute"; display="none" zIndex="10000"; } }, move:function() { if(!this.b) return; var startY,endY,speed; startY=parseInt(this.div.style.top); endY=fnGetDocumentScrollPos().y+this.topY; if(startY!=endY) { var i=Math.ceil(Math.abs(endY-startY)/this.inSpeed ); this.div.style.top=startY+((endY= fixed_height){ $('body').css({'padding-top':$('*[t=nav-fixed]').height()+'px'}) o.addClass("nav-fixed"); }else{ $('body').css({'padding-top':'0px'}) o.removeClass("nav-fixed"); } }) } function toTop(){ $(window).scroll(function() { if($(window).scrollTop() >= 500){ $('.totop').fadeIn(300); }else{ $('.totop').fadeOut(300); } }); $('.totop').click(function(){ $('html,body').animate({scrollTop: '0px'}, 500); }); } /*导航样式跟随*/ function loadNavStyle(){ var navid=sysinfo.navid || ''; $('*[navid='+navid+']').addClass('active'); } /*左右滚动自动化*/ /* function initGD() { var o = $('*[t=gd]'); if (!o) return; var s = (o.attr('gdval') || ''); var v = s.split(',') var main_id = v[0] || 'gd_main'; var next_id = v[1] || 'gd_next'; var prev_id = v[2] || 'gd_prev'; var pm_val = v[3] || 10; var child_tagname = v[4] || 'li'; var auto_val = v[5] || true; o.imageScroller({ next: next_id, prev: prev_id, frame: main_id, pm: pm_val, child: child_tagname, auto: auto_val }); } */ function initGDZ() { var o = $('*[t=gdz]'); if (!o) return; o.each(function (index) { var item = $('*[t=gdz]').eq(index); var s = (item.attr('gdzval') || ''); var v = s.split(',') var main_id = v[0] || 'gdz_main'; var next_id = v[1] || 'gdz_next'; var prev_id = v[2] || 'gdz_prev'; var pm_val = v[3] || 5; var child_tagname = v[4] || 'li'; var auto_val = v[5] || true; item.imageScrollerl({ next: next_id, prev: prev_id, frame: main_id, pm: pm_val, child: child_tagname, auto: auto_val }); }); } function initGD() { var o = $('*[t=gd]'); if (!o) return; o.each(function (index) { var item = $('*[t=gd]').eq(index); var s = (item.attr('gdval') || ''); var v = s.split(',') var main_id = v[0] || 'gd_main'; var next_id = v[1] || 'gd_next'; var prev_id = v[2] || 'gd_prev'; var pm_val = v[3] || 10; var child_tagname = v[4] || 'li'; var auto_val = v[5] || true; item.imageScroller({ next: next_id, prev: prev_id, frame: main_id, pm: pm_val, child: child_tagname, auto: auto_val }); }); } $(function(){ navFixed(); $('*[t=clearimg]').each(function(i,item){ $(item).html($(item).html().replace(/]*>/g,'')); }) toTop(); loadNavStyle(); initGD(); }); //首图轮播Start $(function(){ // var remote_ip_info = Object; //首屏大图轮播 var picnum=0; var picnums=$(".indexFocusConPic ul li").length picnum=picnums-1 var isin=0; var timerScroll; var clicknum=0; autoChange(); startScroll(); var callback1 var result1=1 callback1=function(obj){ result1=1 } $(".indexFocusConUp").click(function(){ if(result1==1){ result1=0 clearScroll(); picnum--; if(picnum==-1){picnum=picnums-1} $(".indexFocusConPic ul li").each(function(){$(this).css('position', 'relative').fadeOut("slow")}) $(".indexFocusConPic ul li").eq(picnum).css('position', 'relative').fadeIn("slow",callback1); startScroll(); } }) $(".indexFocusConDown").click(function(){ if(result1==1){ result1=0 clearScroll(); picnum++; if(picnum==picnums){picnum=0} $(".indexFocusConPic ul li").each(function(){$(this).css('position', 'relative').fadeOut("slow")}) $(".indexFocusConPic ul li").eq(picnum).css('position', 'relative').fadeIn("slow",callback1); startScroll(); } }) function startScroll(){ timerScroll = setInterval(autoChange,5000); } function autoChange(){//背景图播放函数 picnum++; if(picnum==picnums){picnum=0} $(".indexFocusConPic ul li").each(function(){$(this).css('position', 'relative').fadeOut("slow")}) $(".indexFocusConPic ul li").eq(picnum).css('position', 'relative').fadeIn("slow"); //$(".indexFocusPic ul li").eq(picnum).animate({opacity:1},500).css({flter:"Alpha(Opacity=100)"}); } function clearScroll(){ clearInterval(timerScroll); } $(".indexFocusConPic img").each(function(){ if($(this).attr("url")!=""){ $(this).css("cursor","pointer"); } }) }); //首图轮播end /*banner图片切换*/ var timer = null; var offset = 2500; var index = -1; //大图交替轮换 function slideImage(i){ var id = 'image_'+ target[i]; $('#'+ id) .animate({opacity: 1}, 800, function(){ $(this).find('.word').animate({height: 'show'}, 'slow'); }).show() .siblings(':visible') .find('.word').animate({height: 'hide'},'fast',function(){ $(this).parent().animate({opacity: 0}, 800).hide(); }); } //bind thumb a function hookThumb(){ $('#thumbs li a') .bind('click', function(){ if (timer) { clearTimeout(timer); } var id = this.id; index = getIndex(id.substr(6)); rechange(index); slideImage(index); timer = window.setTimeout(auto, offset); this.blur(); return false; }); } //bind next/prev img function hookBtn(){ $('#thumbs li img').filter('#play_prev,#play_next') .bind('click', function(){ if (timer){ clearTimeout(timer); } var id = this.id; if (id == 'play_prev') { index--; if (index < 0) index = 3; }else{ index++; if (index > 3) index = 0; } rechange(index); slideImage(index); timer = window.setTimeout(auto, offset); }); } //get index function getIndex(v){ for(var i=0; i < target.length; i++){ if (target[i] == v) return i; } } function rechange(loop){ var id = 'thumb_'+ target[loop]; $('#thumbs li a.current').removeClass('current'); $('#'+ id).addClass('current'); } function auto(){ index++; if (index > 3){ index = 0; } rechange(index); slideImage(index); timer = window.setTimeout(auto, offset); } $(function(){ try{ //change opacity $('div.word').css({opacity: 0.85}); auto(); hookThumb(); hookBtn(); }catch(e){} }); /*图片纵向滚动 可点击左右滚动*/ jQuery.fn.imageScrollerl = function(params){ var p = params || { next:"buttonNext", prev:"buttonPrev", frame:"viewerFramel", height:100, pm:10, child:"a", auto:true }; var _btnNext = $("#"+ p.next); var _btnPrev = $("#"+ p.prev); var _imgFrame = $("#"+ p.frame); var _height = p.height; var _child = p.child; var _auto = p.auto; var _itv; _height=_imgFrame.find(_child+":first").height()+p.pm; var turnTop = function(){ _btnPrev.unbind("click",turnTop); if(_auto) autoStop(); _imgFrame.animate( {marginTop:-_height}, 'slow', '', function(){ _imgFrame.find(_child+":first").appendTo( _imgFrame ); _imgFrame.css("marginTop",0); _btnPrev.bind("click",turnTop); if(_auto) autoPlay(); }); }; var turnDown = function(){ _btnNext.unbind("click",turnDown); if(_auto) autoStop(); _imgFrame.find(_child+":last").clone().show().prependTo( _imgFrame ); _imgFrame.css("marginTop",-_height); _imgFrame.animate( {marginTop:0}, 'slow' ,'', function(){ _imgFrame.find(_child+":last").remove(); _btnNext.bind("click",turnDown); if(_auto) autoPlay(); }); }; _btnNext.css("cursor","pointer").click( turnDown ); _btnPrev.css("cursor","pointer").click( turnTop ); var autoPlay = function(){ _itv = window.setInterval(turnTop, 5000); }; var autoStop = function(){ window.clearInterval(_itv); }; if(_auto) autoPlay(); };