function loadSite() {
	if ($.browser.msie && getCookie("acceptIE")!='true') {
		$("#popup").html("<h2>Browser compability issue</h2>\
		It seems like you're using Internet Explorer! We would like to notify you that the site may have a few small issues when using this web browser.<br/> \
		Your user experience may be bothered, but the site should still perform well. <br/>\
		This site works best in Google Chrome. But is also good in Mozilla Firefox, Safari & more. <br/><br/>\
		Clicking the button below will dismiss this message and will not show up again until you clear your cookies.<br/><br/>\
		<input type='submit' onclick='acceptIE()' value='Okay, I understand!'>");
		centerLoader();
		$("#popup").fadeIn();
	  }
	  
	$('.admin_box').click(function() {
		if($(this).next().is(":hidden")) {
			 $(this).next().slideDown("slow");
		} else {
          $(this).next().slideUp("slow");
		}
	});
 
    $('[rel=tipsy]').tipsy({fade: true, gravity: 'n'});
    
	//Start the slider
    $('#slider').aviaSlider();
	
	$('#menu li').hover(
		function () {
			//show its submenu
			$('ul', this).slideDown(5);

		}, 
		function () {
			//hide its submenu
			$('ul', this).slideUp(5);			
		}
	);
	
	$.preloadImages("images/input_bg_hover.png");

}


    var info = 0; 

	function toggleServerInfo() {

		if (info == 0) {

		$("#serverInfo").slideDown("slow");

		info = 1;

		} else {

			$("#serverInfo").slideUp("slow");

		info = 0;

		}

	}


	

	//Google analytics

	var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-23144289-1']);

  _gaq.push(['_trackPageview']);



  (function() {

    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  })();
  
function hideSlider() {
	$("#slideshow").fadeOut();
	
	$.post("hideslide.php", { hide: "true"});
}

function centerLoader() {

    var scrolledX = self.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft ;
    var scrolledY = document.body.scrollTop || document.documentElement.scrollTop || self.pageYOffset;
	

    var screenWidth =  document.body.clientWidth || document.documentElement.clientWidth  || self.innerWidth;
    var screenHeight = document.body.clientHeight || document.documentElement.clientHeight || self.innerHeight;

    var left = scrolledX + (screenWidth - $("#popup").width())/2;
    var top = scrolledY + (screenHeight - $("#popup").height())/4;
    //centering
    $("#popup").css({
        "position": "absolute",
        "top": top,
        "left": left
    });
	
	
	/* $("#overlay").click(function(){
         $("#popup").fadeOut();
		 $("#overlay").fadeOut();	
	}); */
}

function acceptIE() {
	setCookie("acceptIE","true",365);
	$("#popup").fadeOut();
}

function setCookie(c_name,value,exdays) {
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}

function getCookie(c_name) {
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
  x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
  y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
  x=x.replace(/^\s+|\s+$/g,"");
  if (x==c_name)
    {
    return unescape(y);
    }
  }
}
