$(function(){

	$("a.fancybox").fancybox();
	$("a.podswietlenie_zdjecia").fancybox();

	$("#nav > li").each(
	   function(i) {
	  	  	var position = $(this).offset();
	        var h=$(this).find('ul').height();
	        var p=position.top-h-5;
	      	//$(this).find('ul').css('top',p+'px');
       }
    );

    $("#nav > li").hover(
	      function () {
	        $(this).css('background','#E5E5E5');
	        $(this).closest('a').css('color','#0881a5');
	        $(this).find('ul').css('visibility','visible');
	      }, 
	      
	      function () {
	        $(this).css('background','#FFF');
	        $(this).closest('a').css('color','#363535');
	        $(this).find('ul').css('visibility','hidden');
	      }
    );
    
    
    $('.flvplayer').each(
	   function(i) {
	   		
	   		flv=$(this).attr('href');
	   		flv_w=$(this).find('img').width();
	   		flv_h=$(this).find('img').height();
			flashMovieWithVars = $.flash.create(
				{
		 	       swf: 'library/flowplayer/flowplayer-3.2.2.swf', 
		 	       width: flv_w,   
		 	       height: flv_h,
		 	       wmode: 'transparent',
		 	       flashvars: {
					  config: "{'clip': '"+flv+"' }}"
				   }
				}
			);
			$(this).replaceWith(flashMovieWithVars);
       }
    );

});

function Blank(href)
{
	window.open(href,'_blank');
	return false;
}

function parseId(mixedId,key)
{
    var arrId = mixedId.split('_');
    if(arrId.length<(key+1)) {
    	return 0;
    }
    return parseInt(arrId[key],10);
}

function isIE7()
{
	if (jQuery.browser.msie) {
  		if (parseInt(jQuery.browser.version)==7)
  		{
  			return true;
  		}
	}
		
	return false;
}
