function SiteFunctions()
{
	var displaysitepopup_current = '';
	this.displaySitePopup = function(e, whch, xadj, yadj)
	{
		var xadj = xadj == null ? 0 : Number(xadj);
		var yadj = yadj == null ? 0 : Number(yadj);
		if(displaysitepopup_current != '')
		{
			$('#' + displaysitepopup_current).css({'visibility':'hidden'});
		}
		if(displaysitepopup_current == whch)
		{
			displaysitepopup_current = '';
			return;
		}
		displaysitepopup_current = whch;
		e = e ? e : window.event;
		e = jQuery.event.fix(e);
		if($('#' + whch).parent().get(0).tagName.toLowerCase() != 'body')
		{
			var d = $('#' + whch).detach();
			d.appendTo('body');
		}
		// Make sure we're all on the page!
		var pageWidth = $(window).width();
		var pageHeight = $(window).height();
		var elemWidth = $('#' + whch).width();
		var elemHeight = $('#' + whch).height();
		var showX = e.pageX;
		var showY = e.pageY;
		showX = showX + elemWidth + xadj > pageWidth - 50 ? showX - ((showX + elemWidth) - pageWidth) - 50 : showX + xadj;
		showY = showY + elemHeight + yadj > pageHeight + $(document).scrollTop() - 20 ? pageHeight + $(document).scrollTop() - elemHeight - 20 : showY + yadj;
		if(showX < 0) showX = 0;
		if(showY < 0) showY = 0;
		$('#' + whch).css({'height':elemHeight+'px','width':elemWidth+'px','display':'none','top':showY+'px','left':showX+'px','visibility':'visible'});
		$('#' + whch).slideDown('fast');
	}

	this.displaySiteShade = function()
	{
		$('#page_shade').css({'height':$(document).height(),'width':$(window).width()});
		$('#page_shade').fadeIn('fast',function(){
			var pnh = $('#page_notice').height();
			var pnw = $('#page_notice').width();
			var wh = $(window).height();
			var ww = $(window).width();
			var pny = ((wh - pnh) / 2) + $(window).scrollTop();
			var pnx = ((ww - pnw) / 2);
			$('#page_notice').css({'visibility':'visible','left':pnx,'top':pny});
			$('page_shade_bg').fadeIn('slow');});
	}
	this.hideSiteShade = function()
	{
		$('#page_shade').fadeOut('fast',function(){$('#page_notice').css({'visibility':'hidden'});$('page_shade_bg').fadeOut('slow');});
	}

}
