

$(document).ready(function() {
  assignWindowEvents();
}); 

function assignWindowEvents() {
  $("a.xLink").click(function (e) {
     e.stopPropagation();
     e.preventDefault();
     recordOutboundLink(this, 'Outbound Links',$(this).attr('href'));	
     window.open($(this).attr("href"),'newWindow');
     return false;
  });
  $("a.xPopup").click(function () {
     this.newWindow = window.open($(this).attr("href"),'popup','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=760');
     this.newWindow.focus();
     this.newWindow.opener = window;
     return false;
  });
  $("a.overlay").click(function(){
	var iFrameSrc = $(this).attr('href');
	var iFrameWidth = $(document).height() - 65;
	$('<div id="overlay" class="wide"><div id="overlayMask"><!--mask--></div><div id="viewWindow"><span class="closeBtn"><a href="#" class="close"><img src="/media/images/close-overlay_61.jpg" alt="Close" /></a></span><iframe id="overlayIframe" scrolling="yes" width="940" height="'+iFrameWidth+'" src="'+iFrameSrc+'" ></iframe></div></div>').prependTo('body');
	$('#overlay').fadeIn('fast');
	positionOverlay();
	$('.close').click(function(){$('#overlay').fadeOut('fast').html(' ');return false;});
	$('#overlayMask').click(function(){$('#overlay').fadeOut('fast').html(' ');return false;});
	return false;
  });
}


