
jQuery(document).ready(function($) {
	bgBox = document.getElementById("allproductsLayer");
	bgBox.innerHTML = ''
	bg2Box = document.getElementById("topwrapperBox");
	bg2Box.innerHTML = ''
	refBox = document.getElementById("contentBox");
	refBox.setAttribute("rel","facebox");
	jQuery.facebox(refBox);
	
	$(document).unbind('close.facebox');
	$(document).unbind('keydown.facebox');
/*	$(document).bind('close.facebox', function() {
		javascript:history.back();
	});*/
	if($('.tx-felogin-pi1 form').length == 0 || $('#tx_felogin_pi1\\[forgot_email\\]').length == 1) {
		$(document).bind('close.facebox', function() {
			window.location.href = 'physicians-login/?pageId=89';
		});
	} else {
		$(document).bind('close.facebox', function() {
			window.location.href = 'home';
		});
	}
	$(document).bind('keyup.facebox', function(e) {
		if (e.keyCode == 27) $(document).trigger('close.facebox')
	});
}) 

