$(function() {
	$('.softDl .ddBtn')
		.mouseover(function(){
			link = location.href.replace(/-file-(.+)\.html/i, ".html" );
			link = link.replace(".html", "-" + $('.softDl .ddMask ul li.selected').attr('id') + '.html');
			window.status = link;		
		})
		.mouseout(function(){
			window.status = '';
		})
		.click(function(){
			link = location.href.replace(/-file-(.+)\.html/i, ".html" );
			link = link.replace(".html", "-" + $('.softDl .ddMask ul li.selected').attr('id') + '.html');
			window.location = link;
		});
		
	$('.softDl .ddMask ul li a').mouseover(function(){
			$(this).removeAttr('href');
		});	
		
	$('.softDl .ddMask img')
		.mouseover(function(){
			$(this).stop().fadeTo(100, 0.5);	
		})
		.mouseout(function(){
			$(this).stop().fadeTo(100, 1);	
		})

	$('.softDl .ddMask img.dlD')
		.click(function(){
				wsk = $('.softDl .ddMask ul li.selected');
			if(wsk.next().html() != null){
				wsk.fadeOut(100, function(){
					wsk.removeClass('selected');
					wsk.next().fadeIn().addClass('selected');
				});
			}
		
		});
	$('.softDl .ddMask img.dlU')
		.click(function(){
				wsk = $('.softDl .ddMask ul li.selected');
			if(wsk.prev().html() != null){
				wsk.fadeOut(100, function(){
					wsk.removeClass('selected');
					wsk.prev().fadeIn().addClass('selected');
				});
			}
		
		});
		
	$('.screen a')
		.mouseover(function(){
			$(this).stop().fadeTo(150, 0.8);
		})
		
		.mouseout(function(){
			$(this).stop().fadeTo(150, 1);
		})
		
		.lightBox({
			fixedNavigation:false
		});
		
});
	//var urll = ;
	setInterval('updateTimer()', 1000);
	var linkacz;
function updateTimer(){
		ile = document.getElementById('timer').innerHTML;
	
	if(ile != 0)
		document.getElementById('timer').innerHTML --;
	if(ile == 3)
		document.getElementById('dlLink').href = linkacz;
	if(ile == 10){
		linkacz = document.getElementById('dlLink').href;
		document.getElementById('dlLink').href = '#';
	}
		
}
