// JavaScript Document


function dnvNewsletterOpen(){
	var email = $('form#NewsLetterForm input').val();
	$("<iframe id=\"dnvNewsletter\" src=\"http://" + window.location.hostname + "/newsletter?" + email + "\" width=\"850\" height=\"600\" scrolling=\"no\" ></iframe>").dialog({ 
							modal: true,
							width:850,
							height:600,
							title: 'Newsletter',
							open: onOpenDialog,
							close: onCloseDialog,
							draggable: false
							});
	
	function onOpenDialog(event,ui){		
		$(event.target).css('width',825);
		//$(event.target).html('preload');	
		$('iframe#youtube').css('visibility','hidden');	
	}
	function onCloseDialog(event,ui){		
		$('iframe#youtube').css('visibility','visible');	
	}

	return false;
}

function hoptoCommentsDialogClose(){
	$('#dnvNewsletter').dialog('close');
}



function dnvPublikacjaOpen(){
$("<iframe id=\"dnvPublikacja\" src=\"http://" + window.location.hostname + "/newsletter\" width=\"850\" height=\"600\" scrolling=\"no\" ></iframe>").dialog({ 
							modal: true,
							width:800,
							height:550,
							title: 'Pobierz darmową publikację',
							open: onOpenDialog,
							close: onCloseDialog,
							draggable: false
							});
	
	function onOpenDialog(event,ui){		
		$(event.target).css('width',800);
		// $(event.target).html('preload');	
		$('iframe#youtube').css('visibility','hidden');	
	}
	function onCloseDialog(event,ui){		
		$('iframe#youtube').css('visibility','visible');	
	}

	return false;
}

