// cufon podmiana
Cufon.replace('.smoothmenua');
Cufon.replace('#infolinks ul li a');
Cufon.replace('.title1');
Cufon.replace('.title2');
Cufon.replace('.title3');
Cufon.replace('.title4');
Cufon.replace('.title5');
Cufon.replace('.opisscena1');
Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('h5');

// link zewnetrzny XHTML
onload = function(){
   for(var i = 0; i < document.links.length; i++){
      if (document.links[i].rel == 'external'){
         document.links[i].target = '_blank';
      }
   }
}

jQuery(document).ready(function() {
								
		$("#various1").fancybox({
			'titlePosition'		: 'inside',
			'transitionIn'		: 'none',
			'transitionOut'		: 'none'
		});
		$(".various1").fancybox({
			'titlePosition'		: 'inside',
			'transitionIn'		: 'none',
			'transitionOut'		: 'none'
		});		
		$(".wozkikolory").fancybox();
		$("#various5").fancybox({	
			'padding'			: 0,					
			'autoScale'     	: 'true',
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});

	$(".video").click(function() {
		$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 675,
			'height'		: 405,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});

		return false;
	});



});




/* **************** */


/*** 
    Simple jQuery Slideshow Script
    Released by Jon Raasch (jonraasch.com) under FreeBSD license: free to use or modify, not responsible for anything, etc.  Please link out to me if you like it :)
***/

function slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});


/* **************** */


function openInNewWindow(element) {
var newWindow = window.open(element.href);
newWindow.focus(); 
}

// na gore strony
function ontop() {
	$('html, body').animate({scrollTop:0}, 500);
	return false;
}

function openFlash360() {
		document.getElementById("showflash360").style.visibility = "visible";
		document.getElementById("showflash360").style.display = "block";			
}
function closeFlash360() {
		document.getElementById("showflash360").style.visibility = "hidden";
		document.getElementById("showflash360").style.display = "none";	
}

// data
DayName = new Array(7)
DayName[0] = "Niedziela "
DayName[1] = "Poniedziałek "
DayName[2] = "Wtorek "
DayName[3] = "Środa "
DayName[4] = "Czwartek "
DayName[5] = "Piątek "
DayName[6] = "Sobota "

MonthName = new Array(12)
MonthName[0] = "Stycznia "
MonthName[1] = "Lutego "
MonthName[2] = "Marca "
MonthName[3] = "kwietnia "
MonthName[4] = "Maja "
MonthName[5] = "Czerwca "
MonthName[6] = "Lipca "
MonthName[7] = "Sierpnia "
MonthName[8] = "Września "
MonthName[9] = "Października "
MonthName[10] = "Listopada "
MonthName[11] = "Grudnia "

function getDateStr(){
var Today = new Date()
var WeekDay = Today.getDay()
var Month = Today.getMonth()
var Day = Today.getDate()
var Year = Today.getFullYear()

if(Year <= 99)
Year += 1900

return DayName[WeekDay] + "" + " " + Day + " " + MonthName[Month] + " " + Year
}
