/**
 * @author Alexander Farkas
 * v. 1.02
 */
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);
$(function(){
	$('#menu li a').hover(
	function() {
	$(this).find('span.off').stop().animate({"marginTop": "-27"}, "fast");
	$(this).find('span.on').effect( "bounce", 
          {times:3}, 300 );
	},
	function() {
	$(this).find('span.off').stop().animate({"marginTop": "0"}, "fast");
	$(this).find('span.off').effect( "bounce", 
          {times:3}, 300 );
	});
/*$('#menu li.item1 a').css( {backgroundPosition: "0 0"} )
		.mouseover(function(){
			
			$(this).stop().animate({backgroundPosition:"(0 -27px)"}, {duration:500})
		})
		.mouseout(function(){
			$(this).stop().animate({backgroundPosition:"(0 0)"}, {duration:500})
		})
	
		
$('#menu li.item2 a').css( {backgroundPosition: "-159px 0"} )
		.mouseover(function(){

		$(this).stop().animate(
			{backgroundPosition:"(-159px -27px)"}, 
			{duration:200})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(-159px 0)"}, 
			{duration:200})
		})
$('#menu li.item3 a').css( {backgroundPosition: "-318px 0"} )
		.mouseover(function(){

		$(this).stop().animate(
			{backgroundPosition:"(-318px -27px)"}, 
			{duration:200})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(-318px 0)"}, 
			{duration:200})
		})
$('#menu li.item4 a').css( {backgroundPosition: "-477px 0"} )
		.mouseover(function(){

		$(this).stop().animate(
			{backgroundPosition:"(-477px -27px)"}, 
			{duration:200})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(-477px 0)"}, 
			{duration:200})
		})
$('#menu li.item5 a').css( {backgroundPosition: "-636px 0"} )
		.mouseover(function(){

		$(this).stop().animate(
			{backgroundPosition:"(-636px -27px)"}, 
			{duration:200})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(-636px 0)"}, 
			{duration:200})
		})*/
});
$('#menu li a').effect("bounce", { times:5 }, 300);
$('#typePromo li').mouseover(function(){
	$(this).find('.ball').fadeIn('slow');
	}).mouseleave(function(){
		$(this).find('.ball').fadeOut('slow');
		});
/*************SWF ******************/
var flashvars = {};
var params = {wmode:"transparent"};
var attributes = {};
swfobject.embedSWF("contactenos.swf", "contactFlash", "150", "80", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-home.swf", "bannerPromos", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-upload.swf", "bannerUpload", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-portafolio.swf", "bannerPorta", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-cotice.swf", "bannerCotice", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-litografia.swf", "bannerLitografia", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-diseno-web.swf", "bannerDisenoWeb", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-diseno.swf", "bannerDiseno", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-impresion-digital.swf", "bannerImpresionDigital", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
swfobject.embedSWF("header-impresion-digital-peq.swf", "bannerImpresionDigitalPeq", "806", "252", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
 
 /*MENU*/
 $('ul li:has(ul)').hover(
		function(e)
		{
			$(this).find('ul').fadeIn("slow");
		},
		function(e)
		{
			$(this).find('ul').fadeOut("slow");
		}
	);
