$.ui.dialog.defaults.bgiframe = true;
var emailAddress;
var url;
$(function () {
	$('#newsletter_dialog').css({'z-index' : '19999'});
	$('#newsletter_dialog').dialog({
		draggable: true,
		autoOpen: false,
		width: 500,
		buttons: {
			'Cancel' : function() {
				$(this).dialog('close');
			}			
		},
		open: function() {
			$('#newsletter_dialog').load("newsletter.php");
		}
	});
	
	
	$('#tell_friend_dialog').css({'z-index' : '10000'});
	$('#tell_friend_dialog').dialog({
		autoOpen: false,
		width: 430,
		buttons: {
			'Cancel' : function() {
				$(this).dialog('close');
			},
			'Send' : function() {
				submitForm();
			}
		},
		open: function() {
			$('#tell_friend_dialog').load('tell2.php');
		}
	});

	$('#go').click(function() {
		emailAddress = document.getElementById('ea').value;
		$('#newsletter_dialog').dialog('open');
	});

});

function getAddress() {
	return emailAddress;
}

function getUrl() {
	return url;
}

function openFriendDialog(_url) {
	url = _url;
	
	//document.getElementById("web_link").value = url;
	$('#tell_friend_dialog').dialog('open');
}
