// ALERT
var alerting=0;

function alert_function(alert_var){
if(typeof(alert_var)!= "undefined" && alerting!=1 ) {
alerting=1;
$('html, body').animate({scrollTop:0}, 'slow');
$("#alertMessage").html(alert_var);
$("#alert").show();
$("#alert").mooSlideDown();
window.setTimeout(removeAlert_function, 5000, true); 
}}

function removeAlert_function(){
$("#alert").mooSlideUp();
alerting=0;
}




// LOADING

var loading=0;

function attachLoading(){ 
loading=1;
if($('body').height()<$(window).height()){
loadingHeight=$(window).height();
}else{loadingHeight=$('body').height();}

//alert($('body').height());

//$('#loading_container').css({"height": loadingHeight });

$('#loading_container').css({"height": "4000px" });
if ( typeof(alertInterval) != "undefined") {
clearInterval(alertInterval);}
$("#alert").hide();
alerting=0;
}

function removeLoading(){
loading=0;
$('#loading_container').css({"height":"0px"});
}
