//************** Open Center Window Function
 function openCenteredWindow(url, height, width, name, parms) {
	if (height <= 1) { height = Math.floor(screen.height * height); }
	if (width <= 1) { width = Math.floor(screen.width * width); }
	var left = Math.floor( (screen.width - width) / 2);
	var top = Math.floor( (screen.height - height) / 2);
	var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
	if (parms) { winParms += "," + parms; }
	var win = window.open(url, name, winParms);
	
	if (win == null) {
		return null;
	}
	
	return win;
 }
//************** End Open Center Window Function

	
$(function() {
	$.nyroModalSettings({
		width: 750,
		height: 710,
		minHeight: 350
	});
	
	$('#nyroModalFacebook').click(function(e) {
		$.nyroModalSettings({
			endShowContent: function(elts, settings) {
				var iframes = document.getElementsByTagName("iframe");
				
				for (var i = 0; i < iframes.length; i++) {
					if (iframes[i].name == "fbfanIFrame_0") {
						iframes[i].style.display = "";
						iframes[i].style.width = "310px";
						iframes[i].style.height = "300px";
					}
				}
			},
			width: 500,
			minHeight: 450
		});			
		
	});
	
	$('#nyroModalTwitter').click(function(e) {
		$.nyroModalSettings({
			endShowContent: function(elts, settings) {
									
				getTwitters('tweets', { 
					  id: 'bankers_jobs', 
					  count: 3, 
					  enableLinks: true, 
					  ignoreReplies: true, 
					  clearContents: true,
					  newwindow: true,
					  template: '"%text%" <a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a>'
				});	
			},
			width: 500
		});			
	});
	
	$('#nyroModalLinkedIn').click(function(e) {
		$.nyroModalSettings({
			width: 500
		});			
	});
});