/*************************************************************
 * Top Text Bar
 * created by Michel Komarov (iCoder.com)
 *
 * Permanent link:
 * http://askmichel.icoder.com/2008/07/12/top-text-bar/
 *
 * Have a question?
 * http://askmichel.icoder.com
 *
 * `i Code to help you profit`
 *  http://www.icoder.com
 *************************************************************/

document.write("<style type='text/css'>\n.topBar_Cover { position:absolute; top:0px; left:0px; width:100%; font: normal 13px sans-serif; }\ndiv > div.topBar_Cover { position:fixed; }\n#topBar_Content { position:absolute; top:0;left:0; z-index:9; line-height:22px; padding:1px 2em 1px 2em; border-bottom: 1px solid silver; width:100%; background:lightyellow; }\n#topBar_CloseTab { position:absolute; top:0;right:0; z-index:10; line-height:22px; padding:1px 1em 1px 2em; border-bottom: 1px solid silver; }\n</style>\n<!--[if gte IE 5.5]><![if lt IE 8]><style type='text/css'>\ndiv#topBar_CoverIE { width:expression(((topBar_w=(document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth))<200?200:topBar_w)+'px'); position:absolute; top:expression((topBar_t=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+'px'); left:expression((topBar_l=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)+'px'); }\n</style><![endif]><![endif]-->\n");
function winOnLoad(fn) {
  if (window.attachEvent) window.attachEvent("onload", fn); else
  if (window.addEventListener) window.addEventListener("load", fn, false);
}
function topBar_Create() {
	var content = document.getElementById("topBar_Content");
	if (content) {
		var cover = document.createElement("div");
		cover.id = "topBar_MainCover";
		cover.style.display = 'none';
		var coverIE = document.createElement("div");
		coverIE.id = "topBar_CoverIE";
		coverIE.className = "topBar_Cover";
		var close = document.createElement("div");
		close.id = "topBar_CloseTab";
		var closeLink = document.createElement("a");
		closeLink.href = "javascript://";
		closeLink.onclick = function(){topBar_Show('none'); return false;}
		closeLink.appendChild(document.createTextNode("close"));
		close.appendChild(closeLink);
		coverIE.appendChild(content);
		coverIE.appendChild(close);
		cover.appendChild(coverIE);
		document.body.appendChild(cover);
	}
}
function topBar_Show(display) {
	var cover = document.getElementById('topBar_MainCover');
	if (cover) cover.style.display = ('none'==display? 'none': 'block');
	else setTimeout("topBar_Show("+('none'==display? "'none'": "'block'")+")", 100);
}
winOnLoad(topBar_Create);
