
$(document).ready(function() { 
		var Tam = TamVentana();
    var right = (((Tam[0]-1000)/2)-10);
    if (Tam[0]>=1025){ $('#navigation').css("right",right); } else{ $('#navigation').css("right",-(1025-Tam[0])); }

    /* Navegador */
    $('#content div.principal').mouseenter(function(){
				var nombre = this.id; 
				$('#navigation').find('.active').removeClass("active");
				$('#navigation ul li a[name='+nombre+']').addClass("active");
				var top = fn_top(nombre);
				$('.scroll').css({ 'top':top });
		});
		
		$('#etc').mouseenter(function(){
				$('#navigation').find('.active').removeClass("active");
				$('#navigation ul li a[name=etc]').addClass("active");
				$('.scroll').css({ 'top':274 });
		});
		$('#navigation ul li a').click(function(){
				var nombre = this.name;
				$('#navigation').find('.active').removeClass("active");
				$('#navigation ul li a[name='+nombre+']').addClass("active");
				var top = fn_top(nombre);
				$('.scroll').css({ 'top':top });
		});
}); 

function fn_top(nombre){
	switch(nombre)
	{
		case "welcome":
			scrolltop = 110;break;
		case "discounts":
			scrolltop = 137;break;
		case "samples":
			scrolltop = 163;break;
		case "events":
			scrolltop = 191;break;
		case "about":
			scrolltop = 219;break;
		case "contact":
			scrolltop = 245;break;
		case "etc":
			scrolltop = 274;break;
	}
	return scrolltop;
}


function TamVentana() {
  var Tamanyo = [0, 0];
  if (typeof window.innerWidth != 'undefined'){
    Tamanyo = [ window.innerWidth, window.innerHeight ];
  }else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0){
		Tamanyo = [  document.documentElement.clientWidth, document.documentElement.clientHeight ];
  }else{
    Tamanyo = [ document.getElementsByTagName('body')[0].clientWidth, document.getElementsByTagName('body')[0].clientHeight ];
  }
  return Tamanyo;
}
window.onresize = function() { var Tam = TamVentana(); var right = (((Tam[0]-1000)/2)-10); 
if (Tam[0]>=1025){ $('#navigation').css("right",right); } else{ $('#navigation').css("right",-(1025-Tam[0])); }
};  

