// $Id: getcontent.js 200 2011-08-27 11:42:01Z jon $
/*
 * js to retrieve content HTML and inser in page 
 * 
 */

$(document).ready(function() {
	$.ajax({
		type: 'GET',
		url: '/admin/build/js_facebook_html',
		dataType: 'html',
		success: function(html,textStatus){
			// append HTML from server
			$('.facebookwrapper').append(html);
			
			// Setup to open FB in a new window if facebookcontainer clicked
			// Get previously setup FB url and set onclick
			fb_url=$('.facebookcontainer #more SPAN').html();
			$('.facebookcontainer').css('cursor','pointer');
			$('.facebookcontainer').click(function() {
				window.open(fb_url);
			});
		},
		error: function (xhr, textStatus, errorThrown){
			;
			// debug only - as dont want to see msg if we legitimately navigate
			// away from page before Get has completed
			 alert('error getting fb contents'+ (errorThrown ? errorThrown : xhr.status));
		}
	});
});
