////////// FireFox Ad Start ////////////

// This function does the actual browser detection
function writeCookie(name, value, hours)
{
	var expire = "";
	if(hours != null)
	{
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + escape(value) + expire;
}

// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
	var cookieValue = "";
	var search = name + "=";
	if(document.cookie.length > 0)
	{
		offset = document.cookie.indexOf(search);
		if (offset != -1)
		{
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
			if (end == -1) end = document.cookie.length;
			cookieValue = unescape(document.cookie.substring(offset, end))
		}
	}
	return cookieValue;
}



function hasIE_hasIE() {
  var ua = navigator.userAgent.toLowerCase();
  return ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && 
          (ua.indexOf('webtv') == -1) &&
          (location.href.indexOf('seenIEPage') == -1));
}

function hasIE_showLayer(whichLayer)
{
  if (document.getElementById)
    {
      var style2 = document.getElementById(whichLayer).style;
      style2.display = "block";
    }
  else if (document.all)
    {
      var style2 = document.all[whichLayer].style;
      style2.display = "block";
    }
  else if (document.layers)
    {
      var style2 = document.layers[whichLayer].style;
      style2.display = "block";
    }
}

// Hides and shows sections of the page based on whether or not it's
// running in IE
function hasIE_hideAndShow()
{
  if (hasIE_hasIE())
  {
    hasIE_showLayer("hasIE_level1");  
  }
  else{}
}

function hasIE_ContinueWithoutFF() {
    if (location.href.indexOf('?') != -1)
        location.href += '&seenIEPage=1';
    else
        location.href += '?seenIEPage=1';
}
function closediv(i) {
	writeCookie("status","showed24",240);
	document.getElementById(i).style.display='none'; 
}

document.write("<div id=\"hasIE_level1\" style=\"background:#FFFFBB; text-align: center; padding:2px 0 3px; display:none; border-bottom:1px solid #ffd532;position:absolute; top:0; left:0; width:100%; z-index:100\"><div id=\"iewarning\" style=\"width:19px; float:left;\"><img align=\"absmiddle\" src=\"http://www.tiexue.net/images/warning.gif\" border=\"0\" /></div><div id=\"closeimg\" style=\"width:19px; float:right;\"><a href=\"javascript:closediv('hasIE_level1');\" title=\"关闭提示\"><img src=\"http://www.tiexue.net/images/close1.gif\" align=\"absmiddle\" border=\"0\" /></a></div><div style=\" margin-top:4px;marign-left:4px;font-size:12px;color:#092E20\">发现您正在使用老掉牙的IE浏览器，强烈推荐您在 Windows 操作系统中使用最安全的浏览器: <a href=\"http://www.tiexue.net/firefox/\" title=\"FireFox火狐浏览器2.0下载\" target=\"_blank\"><font color=\"#ee0000\">FireFox火狐浏览器2.0,点击下载</a></font> ！</div></div><div style=\"clear:both\"></div>");  
if(document.referrer.indexOf("tiexue")==-1 && document.referrer.indexOf("v-war")==-1)
{
	if(readCookie("status") != "showed24")
	{
		hasIE_hideAndShow();
	}
}

////////// FireFox Ad End   ////////////
//下拉菜单相关代码 start
document.write("<div id='menuDiv' style='Z-INDEX: 200; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR:#FFFFFF;'></div>");

 var h;
 var w;
 var l;
 var t;
 var topMar = 1;
 var leftMar = -5;
 var space = 1;
 var isvisible;
 var MENU_SHADOW_COLOR='#999999';//定义下拉菜单阴影色
 //var MENU_SHADOW_COLOR='#ffffcc';
 var global = window.document
 global.fo_currentMenu = null
 global.fo_shadows = new Array
 
function TxBBS_HideMenu()
{
 	var mX;
 	var mY;
 	var vDiv;
 	var mDiv;
	if (isvisible == true)
	{
		vDiv = document.getElementById("menuDiv");
		//alert(vDiv.style);
		mX = window.event.clientX + document.body.scrollLeft;
		mY = window.event.clientY + document.body.scrollTop;
		if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight))
		{
			vDiv.style.visibility = "hidden";
			isvisible = false;
		}
	}
}
function TxBBS_ShowMenu(vHtmls,tWidth) 
{
	var menuDiv = document.getElementById("menuDiv");
	vSrc = window.event.srcElement;
	vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='width:"+tWidth+"' style='background-color: #dd0000;' onmouseout='TxBBS_HideMenu()'><tr height=23><td nowrap style='background-color: #FFFFFF;padding-left:6px;padding-right:4px;' valign=top >" + vHtmls + "</td></tr></table>";

	h = vSrc.offsetHeight;
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar+4;
	t = vSrc.offsetTop + topMar + h + space-2;
	vParent = vSrc.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")
	{
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}
	menuDiv.innerHTML = vMnuCode;
	menuDiv.style.top = t;
	menuDiv.style.left = l;
	menuDiv.style.visibility = "visible";
	isvisible = true;
    makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4)
}
function makeRectangularDropShadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style
		rs.position = 'absolute';
		rs.left = (el.style.posLeft + i) + 'px';
		rs.top = (el.style.posTop + i) + 'px';
		rs.width = el.offsetWidth + 'px';
		rs.height = el.offsetHeight + 'px';
		rs.zIndex = el.style.zIndex - i;
		rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
		el.insertAdjacentElement('afterEnd', rect);
		global.fo_shadows[global.fo_shadows.length] = rect;
	}
}

//常量定义

//论坛导航栏
vForumNav = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px #CDB38B solid;font-size:12px;border-collapse:collapse;\">  <tr class=\"bbs_nav0\">      <td class=\"bbs_navtd0\"><a href=\"main.html\" target=\"_top\" class=\"bbs_ghost12l\">铁血论坛</a></td>      <td class=\"bbs_navtd1\"> <a href=\"gbbs_6.html\" target=\"_top\" class=\"bbs_lghost12l\">军事大区</a>         <a href=\"gbbs_5.html\" target=\"_top\" class=\"bbs_lghost12l\">社会大区</a> <a href=\"gbbs_8.html\" target=\"_top\" class=\"bbs_lghost12l\">历史大区</a> <a href=\"gbbs_2.html\" target=\"_top\" class=\"bbs_lghost12l\">贴图大区</a>         <a href=\"gbbs_9.html\" target=\"_top\" class=\"bbs_lghost12l\">休闲大区</a> <a href=\"gbbs_4.html\" target=\"_top\" class=\"bbs_lghost12l\">小说大区</a></td>  </tr>  <tr class=\"bbs_nav1\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_6.html\" target=\"_top\" class=\"bbs_ghost12l\">铁血军事</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_31.html\" target=\"_top\" class=\"bbs_lghost12l\">海军论坛</a> <a href=\"bbs_32.html\" target=\"_top\" class=\"bbs_red12l\">陆军论坛</a>         <a href=\"bbs_69.html\" target=\"_top\" class=\"bbs_lghost12l\">空军论坛</a> <a href=\"bbs_79.html\" target=\"_top\" class=\"bbs_lghost12l\">军品交流</a> <a href=\"bbs_171.html\" target=\"_top\" class=\"bbs_lghost12l\">尖端科技</a></td>  </tr>  <tr class=\"bbs_nav0\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_2.html\" target=\"_top\" class=\"bbs_ghost12l\">天天帖图</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_125.html\" target=\"_top\" class=\"bbs_red12l\">社会贴图</a> <a href=\"bbs_10.html\" target=\"_top\" class=\"bbs_lghost12l\">快乐休闲</a> <a href=\"bbs_66.html\" target=\"_top\" class=\"bbs_lghost12l\">历史贴图</a> <a href=\"bbs_67.html\" target=\"_top\" class=\"bbs_lghost12l\">美女图区</a>         <a href=\"bbs_13.html\" target=\"_top\" class=\"bbs_lghost12l\">风景艺术</a> <a href=\"bbs_119.html\" target=\"_top\" class=\"bbs_red12l\">原创图区</a></td>  </tr>  <tr class=\"bbs_nav1\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_8.html\" target=\"_top\" class=\"bbs_ghost12l\">历史风云</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_73.html\" target=\"_top\" class=\"bbs_red12l\">中国历史</a> <a href=\"bbs_74.html\" target=\"_top\" class=\"bbs_lghost12l\">世界历史</a> <a href=\"bbs_172.html\" target=\"_top\" class=\"bbs_lghost12l\">一二战史</a></td>  </tr>   <tr class=\"bbs_nav0\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_5.html\" target=\"_top\" class=\"bbs_ghost12l\">社会万象</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_33.html\" target=\"_top\" class=\"bbs_red12l\">环球风云</a> <a href=\"bbs_68.html\" target=\"_top\" class=\"bbs_red12l\">生活客栈</a> <a href=\"bbs_114.html\" target=\"_top\" class=\"bbs_lghost12l\">职场校园</a> <a href=\"bbs_95.html\" target=\"_top\" class=\"bbs_lghost12l\">中国文化</a></td>  </tr>  <tr class=\"bbs_nav1\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_9.html\" target=\"_top\" class=\"bbs_ghost12l\">休闲娱乐</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_80.html\" target=\"_top\" class=\"bbs_lghost12l\">搞笑幽默</a>         <a href=\"bbs_78.html\" target=\"_top\" class=\"bbs_lghost12l\">体育天地</a> <a href=\"bbs_76.html\" target=\"_top\" class=\"bbs_red12l\">士兵Club</a>  <a href=\"bbs_140.html\" target=\"_top\" class=\"bbs_lghost12l\" style='color:#009900'>体育竞猜</a> <a href=\"bbs_141.html\" target=\"_top\" class=\"bbs_lghost12l\" style='color:#0000FF'>铁血赛马</a> <a href=\"bbs_149.html\" target=\"_top\" class=\"bbs_red12l\" style='color:#009900'>夺宝奇兵</a></td>  </tr>   <tr class=\"bbs_nav0\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_11.html\" target=\"_top\" class=\"bbs_ghost12l\">电影电视</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_124.html\" target=\"_top\" class=\"bbs_red12l\">影音评论</a> <a href=\"bbs_173.html\" target=\"_top\" class=\"bbs_lghost12l\">娱乐八卦</a> <a href=\"bbs_75.html\" target=\"_top\" class=\"bbs_lghost12l\">M O 共享</a> <a href=\"bbs_121.html\" target=\"_top\" class=\"bbs_lghost12l\">迅雷共享</a> <a href=\"bbs_122.html\" target=\"_top\" class=\"bbs_lghost12l\">铁血战争</a> <a href=\"bbs_123.html\" target=\"_blank\" class=\"bbs_lghost12l\" style='color:#008800'>求片区</a> </td>  </tr>  <tr class=\"bbs_nav1\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_4.html\" target=\"_top\" class=\"bbs_ghost12l\">铁血小说</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_24.html\" target=\"_top\" class=\"bbs_red12l\">小说发布</a> <a href=\"bbs_186.html\" target=\"_top\" class=\"bbs_lghost12l\">古代文学</a>         <a href=\"bbs_166.html\" target=\"_top\" class=\"bbs_lghost12l\">现代诗歌</a> <a href=\"bbs_142.html\" target=\"_top\" class=\"bbs_lghost12l\">作者沙龙</a> <a href=\"bbs_27.html\" target=\"_top\" class=\"bbs_lghost12l\">小说讨论</a>         <a href=\"bbs_28.html\" target=\"_top\" class=\"bbs_lghost12l\">读书根据</a></td></tr><tr class=\"bbs_nav0\">      <td class=\"bbs_navtd0\"><a href=\"gbbs_16.html\" target=\"_top\" class=\"bbs_ghost12l\">两性论坛</a></td>      <td class=\"bbs_navtd1\"><a href=\"bbs_153.html\" target=\"_top\" class=\"bbs_lghost12l\">两性空间</a> <a href=\"bbs_159.html\" target=\"_top\" class=\"bbs_red12l\">两性人生</a> <a href=\"bbs_159.html\" target=\"_top\" class=\"bbs_lghost12l\">手机自拍</a></td></tr><tr class=\"bbs_nav1\"><td class=\"bbs_navtd0\"></td><td class=\"bbs_navtd1\"><a href=\"bbs_71.html\" target=\"_top\" class=\"bbs_red12l\" style='color:#008800'>铁血杂谈</a> <a href=\"bbs_135.html\" target=\"_top\" class=\"bbs_lghost12l\">游戏杂烩</a> <a href=\"bbs_152.html\" target=\"_top\" class=\"bbs_red12l\">百姓看车</a> <a href=\"bbs_71.html\" target=\"_top\" class=\"bbs_lghost12l\">香车美女</a> <a href=\"bbs_155.html\" target=\"_top\" class=\"bbs_lghost12l\">国货自强</a> <a href=\"bbs_175.html\" target=\"_top\" class=\"bbs_red12l\">贴视频吧</a></td></tr></table>";

//收藏铁血
function SaveTiexueNet()
{
	if(document.all){
		window.external.AddFavorite('http://bbs.tiexue.net','铁血社区 - 军事 历史 社会 贴图 万人在线大型社区');
	}
}

//论坛顶部导航栏2
function shownav()
{
	document.write("<div style='width:100%;margin-bottom:2px;' align=center><div style='BACKGROUND-COLOR: #fff3be;height:8px;width:97%;border:1px solid #CDB38B;margin-top:6px;padding:6px 12px 4px 12px;text-align:left;line-height:150%;'><a href='#'>陆军论坛</a> <a href='#'>空军论坛</a><br><a href='#'>陆军论坛</a> <a href='#'>空军论坛</a></div></div>");
}

//论坛顶部导航栏
function showheader()
{
var userid = BaseCookie.TxBBS_CurrentUserID();
var username = BaseCookie.TxBBS_CurrentUserName();
var m_temp;
var m_backurl= document.URL;
document.writeln("<table height=\"23\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" border=\"0\">");
document.writeln("<tbody>");
document.writeln("<tr>");
document.writeln("<td bgcolor=\"#9e0000\" height=\"23\" style='padding-top:3px'>");
document.writeln("<TABLE width=\"100%\" height=\"54%\" border=0 cellPadding=0 cellSpacing=0 ID=\"Table1\">");
document.writeln("		<TR>");
document.writeln("			<TD width=169 height=\"13\" style=\"PADDING-LEFT: 6px\">&nbsp;<img src='http://bbs.tiexue.net/images/v2.2/logo.gif' width=\"155\" height=\"16\"><\/TD>");
document.writeln("			<TD nowrap align=\"right\">");
document.writeln("				<div align=\"left\">&nbsp;<A class=bbs_white12l href=\"javascript:SaveTiexueNet();\">收藏铁血<\/A>");
document.writeln("				    <A class=bbs_white12l href=\"#\" onclick=\"this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http:\/\/www.tiexue.net\/\');\">设为首页<\/A>");
document.writeln("		        <\/div><\/TD>");
document.writeln("			<TD class=\"bbs_white12\" nowrap>");
document.writeln("				<div align=\"right\"><A class=bbs_white12l href=\"http:\/\/bbs.tiexue.net\/\" target=\"_top\">社区首页<\/A> | ");
document.writeln("				  <!--<A class=bbs_white12l href=\"AddPost.aspx\" target=_blank>发新帖<\/A> -->");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/reg.tiexue.net\/register.aspx\" target=_blank>注册<\/A> ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/reg.tiexue.net\/login.aspx\" target=_blank>登录<\/A> ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/help.tiexue.net\/faq\/xinshou_faq.htm\" target=_blank>新手指南<\/A> | ");
document.writeln("				  <!--<A class=bbs_white12l href=\"#\" target=_blank>道具<\/A>-->");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/group.tiexue.net\/Friends\/FriendsList.aspx\" target=_blank>好友<\/A> ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/group.tiexue.net\/\" target=_blank>公社<\/A> ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/msg.tiexue.net\/\" target=_blank>短信<\/A> ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/game.tiexue.net\/\" target=_blank>游戏<\/A> ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/market.tiexue.net\/\" target=_blank>市场<\/A> | ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/reg.tiexue.net\/Info.aspx\" target=_blank> 个人管理<\/A> ");
document.writeln("				  <A class=bbs_white12l href=\"http:\/\/help.tiexue.net\/\" target=_blank>帮助<\/A>");
document.writeln("			    <\/div><\/TD>");
document.writeln("			   <td width=20><\/td>");
document.writeln("		<\/TR>");
document.writeln("		<\/TABLE>")
document.writeln("<\/td>");
document.writeln("<\/tr>");
document.writeln("<\/tbody>");
document.writeln("<\/table>")
}

//绑定方法
document.attachEvent("onmouseout",TxBBS_HideMenu);