$(document).ready(function(){
	
	$.fn.wait = function(time, type) {
        time = time || 1000;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };

	$(".iframe").fancybox({
		'width'				: '75%',
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
	$("a[rel=group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'none'
	});
	
	//$(".box_open").fancybox({});
	
	$(".box_open").fancybox({
		'titleShow'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'autoDimensions'	: true
	});

	$('.rez_izb li').click(function(){
		var b = $('.current').attr('title');
		$('.current').removeClass('current');
		$(this).addClass('current');
		var a = $(this).attr('title');
		
		$('#'+b).attr('style','display:none;');
		$('#'+a).fadeIn(); //attr('style','display:block;');
		//$(this).addClass('current');
	});
	
});


function load_video(id)
{
	var vid = '<object width="500" height="403"><param name="movie" value="http://www.youtube.com/p/'+id+'?hl=hr_HR&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/'+id+'?hl=hr_HR&fs=1" type="application/x-shockwave-flash" width="500" height="403" allowscriptaccess="always" allowfullscreen="true"></embed></object>';
	$('#video_holder').html(vid);
}
