( function ( w , d ) { var index = { banner : function () { var banner = $( '#banner' ) , bannerul = $( '#banner ul' ) , bannerli = $( '#banner li' ) , len = bannerli.length; var span = d.createelement( 'span' ) , em = []; var timer , spend = 3000 , ani = 450 , inter = 1; banner[ 0 ].appendchild( span ); var basic = { hover : function () { cleartimeout( timer ); timer = settimeout(basic.ani , spend); } , ani : function () { inter %= len; bannerul.animate({ 'left' : inter * -100 + '%' } , ani); for ( var i = 0 ; i < len ; i++ ) em[ i ].classname = ''; em[ inter++ ].classname = 'act';basic.hover(); } }; basic.hover(); for ( var i = 0 ; i < len ; i++ ) { em[ i ] = d.createelement( 'em' );em[ i ].index = i; span.appendchild( em[ i ] ); em[ i ].onclick = function () { inter = this.index;basic.ani(); } }; span.style.height = (em[ 0 ].offsetheight + (em[ 0 ].offsetheight - 4)) * (len) + 'px'; em[ 0 ].classname = 'act'; }() , adv : function () { var minadvnav = d.getelementbyid ( 'minadvnav' ).getelementsbytagname( 'a' ) , minadvmain = d.getelementbyid( 'minadvmain' ) , minadvmainpic = minadvmain.getelementsbytagname( 'figcaption' )[ 0 ].getelementsbytagname( 'img' ) , minadvmainmain = minadvmain.getelementsbytagname( 'div' )[ 0 ] , len = minadvnav.length; var timer , timers , interval = 1 , spend = 3000 , ainterval = 0; var h3 = d.createelement( 'h3' ) , p = d.createelement( 'p' ) , a = d.createelement( 'a' ); minadvmainmain.appendchild( h3 );minadvmainmain.appendchild( p );minadvmainmain.appendchild( a ); h3.innerhtml = minadvnav[ 0 ].getattribute( 'l-h' );p.innerhtml = minadvnav[ 0 ].getattribute( 'l-txt' );a.innerhtml = '查看案例'; a.setattribute( 'href' , minadvnav[ 0 ].getattribute( 'l-href' ) ); for( var j = 0 ; j < len ; j++ ) minadvnav[ j ].classname = '';minadvnav[ 0 ].classname = 'act';minadvnav[ 0 ].entered = true; var basic = { pre : function () { for ( var i = 0 ; i < len ; i++ ) new image().src = "img/list" + ( i + 1 ) + ".jpg"; }, left: (325/1920) * 100 , right:1195/ 1920 * 100 }; basic.pre(); function change () { var width = win.width(); if ( width > 1150 ) { basic.left = (325/1920) * 100 ; } else if ( width <= 1150 && width > 660 ) { basic.left = (400/1920) * 100 ; } else { basic.left = 10 ; }; if ( width <= 1295 ) { basic.right = basic.left; } else { basic.right = 1195/ 1920 * 100; }; }; change (); events.add( w , 'resize' , change ); for ( var i = 0 ; i < len ; i++ ) { minadvnav[ i ].index = i; minadvnav[ i ].onmouseenter = function () { var _this = this; cleartimeout( timer );cleartimeout( timers ); timers = settimeout(function () { interval = _this.index;ainterval = _this.index; if ( _this.entered ) return; for( var j = 0 ; j < len ; j++ ) { minadvnav[ j ].classname = '';minadvnav[ j ].entered = false; }; _this.classname = 'act';_this.entered = true; switch ( _this.index ) { case 0 : css( minadvmainmain , { 'left' : basic.left + '%' } );css( a );break; case 1 : css( minadvmainmain , { 'left' : basic.left + '%' } );css( a );break; case 2 : css( minadvmainmain , { 'left' : basic.right + '%' } );css( a );break; case 3 : css( minadvmainmain , { 'left' : basic.right + '%' } ); css( a , { 'display':'none' } ); break; }; if ( _this.index == 0 || _this.index == 3 ) { css( h3 , { 'color' : '#333333' } );css( p , { 'color' : '#333333' } ); css( a , { 'color' : '#434343' , 'border' : '1px solid #333333' } ); } else { css( h3 );css( p );css( a ); }; h3.innerhtml = _this.getattribute( 'l-h' );p.innerhtml = _this.getattribute( 'l-txt' );a.innerhtml = '查看案例'; a.setattribute( 'href' , _this.getattribute( 'l-href' ) ); for ( j = _this.index + 1 ; j < len ; j++ ) minadvmainpic[ j ].style.csstext = 'opacity:0;left:260px'; minadvmainpic[ _this.index ].style.csstext = 'opacity:1;left:0'; } , 160); }; if ( i == 0 || i == 3 ) { css( h3 , { 'color' : '#333333' } );css( p , { 'color' : '#333333' } ); css( a , { 'color' : '#434343' , 'border' : '1px solid #333333' } ); } else { css( h3 );css( p );css( a ); }; }; a.onmouseenter = function () { cleartimeout( timer ); switch (ainterval) { case 0 : css( this , { 'color' : '#fff' , 'background' : '#333' } );break; case 1 : css( this , { 'color' : '#333' , 'background' : '#fff' } );break; case 2 : css( this , { 'color' : '#333' , 'background' : '#fff' } );break; case 3 : css( this , { 'color' : '#fff' , 'background' : '#333' } );break; }; }; a.onmouseleave = function () { cleartimeout( timer ); switch (ainterval) { case 0 : css( this , { 'color' : '#434343' , 'background' : '' } );break; case 1 : css( this , { 'color' : '#fff' , 'background' : '' } );break; case 2 : css( this , { 'color' : '#fff' , 'background' : '' } );break; case 3 : css( this , { 'color' : '#434343' , 'background' : '' } );break; }; minadvnav[ interval ].onmouseleave(); }; }() , naws : function () { var news = d.getelementbyid( 'news' ).getelementsbytagname( 'nav' )[ 0 ]; var newsa = d.getelementbyid( 'news' ).getelementsbytagname( 'nav' )[ 0 ].getelementsbytagname( 'a' ) , newsi = d.getelementbyid( 'news' ).getelementsbytagname( 'nav' )[ 0 ].getelementsbytagname( 'i' )[ 0 ] , newswillshow = d.getelementbyid( 'newswillshow' ).getelementsbytagname( 'a' ), newstxtmain = d.getelementbyid( 'newstxtmain' ).getelementsbytagname( 'div' ), newsmore = d.getelementbyid ( 'newsmore' ), len = newsa.length; var newsadata = [] ; var willshow = d.getelementbyid( 'newswillshow' ) , a = willshow.getelementsbytagname( 'a' ) , span = willshow.getelementsbytagname( 'span' ) , strong = willshow.getelementsbytagname( 'strong' ), p = willshow.getelementsbytagname( 'p' ), em = willshow.getelementsbytagname( 'em' ) , wlen = a.length; var basic = { setdata : function ( i ) { var img = newswillshow[ i ].getelementsbytagname( 'img' ) , p = newswillshow[ i ].getelementsbytagname( 'p' )[ 0 ] ; newsadata[ i ] = { img : [] , p : [] }; for ( var j = 0 ; j < len ; j++ ) { newsadata[ i ].img[ j ] = img[ j ].offsetheight; newsadata[ i ].p[ j ] = p.getelementsbytagname( 'div' )[ j ].offsetheight; }; } , todo :function ( index ) { index = index || 0; for ( var i = 0 ; i < wlen ; i++ ) { a[ i ].href = newstxtmain[ index ].getelementsbytagname( 'a' )[ i ].href; basic.ani( span[ i ] , basic.cal.call( span[ i ] , i , index , 'img' ) , index ); basic.ani( strong[ i ] , basic.cal.call( strong[ i ] , i , index ) ); basic.ani( p[ i ] , basic.cal.call( p[ i ] , i , index , 'p' ) , index ); basic.ani( em[ i ] , basic.cal.call( em[ i ] , i , index ) ); }; } , cal : function ( i , index , el ) { if ( !el ) return this.offsetheight * index; if ( index == 0 ) return 0; else return this.childnodes[ index - 1 ].offsetheight + basic.cal.call( this , i , index - 1 , el ); } , enter : function () { var left = this.getboundingclientrect().left; newsi.style.left = left + 'px'; newsmore.href = this.href; for ( var i = 0 ; i < len ; i++ ) newsa[ i ].classname = ''; this.classname = 'act'; basic.todo( this.index ); } , init : function () { for ( var i = 0 ; i < len ; i++ ) basic.setmain( newstxtmain[ i ] ); var lens = newswillshow.length; for ( var i = 0 ; i < lens ; i++ ) { newswillshow[ i ].setattribute( 'href' , newstxtmain[ 0 ].getelementsbytagname( 'a' )[ i ].href ); basic.reset(); }; } , setmain : function ( el ) { var a = el.getelementsbytagname( 'a' ) , len = a.length; for ( var i = 0 ; i < len ; i++ ) { var span = newswillshow[ i ].getelementsbytagname( 'span' )[ 0 ] , strong = newswillshow[ i ].getelementsbytagname( 'strong' )[ 0 ] , p = newswillshow[ i ].getelementsbytagname( 'p' )[ 0 ] , em = newswillshow[ i ].getelementsbytagname( 'em' )[ 0 ]; span.innerhtml += a[ i ].getelementsbytagname( 'span' )[ 0 ].innerhtml; strong.innerhtml += '