/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

(function() {
	"use strict";
            window.canUse=function(p){if(!window._canUse)window._canUse=document.createElement("div");var e=window._canUse.style,up=p.charAt(0).toUpperCase()+p.slice(1);return p in e||"Moz"+up in e||"Webkit"+up in e||"O"+up in e||"ms"+up in e};
                !function(){function t(t){this.el=t;for(var n=t.className.replace(/^\s+|\s+$/g,"").split(/\s+/),i=0;i<n.length;i++)e.call(this,n[i])}function n(t,n,i){Object.defineProperty?Object.defineProperty(t,n,{get:i}):t.__defineGetter__(n,i)}if(!("undefined"==typeof window.Element||"classList"in document.documentElement)){var i=Array.prototype,e=i.push,s=i.splice,o=i.join;t.prototype={add:function(t){this.contains(t)||(e.call(this,t),this.el.className=this.toString())},contains:function(t){return-1!=this.el.className.indexOf(t)},item:function(t){return this[t]||null},remove:function(t){if(this.contains(t)){for(var n=0;n<this.length&&this[n]!=t;n++);s.call(this,n,1),this.el.className=this.toString()}},toString:function(){return o.call(this," ")},toggle:function(t){return this.contains(t)?this.remove(t):this.add(t),this.contains(t)}},window.DOMTokenList=t,n(Element.prototype,"classList",function(){return new t(this)})}}();
                var	$body = document.querySelector('body');
		if ('addEventListener' in window) {
			$body.classList.add('is-loading');
			window.addEventListener('load', function() {
				$body.classList.remove('is-loading');
			});
		}
		if (navigator.userAgent.match(/(MSIE|rv:11\.0)/))
			$body.classList.add('is-ie');
                    //images transition
		(function() {
				var settings = {
                                    delay: 4000
				};
				var $banner = document.querySelector('#banner'),
					$images = document.querySelectorAll('#banner li'),
					pos = 0, lastPos = 0;
				$images[pos].classList.add('visible');
				$images[pos].classList.add('top');
					if ($images.length == 1)
						return;
				window.setInterval(function() {

					lastPos = pos;
					pos++;
						if (pos >= $images.length)
							pos = 0;
						$images[lastPos].classList.remove('top');
						$images[pos].classList.add('visible');
						$images[pos].classList.add('top');
						window.setTimeout(function() {
							$images[lastPos].classList.remove('visible');
						}, settings.delay / 2);
				}, settings.delay);
		})();
})();
