// JavaScript Document
//lśćąę

var DebugQueryMode=false; //Show Alerts


$('.jhover').hover(
  function () {
	$(this).animate({ opacity: 0.7 }, 200 );
  }, 
  function () {
	$(this).animate({ opacity: 1 }, 200 );
  }
);


function jItemHoverAnimation(Name, Duration){
	try{
		if(!Name || Name=='' || Name.length<2){ return false; }
		if(!Duration || Duration==''){ Duration=300; }
		
		switch(Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Name='#'+Name;
		}
		
		$(Name+' img').css('opacity',0);
		$(Name+' img').css('visibility','visible');
		
		$(Name).hover(function(){
			$(this).find('img').eq(0).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		},function(){
			$(this).find('img').eq(0).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		});
		
	}catch(err){ if(jDebugMode==true){ alert('jItemHoverAnimation: ' + err); }}
}
