
/* DEVICE.JS
 ========================================================*/
include('http://www.webyplus.com/js/device.min.js');

/* Funciones activadas cuando se mueve el scroll
 ========================================================*/ 
window.onscroll = function(){
	var scroll = document.documentElement.scrollTop || document.body.scrollTop;
	
	/* Boton Subir */
	/*BotonArriba = document.getElementById('btn-subir');
	
	if(scroll > 210){		
		BotonArriba.style.display='block';
		BotonArriba.classList.add('fadeIn');
	}else{
		BotonArriba.style.display='none';
	}*/
}

/* Listar enlaces NOSEGUIR
 ========================================================*/
/*var bgImagenFixed = document.querySelectorAll('.bg-imagen');
	var countBgImagenFixed = bgImagenFixed.length;
	
	for( i = 0; i <= countBgImagenFixed; i++){
		//alert(bgImagenFixed.item(i).getAttribute('data-img-url'));
		bgImagenFixed.item(i).style.background = 'url('+bgImagenFixed.item(i).getAttribute('data-img-url')+') no-repeat';
		bgImagenFixed.item(i).style.backgroundPosition = 'center 0%';
		bgImagenFixed.item(i).style.backgroundSize = 'cover';
		bgImagenFixed.item(i).style.backgroundAttachment = 'fixed';
	}*/


/* thumb prev imagen de producto
 ========================================================*/
 
	function prev_img_prod( img ){
		var PrevImg = document.querySelector('#prev-img-prod');
			PrevImg.src = img.src;
	}

/* Menu Bar 
 ========================================================*/
var MenuBar = document.getElementById('menu_bar'),
	MenuBarA = 'none',
	Menu = document.querySelector('.menu');
	MenuBar.onclick = function(){
		//ul = document.querySelector('.menu');
		if( MenuBarA == 'none' ){
			Menu.style.display = 'block';
			MenuBarA = 'block';
		}else{
			Menu.style.display = 'none';
			MenuBarA = 'none';
		}
	}

window.onresize = function(){
	if(WinSize('Width') > 768){
		Menu.style.display = 'block';
	}else{
		Menu.style.display = MenuBarA;
	}
}



/*
var arriba;
function subir() {
if (document.body.scrollTop != 0 || document.documentElement.scrollTop != 0) {
window.scrollBy(0, -15);
arriba = setTimeout('subir()', 10);
}
else clearTimeout(arriba);
}
*/