var tag = "随笔, 杂谈,情感,家居,海外,时尚,梦想,心理,家庭,女优,风景,性爱,医疗,职场,烹饪,暗恋,闲聊,交友,育儿,";
	tag += "妈咪,减肥,健身,汽车,娱乐,明星,八卦,星座,血型,电影,流行,偶像,电玩,动漫,美女,搞笑,金融,投资,理财,团队,";
	tag += "招聘,游戏,魔兽,工会,街机,街霸,对战,艺术,美术,诗歌,散文,视觉,设计,奥运,科技,黑客,军事,人文,历史,哲学,学校,";
	tag += "心情,随拍,朋友,记事,映像,娱乐八卦,,购物,随拍,工作,动漫,车展,歌词, 音乐,自言自语,";
	tag += "摄影,美食,美容,旅游,自拍,体育,乱七八糟,人物,人生,闲言碎语,学习,小说,感悟,技术,收藏,故事,文摘,新闻,";
	tag += " 日记,宠物,流水帐,涂鸦,爱情,生活,网络,写真,评论,读书,资料,足球,转载,图片,阅读,微笑北京";

String.prototype.trim = function()
{
	return this.replace(/(^[\s]*)|([\s]*$)/g, "");
}

String.prototype.len=function()
{
    return this.replace(/[^\x00-\xff]/g,"**").length;
}

function doOK(){
	if(window.opener != null){
		var strURL = window.opener.location.href;
		window.opener.navigate(strURL);
		window.close();
	}
	else
		window.close();
}

function doClose(){
	window.close();
}

function doRefreshOpener(){
	if(window.opener != null){
		window.opener.location.replace(window.opener.location);
	}
}

function doRefresh(){
	window.navigate(window.location.href);
}

function doBack(){
	history.back(-1);
}

function newWindow(winWidth, winHeight, winScroll, winUrl, winName){
	var iLeft = (screen.width  - winWidth)/2;
	var iTop  = (screen.height - winHeight)/2;
	var strFeatures = "resizable=yes,scrollbars=" + winScroll + ",left=" + iLeft + ",top=" + iTop + ",width=" + winWidth.toString() + ",height=" + winHeight.toString();
	window.open(winUrl, winName, strFeatures);
}

function newDialog(winWidth, winHeight, winUrl){
	var strFeatures = "dialogHeight: " + winHeight + "px; dialogWidth: " + winWidth + "px;center: yes; help: no;resizable: no; status: no; scroll: no;";
	return window.showModalDialog(winUrl,this,strFeatures);
}

function newModelessWindow(winWidth, winHeight, winScroll, winUrl, winName){
	/*
	var strFeatures = "dialogHeight: " + winHeight + "px; dialogWidth: " + winWidth + "px;center: yes; help: no;resizable: yes; status: no; scroll: " + winScroll;
	window.showModelessDialog(winUrl,this,strFeatures);
	*/
	window.open(winUrl);
}

function isLong(str,l){ //判断字符串str字节数是否超出长度l
  var valueLen = 0;
  if (str != "")
  {
    for (i = 0; i < str.length; i ++)
    {
      var code = escape(str.charAt(i));
      if ((code.length >= 4) && (code < '%uFF60' || code > '%uFF9F'))
      {
        valueLen += 2;
      }
      else
      {
        valueLen ++;
      }
    }
  }
  return (valueLen>l?true:false)
}

function readCookie(doc, name)
{
	if(doc == null) doc = window.document;
	var cookieValue = "";
	var search = name + "=";
	if(doc.cookie.length > 0)
	{ 
		offset = doc.cookie.indexOf(search);
		if (offset != -1)
		{ 
			offset += search.length;
			end = doc.cookie.indexOf(";", offset);
			if (end == -1) end = doc.cookie.length;
				cookieValue = unescape(doc.cookie.substring(offset, end))
		}
	}
	return cookieValue;
}

function writeCookie(doc, name, value, expiresSeconds)
{
	if(doc == null) doc = window.document;
	var expire = "";
	if(expiresSeconds != null)
	{
		expire = new Date((new Date()).getTime() + expiresSeconds * 1000);
		expire = "; expires=" + expire.toGMTString();
	}
	doc.cookie = name + "=" + escape(value) + expire+"; path=/";
}


function doCheckAll(checkboxName, checked)
{
	var checkboxList = document.getElementsByTagName("input");
	for (var i=0; i<checkboxList.length; i++)
	{
		if (checkboxList[i].name == checkboxName)
			checkboxList[i].checked = checked;
	}
}

function doCheckboxNavigate(alertMessage, checkboxName, strUrl){
	var IDs = "";
	var UrlIndex = "http";
	var UrlNum = strUrl.indexOf(UrlIndex);
	var UrlSub = strUrl.substring(UrlNum);//截取删除时返回的URL	
	var url = strUrl.substring(0,UrlNum) + escape(UrlSub);//部分加密
	
	var checkboxList = document.getElementsByName(checkboxName);

	var hasSelection = false; // 是否勾选	
	for(var i=0 ; i < checkboxList.length; i++)
	{
		if(checkboxList[i].checked)
		{
			hasSelection = true;
			break
		}
	}
	if(!hasSelection){
		window.alert("请从列表中勾选项目，再点击操作按钮！");
		return;
	}
	
	if(window.confirm(alertMessage)){
		for(var i=0 ; i < checkboxList.length; i++)
		{
			if(checkboxList[i].checked)
			{
				IDs += checkboxList[i].value + ',';
			}
		}
		var urlToGo = "";
		if(url.indexOf("&") >= 0){
			urlToGo = url + "&IDs=" + IDs
		}
		else{
			if(url.indexOf("?") >= 0){
				urlToGo = url + "IDs" + IDs
			}
			else{
				urlToGo = url + "?IDs" + IDs
			}
		}
		window.navigate(urlToGo);
	}
}


			
function imageResize(_width,outName) //自动将所有大图片变成固定宽度
{
	var iIndex=0;
	var nImgCount=0;
	var _obj=document;
		
	nImgCount=_obj.images.length;
	for(i=0;i<nImgCount;i++)
	{				   
		if(_obj.images[i].width>_width && _obj.images[i].name != outName)
		{     
			_obj.images[i].height=_width*_obj.images[i].height/_obj.images[i].width
			_obj.images[i].width=_width;
			_obj.images[i].style.cursor = "hand";
			var html = _obj.images[i].outerHTML;
			html = html.substr(0, html.length-1);
			html += " ";
			html += "onclick=\"newWindow('" + _obj.images[i].src + "');\"";
			html += ">";
			_obj.images[i].outerHTML=html;
		}
	}
}			

function newWindow(url)
{
	window.open(url);
}



// 创建分页信息
function GetPagedInfos(){

	var strHtm = '';
	strHtm += '<a href="'+myPaged_strPageUrl+'1'+'">首页</a> ';
	strHtm += '<a href="'+myPaged_strPageUrl + myPaged_iCurrentPageIndex +'">上一页</a> ';
	var iCurrentPage = myPaged_iCurrentPageIndex+1;
	
	for(var i=4;i>0;i--)
	{
		if(iCurrentPage-i<=0)
		{
			strHtm += "";
		}
		else
		{
			var PageCurrent = iCurrentPage-i;			
			strHtm += "<a href=\"" + myPaged_strPageUrl + "" + PageCurrent + "\">" + PageCurrent+ "</A>&nbsp";
		}
		
	}
	
	for(var i=iCurrentPage;i<iCurrentPage+5;i++)	
	{
		if(i>myPaged_iPageCount)
		{
			strHtm += "";
		}
		else
		{
			if(i==iCurrentPage)
			{
				strHtm += "<span class=\"pre_next_hl\">"+iCurrentPage+"</span>&nbsp;";
			}
			else
			{
				if(i==iCurrentPage+5)
				{
					strHtm+="<a href=\"" + myPaged_strPageUrl + "" + i + "\">"+i+"</a>";
				}
				else
				{
					strHtm+="<a href=\"" + myPaged_strPageUrl + "" + i + "\">"+i+"</a>&nbsp;";
				}
			}
		}
				
	}
	
	
	/*
	
	for(var i=1; i<=myPaged_iPageCount; i++){
		if(myPaged_iCurrentPageIndex + 1 == i)
			strHtm += '<span class="pre_next_hl">'+i+'</span> ';
		else
			strHtm += '<a href="'+myPaged_strPageUrl+i+'">'+i+'</a> ';
	}
	
	*/
	strHtm += '<a href="'+myPaged_strPageUrl + (myPaged_iCurrentPageIndex+2) +'">下一页</a> ';
	strHtm += '<a href="'+myPaged_strPageUrl + myPaged_iPageCount +'">尾页</a> ';
	strHtm += "&nbsp;共 " + myPaged_iPageCount + " 页&nbsp;&nbsp;&nbsp;";
	return strHtm;
}


/*

//发送彩信的浮动图片
function showaddImgUrl(isShow,floatDivID,imgID)
{
	if(isShow)
	{
		var objDiv = document.getElementById(imgID);
		var daps  = document.getElementById(floatDivID);	
		if(objDiv){					
			var ttop  = objDiv.offsetTop;
			var tleft  = objDiv.offsetLeft;
			
			while (objDiv = objDiv.offsetParent)
			{
				ttop  +=objDiv.offsetTop+3;
				tleft +=objDiv.offsetLeft+3;
			}					
		
			var mobileImg = "http://mobile.x5dj.com/Mms/GetPic.aspx?picurl=" + escape(document.getElementById(imgID).src);
			
			
			document.getElementById(floatDivID).innerHTML = "<a href=\""+mobileImg+"\" target=\"_blank\"><img id=\"floatimg\" border=0 src=\"/User/images/caixin.gif\"></a>";
			
			
			var scrollHeight = document.documentElement.scrollTop
			if(scrollHeight > ttop) ttop = scrollHeight;
			daps.style.top  = ttop;
			daps.style.left = tleft + document.getElementById(imgID).width-mmsflostleft;
			
		}
		daps.style.display = "block";				
		
	}
	else if(window.event.toElement.id != imgID && window.event.toElement.id != "floatimg")
	{
		
		document.getElementById(floatDivID).style.display = "none";
	}
			
}


//彩信(请在要加彩信的页面加下面的相关内容:1.定义全局变量mmsflostleft---浮动图片在实际图片的位置。2.增加“<div id="PhotoUrl" style="position:absolute; z-index:100;display:none;"></div>”,3.onload="postimgmms();")
function postimgmms()
{
	var imgObj = document.getElementsByTagName("img");
	
	for(var i=0;i<imgObj.length;i++)
	{
		var imgID = "img" + i;			
		var imgSrc = imgObj[i].src;
		//是否为允许的图片				
		var bIsallowImg = false;
		var imgIndex = imgSrc.lastIndexOf(".");
		var fileTypeStr = imgSrc.substr(imgIndex);
		fileTypeStr = fileTypeStr.toUpperCase();
		filter = new Array([".GIF"],[".PNG"],[".JPG"],[".BMP"]);
		var tempType
		for(tempType in filter)
		{
			if(filter[tempType]==fileTypeStr)
			{
				bIsallowImg = true;
				break;
			}
		}			
		
		if(imgObj[i].width > 150 && imgObj[i].height > 150 && bIsallowImg)
		{
			imgObj[i].id = imgID;
			imgObj[i].onmouseover = imgonmouseover;
			imgObj[i].onmouseout = imgonmouseout;
		}
	}
	
}

function imgonmouseover()
{
	showaddImgUrl(true,"PhotoUrl",this.id);
}

function imgonmouseout()
{
	showaddImgUrl(false,"PhotoUrl",this.id);
}

*/


		//彩信(请在要加彩信的页面加下面的相关内容:1.定义全局变量mmsflostleft---浮动图片在实际图片的位置。2.增加“<div id="PhotoUrl" style="position:absolute; z-index:100;display:none;"></div>”,3.onload="postimgmms();")
function postimgmms()
{
	var imgObj = document.getElementsByTagName("img");
	
	for(var i=0;i<imgObj.length;i++)
	{
		var imgID = "img" + i;			
		var imgSrc = imgObj[i].src;
		//是否为允许的图片				
		var bIsallowImg = false;
		var imgIndex = imgSrc.lastIndexOf(".");
		var fileTypeStr = imgSrc.substr(imgIndex);
		fileTypeStr = fileTypeStr.toUpperCase();
		filter = new Array([".GIF"],[".PNG"],[".JPG"],[".BMP"]);
		var tempType
		for(tempType in filter)
		{
			if(filter[tempType]==fileTypeStr)
			{
				bIsallowImg = true;
				break;
			}
		}			
		
		if(bIsallowImg)
		{
			//imgObj[i].id = imgID;
			imgObj[i].onmouseover = imgonmouseover;
			imgObj[i].onmouseout = imgonmouseout;
		}
	}
	
}

		//发送彩信的浮动图片
function showaddImgUrl(isShow,floatDivID,imgObj)
{
	if(isShow)
	{
		var objDiv = imgObj;
		var daps  = document.getElementById(floatDivID);	
		if(objDiv){					
			var ttop  = objDiv.offsetTop;
			var tleft  = objDiv.offsetLeft;
			
			while (objDiv = objDiv.offsetParent)
			{
				ttop  +=objDiv.offsetTop+3;
				tleft +=objDiv.offsetLeft+3;
			}					
		
			var scrollHeight = document.documentElement.scrollTop
			if(scrollHeight > ttop) ttop = scrollHeight;
			
			
			
			var mobileImg = "http://mobile.jinbifun.com/Mms/GetPic.aspx?picurl=" + escape(imgObj.src);
			var html = "<a href=\""+mobileImg+"\" target=\"_blank\"><img id=\"floatimg\" border=0 src=\"/User/images/xiaocaixin.gif\"></a>";
			if(imgObj.width > 150 && imgObj.height > 150) 
			{
				html = "<a href=\""+mobileImg+"\" target=\"_blank\"><img id=\"floatimg\" border=0 src=\"/User/images/caixin.gif\"></a>";
				daps.style.left = tleft + imgObj.width-mmsflostleft;
			}
			else if(imgObj.width > 40 && imgObj.height > 40) 
			{
				daps.style.left = tleft + imgObj.width-50;
				ttop -= 10;				
			}
			else
			{
				return;
			}
			daps.style.top  = ttop;
			
			document.getElementById(floatDivID).innerHTML = html;
			
		}
		daps.style.display = "block";				
		
	}
	else if(window.event.toElement != imgObj && window.event.toElement != document.getElementById("floatimg"))
	{		
		document.getElementById(floatDivID).style.display = "none";
	}
			
}




function imgonmouseover()
{
	showaddImgUrl(true,"PhotoUrl",this);
}

function imgonmouseout()
{
	showaddImgUrl(false,"PhotoUrl",this);
}


function comp(a, b, n)
{
    var c=a.length>b.length?b:a;
    if(b==c) b=a; a=c; //少做些循环
    if(!n) n=1;
    var mm = new Array();
    for(var i=0; i<a.length; i++)
    {
        for(var j=i+n; j<=a.length; j++)
        {
            var s = a.substring(i, j);
            if(b.indexOf(s)==-1)
            {
                if(s.length>n)
                {
                    mm[mm.length] = a.substring(i, j-1);
                    i = j-2;
                }
                break;
            }
            else
            {
                if(j==a.length)
                {
                    mm[mm.length]=s;
                }
            }
        }
        
    }    
  
    return mm.Unique().join(","); //去除数组里的重复项
    
}

Array.prototype.Unique = function()
{
  var a = {}; for(var i=0; i<this.length; i++)
  {
    if(typeof a[this[i]] == "undefined")
      a[this[i]] = 1;
  }
  this.length = 0;
  for(var i in a)
  {
    this[this.length] = i;
    if(this.length>4) break;
  }   
   
  return this;
}

function showInfo(isShow,doElementID,floatDivID,topoff,leftoff)
{
	if(isShow)			
	{
		var objButton	= document.getElementById(doElementID);
		var daps		= document.getElementById(floatDivID);
	
		if(objButton)
		{					
			var ttop	= objButton.offsetTop;
			var tleft	= objButton.offsetLeft;
			
			while (objButton = objButton.offsetParent)
			{
				ttop  +=objButton.offsetTop+3;
				tleft +=objButton.offsetLeft+3;
			}
			
			document.getElementById(floatDivID).style.top  = ttop+topoff;
			document.getElementById(floatDivID).style.left = tleft + leftoff;
		}

		document.getElementById(floatDivID).style.display = "block";
	}
	else
	{
		document.getElementById(floatDivID).style.display = "none";
	}
	
}


function getdate()
{
	today=new Date();
	function initArray(){
	this.length=initArray.arguments.length
	for(var i=0;i<this.length;i++)
	this[i+1]=initArray.arguments[i]  }
	
	var month = today.getMonth() + 1;
	var d=new initArray(
		"(日)",
		"(一)",
		"(二)",
		"(三)",
		"(四)",
		"(五)",
		"(六)"); 
	var date = "你好，今天是" + today.getFullYear() +"年" + month +"月" + today.getDate() + "日";
		//d[today.getDay()+1],
		//"</h4>" );
		
	
	return date;
}


navHover = function ()
{
	if(document.getElementById("navmenu"))
	{
		navmenu("navmenu");
	}
	if(document.getElementById("navmenu2"))
	{
		navmenu("navmenu2");
	}
	
}
function navmenu(ele) 
{
	var lis = document.getElementById(ele).getElementsByTagName("LI"); 
	for (var i=0; i<lis.length; i++) 
	{ 
		lis[i].onmouseover=function() 
		{ 
			this.className+=" iehover"; 
		} 
		
		lis[i].onmouseout=function() 
		{ 
			this.className=this.className.replace(new RegExp(" iehover\\b"), ""); 
		} 
	} 
} 
if (window.attachEvent)	window.attachEvent("onload", navHover); 



function showAddContent(isShow,doElementID,floatDivID,top,left)
{
	if(isShow)			
	{
		var objButton	= document.getElementById(doElementID);
		var daps		= document.getElementById(floatDivID);
	
		if(objButton)
		{					
			var ttop	= objButton.offsetTop;
			var tleft	= objButton.offsetLeft;
			
			while (objButton = objButton.offsetParent)
			{
				ttop  +=objButton.offsetTop+3;
				tleft +=objButton.offsetLeft+3;
			}
			
			document.getElementById(floatDivID).style.top  = ttop+top;
			document.getElementById(floatDivID).style.left = tleft-left;
		}

		document.getElementById(floatDivID).style.display = "block";
	}
	else
	{
		document.getElementById(floatDivID).style.display = "none";
	}
	
}

//以下是检测用户在线状态

		
var timer;
var firstRun = true;
var xmlhttp;

function initStatusBar(){
	if(firstRun) getDate();
	timer = setInterval("getDate()",1000*60); // 每1分钟检测一次用户状态
	firstRun = false;
}
function GetHttpRequest()
{
	try 
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");				
	}
	catch(ex)
	{
		try
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(except)
		{
			xmlhttp = false;
		}
	}
	if(!xmlhttp && typeof XMLHttpRequest != 'undefined') {				
		xmlhttp = new XMLHttpRequest( );
		
	}
}
function getDate(){
	// var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	//var xmlhttp = XmlHttp.create();
	
	GetHttpRequest();
	var xmldoc = XmlDocument.create();

	// 异步调用 
	xmlhttp.onreadystatechange = function()
	{
		if(xmlhttp.readyState == 1)// 开始加载
		{
			// loading ...
		}
		if(xmlhttp.readyState == 4)	// 调用完毕
		{
			if(xmlhttp.status == 200) // 加载成功
			{
		
				// var xmldoc = xmlhttp.responseXML;
				// var root = xmldoc.documentElement;
				xmldoc.loadXML(xmlhttp.responseText);
				
				// 读取信息
				//var nodeStatus = xmldoc.selectSingleNode("/Data");
				var nodeStatus = xmldoc.getElementsByTagName('Data')[0];
				//var newMessage = nodeStatus.attributes[0].value; // 用户短信数
				//updateMyMessage(newMessage);
			}
		}
	}

	var url = "StatusBarXML.aspx?GroupID=<%= iGroupIDforXML %>&MemberID=<%= iUserID %>&Login=" + firstRun + "&refresh=" + new Date().valueOf();
	// var url = "ChatXML.aspx?GroupID=<%= iGroupID %>&MemberID=<%= iUserID %>";
	xmlhttp.open("get", url, true);
	xmlhttp.send(null);
}

			
			
			
		
//if (window.attachEvent)	window.attachEvent("onload", mov); 

function mov()
{	
	var div=document.getElementById("test");		
	div.style.position="absolute";
	
	//alert(document.window.screen.width);
	div.style.left=(document.documentElement.scrollLeft)+'px';
	div.style.top=(document.documentElement.scrollTop + 280)+'px';
	setTimeout("mov()",1000);			
		
	var html = "<table width=\"80\" height=\"253\" cellpadding=0 cellspacing=0 border=0>";
	//html += "<tr><td><a href=\"javascript:void(hiddenDiv());\"><img src=\"/img0610/feike_close.gif\" border=0></a></td></tr>";
	html += "<tr><td><a href=\"http://edit.jinbifun.com/GroupForum/4670/00410335.shtml#frameQuickReply\" target=\"_blank\"><img src=\"/images/yijian.gif\" border=0></a></td></tr>";
	//html += "<tr><td><a href=\"javascript:void(hiddenDiv());\"><img src=\"/img0610/feike_close.gif\" border=0></a></td></tr>";
	html += "</table>";
		
	div.innerHTML = html;
}

window.onerror = function ()
{
	return true;
}		
		