function openPopup(addr)
{
	var option = 'width=100,height=100';
	var w = window.open( addr, 'dcwindow', option );
	return false;
}

function hideNewsletter()
{
	doc = $('#main');
	n_window = $('#n_window');
	doc.animate( { opacity: 1.0 } );
	n_window.slideUp('fast');
	return false;
}

function newsletterAdd()
{
	doc = $('#main');
	n_window = $('#n_window');
	doc.animate( { opacity: 0.3 } );
	
	n_window.load( 'newsletter.php?email='+$('#subskrypcja').attr('value'), function(){
	n_window.append( '<hr/><a style="display:block;float:right;" id="closelink" href="#">zamknij</a>' );
	
	$('#closelink').click( function(){
	hideNewsletter();
	return false;
	}
	);
	
	n_window.slideDown('fast');
	} );
	return false;
}
var last = '';
function hl(x)
{
	if( last )
	{
		last.className = 'item';
	}

	x.className = 'sel';
	last = x;
	
}
function switchColor(x) 
{

	if( x.className == 'item' || x.className == 'sel' )
	{
		if( x.className != 'sel' )
		{
			x.className = 'hl';
		}
	}
	else
	{
		if( x.className != 'red' )
		{
			x.className = 'item';
		}
	}

}

function kod_popup(nazwisko,kod)
{
 var option = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=0,width=300,height=350"; 
window.open('status.php?c='+kod.value+'&n='+nazwisko.value,'dcstatus',option);
} 

function _(el)
{
	return document.getElementById( el );
}
