<!--
// hide all popups
function popup_close(){
	if (document.getElementById('sky_popup_area') != null){
		$('#sky_popup_area').fadeOut(300);
	}
	if (document.getElementById('sky_popup_bg') != null){
		$('#sky_popup_bg').fadeOut(300);
	}
}


// show popup
function popup_show(popup_id){
	if (document.getElementById('sky_popup_bg') != null){
		$("#sky_popup_bg").css({"opacity": "0.7"});
		$("#sky_popup_bg").fadeIn("slow");
	}
	if (document.getElementById(popup_id) != null){
		$("#"+popup_id).fadeIn("slow");
	}
	popup_center(popup_id);
}


//center popup
function popup_center(popup_id){
	if (document.getElementById(popup_id) != null){
		var windowWidth = document.documentElement.clientWidth;
		var popupWidth = $("#"+popup_id).width()+24;
		var windowHeight = document.documentElement.clientHeight;
		var popupHeight = $("#"+popup_id).height();
		var scrollTop = $(window).scrollTop();
		var from_top = scrollTop+(windowHeight/2-popupHeight/2)-50;
		if (from_top < (scrollTop+12)){
			from_top = scrollTop+12;
		}

		$("#"+popup_id).css({
			"position": "absolute",
			"top": from_top,
			"left": windowWidth/2-popupWidth/2
		});
	}	
}


// update popup div with code from url
function popup_show_div(tbodyid,fullurl) {
	$.get(fullurl, function(data) {
		$("#"+tbodyid).html(data);
	});
	popup_show(tbodyid);
}	


function chare_on_facebook(share_url){
		var url = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(share_url);
		newwindow=window.open(url, 'facebook_share', 'height=430, width=625');
		if (window.focus) {newwindow.focus(); }
		return false;
}

//-->
