﻿var value = getCookie("spliter");
var isIE7pre = (getIEVersonNumber() < 7);

if (value == "onleft"){
    document.write("<div id=\"leftdiv\" style=\"display:none;\">");
    document.write("<iframe id=\"leftbar\" src=\"forumlist.aspx\" frameborder=\"0\" scrolling=\"yes\"></iframe></div>");
    document.write("<div id=\"spliterbg\" style=\"left:0px;\" title=\"打开/关闭导航\" onclick=\"spliter_click()\" onmouseover=\"spliterbg_mouseover()\" onmouseout=\"spliterbg_mouseout()\"><div id=\"spliter\" class=\"splitertoright\"></div></div>"); 
	if (isIE7pre)
	{
		document.body.onload = function() {
			var iwidth = parseInt(iebody().offsetWidth); 
			if (iwidth > 4) document.getElementById("rightdiv").style.width = iwidth-4;
		}
		window.onresize = function() {
			var iwidth = parseInt(iebody().offsetWidth); 
			if (iwidth > 4) document.getElementById("rightdiv").style.width = iwidth-4;
		}
	}
}
else{
    document.write("<div id=\"leftdiv\" style=\"display:block;\">");
    document.write("<iframe id=\"leftbar\" src=\"forumlist.aspx\" frameborder=\"0\" scrolling=\"yes\"></iframe></div>");
    document.write("<div id=\"spliterbg\" title=\"打开/关闭导航\" onclick=\"spliter_click()\" onmouseover=\"spliterbg_mouseover()\" onmouseout=\"spliterbg_mouseout()\"><div id=\"spliter\" class=\"splitertoleft\"></div></div>"); 
	if (isIE7pre)
	{
		document.body.onload = function() {
			var iwidth = parseInt(iebody().offsetWidth); 
			if (iwidth > 194) document.getElementById("rightdiv").style.width = iwidth-194;
		}
		window.onresize = function() {
			var iwidth = parseInt(iebody().offsetWidth); 
			if (iwidth > 194) document.getElementById("rightdiv").style.width = iwidth-194;
		}
	}
}

function iebody() {
	return (document.compatMode != "BackCompat"? document.documentElement : document.body);
}

function getIEVersonNumber() {
	var ua = navigator.userAgent;
	var msieOffset = ua.indexOf("MSIE ");
	if(msieOffset < 0) {
		return 0;
	}
	return parseFloat(ua.substring(msieOffset + 5, ua.indexOf(";", msieOffset)));
 }