// JavaScript Document
//lśćąę

var DebugQueryMode=false; //Show Alerts


$('.jhover').hover(
  function () {
	$(this).animate({ opacity: 0.75 }, 200 );
  }, 
  function () {
	$(this).animate({ opacity: 1 }, 200 );
  }
);

$('.gallery a img').hover(
  function () {
	$(this).animate({ opacity: 0.75 }, 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); }}
}

function jMinHeight(Name, Height){
	try{
		if(!Name || Name=='' || Name.length<2){ return false; }
		if(!Height || Height=='' || Height<=0){ return false; }
		
		switch(Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Name='#'+Name;
		}
		
		var elements=$(Name);
		var c_height;
		
		for(var i=0; i<elements.length;i++){
			//c_height=parseInt($(Name).eq(i).css('height'));
			c_height=parseInt($(Name).eq(i).height()); //IE6 Path;
			if(c_height<Height){ $(Name).eq(i).css('height',Height); }
		}
		return true;
	}catch(err){ if(jDebugMode==true){ alert('jMinHeight: ' + err); }}
}