function openpopup( popupName ) {
	
	var popup = null;
	var width=500;
	var height=560;		
	var theURL='';
	var winName='';
	var topY=(screen.height-height)/2;
	var leftX=(screen.width-width)/2;		
						
	if(popupName == 'regulamin serwisu') {
		theURL='reg/index2.html';
		winName='regulamin';
	} else if(popupName == 'polityka_prywatnosci' ) {
		theURL='popups/polityka.html';
		winName='polityka_prywatnosci';
	} else if(popupName == 'regulamin konkursu' ) {
		theURL='reg/index.html';
		winName='nota_prawna';
	} else if( popupName == 'lista zwyciezcow' ) {
		theURL='popups/lista_zwyciezcow.html';
		winName='lista_zwyciezcow';
	} else if( popupName == 'jury' ) {
		theURL='jury/index.html';
		winName='Jury';
		width = 700;
	}
	
	var features='innerWidth=' + width+',innerHeight='+height+',width=' + width+',height='+height+',top='+topY+',left='+leftX+',resizable=0,scrollbars=1,toolbar=no,status=no,location=no';
	
	/* else if( popupName =='regulamin_uslug' ) {
		theURL='html/popups/regulamin_uslug.html';
		winName='regulamin_uslug';
	} else if( popupName =='regulamin_tajemniczy_klient' ) {
		theURL='html/popups/regulamin_tajemniczy_klient.html';
		winName='regulamin_tajemniczy_klient';
	}
	
	else if( popupName =='picture' ) {
		theURL='html/popups/picture.html?file=' + arguments[1];
		winName='picture';
		width=200;
		height=100;
		topY=(screen.height-height)/2;
		leftX=(screen.width-width)/2;				
		features='innerWidth=' + width+',innerHeight='+height+',width=' + width+',height='+height+',top='+topY+',left='+leftX+',resizable=0,scrollbars=0,toolbar=no,status=no,location=no';			
	}
	*/
	if( !winName || !theURL ) {
		alert( 'Not defined: ' + popupName );
		return;
	}	
	
	popup = window.open(theURL,winName,features);	

	if ( popup && !popup.closed ) {
		popup.focus();
	}
}

function trackNovem( src )
{
	var newdiv = document.createElement('div');
  	newdiv.setAttribute('id', 'stats');
  	newdiv.innerHTML = '<img src="' + src + '" />';
  	document.getElementById('wrapperAll').appendChild(newdiv);
 	
}

