function setOpacity(ele,strength){
	if ((ele.style.MozOpacity))
		ele.style.MozOpacity = strength;
	else if ((ele.filters))
		ele.filters.alpha.opacity = (strength*100);
}


function Loading(elname, message, bg, width){
	
	if(bg){
		var img = '<img src="gfx/ajax-loader_black.gif">';
	} else {
		var img = '<img src="gfx/ajax-loader.gif">';
	}

	if(width){
		var w = width;
	} else {
		var w = '';
	}
	
	if(message)
		var t = '<div class="LoadingWrapper" style="width : ' + w + 'px"><div class="LoadingIMG">' + img + '</div><div class="LoadingMSG">' + message + '</div></div>';
	else
		var t = img;
	
	$("#" + elname).html(t);
}

function CloseSystemMessage(){
	$("#SystemMessage").html("");
	$("#SystemMessage").css("display", "none");

}

function layerHandle(n, d){
	$("#"+n).css("display", d);
}


function AjaxGet(url, data, elname){

	$.ajax({
	  url: url,
	  type: "GET",
	  data: data,
	  cache: false,
	  success: function(html){
	  	
		if(elname != ""){
			$("#"+elname).html(html);
		}
	  }
	});

}

function SystemMessage(msg){
	
	Loading("SystemMessage", "" + msg + "", "black");
	$("#SystemMessage").css("display", "block");

	setTimeout("CloseSystemMessage()", "3000");
}


function ajaxUserMenu (){
	
	$.ajax({
		  url: "ajaxUserMenu.php",
		  type: "GET",
		  cache: false,
		  success: function(html){
		  	if(html != "NEJ")
			    $("#usermenu").html(html);
		  }
	});	
	
	setTimeout("ajaxUserMenu()", "30000");

}

$(window).load(function(){
	
	setTimeout("ajaxUserMenu()", "30000");

});