/* infoBar 1.0
   By: Alex Barberis
   Created on 3.11.2009 */

function showInfoBar(caption){
	hideInfoBar();
	$(document.body).append("<div id=infoBar><table width=100%><tr nowrap id=infoContent><td width=30></td><td align=left onclick='javascript:location.reload(true);' style=\"cursor:pointer;\">" + caption + "</td><td width=60 align=left><div id=infoClose><img src=\"/i/close-toolbar.gif\" /></div></td></tr></table></div>");
	$("#infoClose").click(hideInfoBar);
	$("#infoClose").css("border-color","#ffffff");
	$("#infoClose").css("border","7");
	$("#infoClose").css("cursor","pointer");
	$("#infoBar").hide();
	$("#infoContent").css("font-weight","bold");
	$("#infoContent").css("font-size","12px");
	$("#infoContent").css("color","000");
	$("#infoBar").css("background-color","#f4f4f4");
	$("#infoBar").css("border-bottom","4px solid #000");
	$("#infoBar").css("position","absolute");
    $(window).resize(info_position);
    $(window).scroll(info_position);
	info_position();
	$("#infoBar").slideDown(400); //i like sliding in more than fade in this case. i think it catches the users attention more effectively
	//$("#infoBar").fadeIn(800); //if you like this more remark the previous line

}

function hideInfoBar(){
	$("#infoBar").fadeOut(400)
	$("#infoBar").remove();
}

function info_position() {
	var scrollPosition = $(window).scrollTop();
	$("#infoBar").css("top",scrollPosition +"px");
	$("#infoContent").css("height","45px");
	$("#infoBar").css("left","0px");
	$("#infoBar").css("width",$(window).width());
}
