// JavaScript Document

function popup(url, b, h) {
   var maxwidth = screen.width-50;
   var maxheight = screen.height-120;
   var scrolling = "no";
   var resizable = "no";
   h+=0;
   if (b > maxwidth)  b = maxwidth;
   if (h > maxheight) { h = maxheight; b+=20; }
   if (navigator.appVersion.search(/AOL/) != -1) { scrolling = 'yes'; b = maxwidth; h = maxheight;}
   var param = "resizable="+ scrolling +",status=no,menubar=no,scrollbars="+ scrolling +",toolbar=no,width="+ b +",height="+ h;
   f = window.open(url,'',param);
   f.moveTo((screen.width-b)/2,(screen.height-h)/2-40);
}


function popup_scroll(url, b, h) {
   var maxwidth = screen.width-50;
   var maxheight = screen.height-120;
   var scrolling = "yes";
   var resizable = "no";
   h+=0;
   if (b > maxwidth)  b = maxwidth;
   if (h > maxheight) { h = maxheight; b+=20; }
   if (navigator.appVersion.search(/AOL/) != -1) { scrolling = 'yes'; b = maxwidth; h = maxheight;}
   var param = "resizable="+ scrolling +",status=no,menubar=no,scrollbars="+ scrolling +",toolbar=no,width="+ b +",height="+ h;
   f = window.open(url,'',param);
   f.moveTo((screen.width-b)/2,(screen.height-h)/2-40);
}

$(document).ready(function() {
	if ('undefined' != typeof shareURL) {
		$.ajax({
			type: 'GET',
			url: '/fileadmin/php/ajax.shareCounts.php',
			data: 'url=' + shareURL,
			dataType: 'json',
			success: function(data) {
				if (data !== null) {
					$('.facebookShareCount').html(data.facebookShareCount);
					$('.tweetCount').html(data.tweetCount);
				}
			}
		});
	}
});
