( function ( w , d ) {
var e = function () {
this.header = function () {
var logo = oclass.get( 'logo' )[ 0 ] ,
sections = d.getelementsbytagname( 'section' ) ,
header = d.getelementbyid( 'header' ),
headerbg = d.getelementbyid( 'headerbg' ) ,
aside = d.getelementbyid( 'header' ).getelementsbytagname( 'aside' )[ 0 ] ,
headnav = d.getelementbyid ( 'headnav' ) ,
headnavul = headnav.getelementsbytagname( 'ul' )[ 0 ] ,
headnavn = headnavul.getelementsbytagname( 'nav' ) ,
headnavas = headnav.getelementsbytagname( 'a' ) ,
headerbtn = d.getelementbyid ( 'headerbtn' ) ,
opennav = d.getelementbyid ( 'opennav' ) ,
opennavi = opennav.getelementsbytagname( 'i' )[ 0 ] ,
opennavn = opennav.getelementsbytagname( 'nav' )[ 0 ] ,
opennavdiv = opennav.getelementsbytagname( 'div' )[ 0 ].getelementsbytagname( 'div' )[ 0 ] ;
var headnava = [] , headnavna = [];
var section = [];
for (var i = 0; i < sections.length; i++) if ( sections[i].id != 'header' ) section.push( sections[i] );
for (var i = 0; i < headnavas.length; i++) {
if ( headnavas[ i ].parentnode.tagname == 'li' ) {
headnava.push( headnavas[ i ] );
};
if ( headnavas[ i ].parentnode.tagname == 'nav' ) {
headnavas[ i ].innerhtml = '' + headnavas[ i ].innerhtml + '';
headnavna.push( headnavas[ i ] );
};
};
var len = headnava.length ,
flag = 1 , wh = 1920 * 1.3 , timer , spend = 350 , slidetimer;
opennavn.innerhtml = headnav.innerhtml;
var opennavul = opennav.getelementsbytagname( 'ul' )[ 0 ] ,
opennavli = opennavul.getelementsbytagname( 'li' );
var opennavna = [];
for (var i = 0; i < opennavli.length; i++) {
var chi = opennavli[ i ].children;
for (var j = 0; j < chi.length; j++) if ( chi[ j ].tagname == 'a' ) opennavna.push( chi[ j ] );
};
var timers;
var alllink = header.getelementsbytagname( 'a' );
events.add( w , 'scroll' , function () {
if ( win.st() > 0 ) header.style.csstext = 'box-shadow:0 0 20px 0 rgba(0,0,0,.5);';
else header.style.csstext = '';
} );
headnavul.onmouseenter = function () {
timers = settimeout(function () {
aside.style.height = headnavn[ 0 ].offsetheight + 'px';
aside.style.bordertop = '1px solid #eee';
header.style.background = 'rgba(255,255,255,1)';
headerbg.style.csstext = 'opacity:1;visibility: visible;';
cleartimeout( slidetimer );
slidetimer = settimeout( function () {
for (var i = 0; i < headnavn.length; i++)
headnavn[ i ].style.csstext = 'opacity:1;visibility: visible;';
for (var i = 0; i < headnavna.length; i++)
headnavna[ i ].style.opacity = '1';
for (var i = 0; i < section.length; i++)
section[i].style.filter = 'blur(5px)';
} , 100 );
} , 300);
};
headnavul.onmouseleave = function () {
cleartimeout( slidetimer );
cleartimeout( timers );
for (var i = 0; i < headnavn.length; i++)
headnavn[ i ].style.csstext = 'opacity:0;visibility: hidden;';
for (var i = 0; i < headnavna.length; i++)
headnavna[ i ].style.opacity = '0';
slidetimer = settimeout( function () {
aside.style.csstext = '';header.style.csstext = '';
headerbg.style.csstext = 'opacity:0;visibility: hidden;';
for (var i = 0; i < section.length; i++) {
section[i].style.filter = '';
}
} , 0 );
};
function change () {
opennavn.style.height = win.height() * .8 + 'px';
centerx = win.width() / 2 ;centery = win.height() / 2;
}
change ();
events.add( w , 'resize' , change );
for ( var i = 0 ; i < len ; i++ ) {
opennavna[ i ].index = i;
if ( /act/.test( headnava[ i ].classname ) ) headnava[ i ].parentnode.classname += ' act';
opennavna[ i ].onclick = function ( e ) {
if ( this.index == 0 ) return;
e = e || w.event;e.preventdefault();
};
opennavli[ i ].onmouseleave = function () {
for ( var i = 0 ; i < opennavli.length ; i++ ) opennavli[ i ].classname = '';
};
opennavli[ i ].onclick = function () {
this.onmouseleave();
this.classname = 'act';
};
};
for (var i = 0; i < alllink.length; i++) {
alllink[ i ].onclick = function () {
if ( /cust/.test( this.getattribute( 'href' ) ) || /tech/.test( this.getattribute( 'href' ) ) ) w.location.reload();
};
};
events.add( w , 'load' , function () {
for ( var i = 0 ; i < len ; i++ )
if ( /act/.test( headnava[ i ].classname ) )
headnava[ i ].parentnode.classname += ' act';
} );
var basic = {
start : function ( e ) {
e = e || w.event;headerbtn.classname = 'act';oclass.add( logo , 'act' );
opennavul.scrolltop = 0;
css( d.body , { 'overflow' : 'hidden' } );
css( opennavi , { 'width' : wh + 'px' ,'height' : wh + 'px' ,'visibility': 'visible' } );
css( opennav , { 'visibility': 'visible' } );
timer = settimeout(function () {
css( opennavn , { 'opacity' : 1 ,'visibility': 'visible' } );
css( opennavdiv , { 'opacity' : 1 ,'visibility': 'visible' } );
} , spend);
} ,
clock : function () {
css( d.body );
headerbtn.classname = '';oclass.remove( logo ,'act' );
css( opennavn , { 'opacity' : 0 ,'visibility': 'hidden' } );
css( opennavdiv , { 'opacity' : 0 ,'visibility': 'hidden' } );
timer = settimeout(function () {
css( opennavi );
css( opennav , { 'visibility': 'hidden' } );
} , spend);
},
clear : function () {
cleartimeout( timer );
}
}
headerbtn.onclick = function () {
basic.clear();
flag++ % 2 ? basic.start() : basic.clock();
};
if ( !d.getelementbyid( 'banner' ) ) header.classname += ' act';
}();
this.footer = function () {
var footer = d.getelementbyid( 'footer' ) ,
footerhe = footer.getelementsbytagname( 'header' )[ 0 ] ,
footernav = d.getelementbyid( 'footernav' ).getelementsbytagname( 'a' );
for ( var i = 0 , len = footernav.length ; i < len ; i++ ) {
var txt = footernav[ i ].innertext;
footernav[ i ].innerhtml = '';
for ( var j = 0 ; j < txt.length ; j++ )
footernav[ i ].innerhtml += '' + txt[ j ] + '';
};
var aside = d.getelementbyid( 'aside' ) ,
asidei = aside.getelementsbytagname( 'i' )[ 0 ] ,
asidea = aside.getelementsbytagname( 'a' ) ,
len = asidea.length;
var dir ;
asidei.onclick = function () {
if ( this.classname == '' ) {
this.classname = 'act';
for ( var i = 0 ; i < len ; i++ ) {
if ( i == 5 || i == 6 ) dir = i - 1;
else dir = i;
css( asidea[ i ] , {
'top' : -75 * (len - dir) + 'px',
'transform' : 'scale(1)'
} );
};
} else {
this.classname = '';
for ( var i = 0 ; i < len ; i++ ) {
css( asidea[ i ] );
};
}
};
events.add( d , 'click' , function ( e ) {
e = e || w.event;
if ( e.target != asidei ) {
asidei.classname = '';
for ( var j = 0 ; j < len ; j++ ) {
css( asidea[ j ] );
};
};
} );
if ( d.getelementbyid( 'banner' ) ) {
return;
} else {
footer.classname += ' act';footerhe.classname += ' act';
};
}();
this.backtop = function () {
var backtop = d.getelementbyid( 'backtop' ) ,
timer;
function ani () {
var st = win.st();
if ( st <= 10 ) {
clearinterval( timer );
w.scrollto( 0 , 0 );
};
w.scrollto( 0 , st-st/35 );
};
backtop.onclick = function () {
clearinterval( timer );
timer = setinterval(ani , 1000 / 60);
};
if (d.addeventlistener) {
d.addeventlistener('dommousescroll', function () {
clearinterval( timer );
}, false);
}
w.onmousewheel = d.onmousewheel = function () {
clearinterval( timer );
};
events.add( w , 'touchmove' , function () {
clearinterval( timer );
} );
}();
};
e();
} ( window , document ) );