function refreshBrowser() {
	window.location.reload();
}

function showShare (shareID) {
	showLightbox_bg();
	var shareURL = 'http://www.vfproust.com/share.php?share=' + shareID;
	$.getJSON('getShareBox.php?callback=?',{url:shareURL,title:'Vanity Fair Proust - Shared Item',description:'I would love to share this link to a Vanity Fair Proust Questionnaire response.  <a href="[URL]">Click here to view the response.</a>'}, function (shareData) {
		//console.dir(shareData.services);
		$('#smfshare_box').html('<a href="" class="lightbox_close" alt="Close"></a><div class="decoration"><div class="smfshare_header">Share This Proust Questionnaire Answer...</div><br clear="all"/>');
		for (var i = shareData.services.length - 1; i >= 0; i--){
			$('#smfshare_box div.decoration').append(' ' + shareData.services[i][1] + ' ');
			$('#smfshare_box').fadeIn();
		};
	});
}

function showLightbox_bg() {
	$('#lightbox_bg').css({"display":"block"}).animate({"opacity" : .98});
}

function showLightbox(formName) {
	showLightbox_bg();
	$("#optin").load(formName).fadeIn();
}

function hideLightbox_bg() {
	$("#optin").hide();
	$("#smfshare_box").hide();
	$('#lightbox_bg').animate({'opacity' : 0}, function() {
		$(this).css({"display":"none"});
	});
}

function checkBuickForm(whichForm) {
	
	$.post('postBuick.php',$(whichForm).serialize(), function (data) {
		if (data == '1') {
			alert('Thank you!  Your submission has been received.');
			hideLightbox_bg();
		} else {
			alert('We cannot save your submission - please check all required fields and try again.');
		}
	});
	
	return false;
}