﻿if (self!=top){
	if (location.search=="?"){
		if (top.location.href+"?"==location.href)
			top.location=location
	}
}

function _ViewShow(id){
var h=_islocal()?"":"http://show.5ilog.com"
h+="/show/v.aspx/"+id+".htm"
	open(h)
}

function _NewShow(target){
var h="/show/?_p2v_&action=create"
switch (target){
	case "_self": location=h;break
	case "_top": top.location=h;break
	default:
		open(h)
}
}
function _Get5ilogSWFTAG(o){
	var w=o.width?(o.width==400?"":" width="+o.width):""
	var h=o.height?(o.height==300?"":" height="+o.height):""
	if (o.p2v_id) src=" p2v_magic="+(o.p2v_magic?o.p2v_magic:"0")+" p2v_id="+o.p2v_id
	else{
		var a=/^http:\/\/www\.56\.com\/ap(\d?)_(\d+)\.swf$/i.exec(o.src)
		if (a) src=" p2v_magic="+(RegExp.$1?RegExp.$1:"0")+" p2v_id="+RegExp.$2
			else src=" src='"+o.src+"'"
	}
	var tid=o.tid?" tid="+o.tid:""
	
	return "<com5ilog:swf id=com5ilogswf"+tid+w+h+src+"/>"
}
function _Init5ilogSWF(){
var a=_GetAllById("com5ilogswf")
if (!a) return
a=ToArray(a)
for (var i=0;i<a.length;i++){
	if (!a[i].dised){
		var o=_Get5ilogSWF(a[i])
		if (o){
			a[i].insertAdjacentHTML("afterEnd",o.html)
			a[i].dised="1"
			}
	}
}
}
function _Get5ilogSWF(o){
if (!o.getAttribute) o.getAttribute=function (s){return this[s]}
var src=o.getAttribute("src")
var p2v_id,magic;
if (!src){
	p2v_id=o.getAttribute("p2v_id")
	if (p2v_id){
		magic=o.getAttribute("p2v_magic")
		src="http://www.56.com/ap"+(magic=="0"?"":magic)+"_"+p2v_id+".swf"
	}
}
var w=o.getAttribute("width")
w=w?w:400
var h=o.getAttribute("height")
h=h?h:300

if (!src) return null
var tid=o.getAttribute("tid")

var r={src:src,width:w,height:h,html:_SWF(src,w,h,"",tid?"tid="+tid:"")}

if (tid) r.link="http://show.5ilog.com/show/v.aspx/"+tid+".htm"
else if (p2v_id)r.link="http://show.5ilog.com/show/?_p2v_&magic="+magic+"&id="+p2v_id
return r
}



function _taglink(k,bz){
return _taglinkByRow({k:k,bz:bz})
}
function _taglinkByRow(o){
var k=o.k
var bz=o.bz
if (!bz) return ""
var t1=" <a target=_blank href='"
var t2="'><img border=0 align=absmiddle src="+_5ilogImgPath
var s=""

if (o.singerid){
	var imgurl=_GetSingerImgURL(o)
	if (imgurl){
		//有头像
		s+=""+t1+"http://music.5ilog.com/music/singer.aspx/"+o.singerid+".htm' title='"
			+k+"写真照片 音乐专辑' onmouseover='this.childNodes(0).height=150'><img src="	+imgurl+" border=0 height=50  align=absmiddle>明星"+k+"</a>"
	}else
		s+=t1+"http://music.5ilog.com/music/singer.aspx/"+o.singerid+".htm"+t2+"dot/disk.gif>歌手"+k+"</a>"
}else{
	//old
	if (bz[1]&1) s+=t1+"http://music.5ilog.com/music/singer.aspx/N"+k+".htm"+t2+"dot/disk.gif>歌手"+k+"</a>"
}

if (bz[0]&0x10) s+=t1+"/cgi-bin/sys/link/bbstag.aspx/"+k+".htm'>"+k+"文章</a>"
if (bz[0]&2) s+=t1+"/cgi-bin/club/luntantag.aspx/"+k+".htm"+t2+"qqlogo/luntannew.gif>"+k+"论坛</a>"
//if (bz[0]&8) s+=t1+"/cgi-bin/home/search.aspx/"+k+".htm"+t2+"qqlogo/shome.gif>"+k+"用户</a>"
//if (bz[0]&1) 图片
if (bz[2]&1) s+=t1+"/cgi-bin/sys/link/tielist.aspx?k="+k+" 下载'>"+k+"下载</a>"
if (bz[2]&2) s+=t1+"/cgi-bin/sys/link/tielist.aspx?k="+k+" 图片"+t2+"dot/li/photo.gif>"+k+"图片</a>"
if (bz[2]&4) s+=t1+"/cgi-bin/sys/link/tielist.aspx?k="+k+" 视频'>"+k+"视频</a>"




if (bz[1]&4) s+=t1+"http://book.5ilog.com/cgi-bin/mz/poetry/author.aspx/"+k+".htm"+t2+"bbs/13.gif>人"+k+"</a>"

if (bz[1]&0x40) s+=t1+"http://music.5ilog.com/music/search.aspx/"+k+".htm"+t2+"dot/box.gif>歌曲"+k+"</a>"
if (bz[0]&0x800) s+=t1+"http://book.5ilog.com/cgi-bin/mz/chengyu/i.aspx/"+k+".htm'>成语"+k+"</a>"

if (bz[0]&0x400) s+=t1+"http://book.5ilog.com/cgi-bin/mz/poetry/cipai.aspx/"+k+".htm'>词牌"+k+"</a>"
if (bz[0]&0x100) s+=t1+"/cgi-bin/sys/other/nongli.aspx'>24节气</a>"

if (bz[0]&0x1000) s+=t1+"http://book.5ilog.com/cgi-bin/mz/hlm/' style='color:Red'>红楼大观</a>"
if (bz[0]&0x2000) s+=t1+"http://book.5ilog.com/cgi-bin/mz/poetry/'>古典诗词</a>"
return s
}
function _GetSingerImgURL(o){
	if (o.singerbz&256)
        return "http://music.5ilog.com/img/s/" + (o.singerid % 100 ) + "/" + o.singerid + ".jpg"
  return ""
}

function _set5ilogDomain(){
if (_EndWith(document.domain.toLowerCase(),"5ilog.com"))
	document.domain="5ilog.com"
}
if (!self._nochangedomain) _set5ilogDomain()

function _setpopDomain(){
try{
if (self==top){
	var s=window.opener.document.location
}else{
	var s=window.parent.document.location
}
}catch(e){
	//无法读则设置
	_set5ilogDomain()
}
}

function _GetAllById(id){
if (document.all) return document.all[id]

var t=document.getElementsByTagName("*")
var a=new Array()
for (var i=0;i<t.length;i++)
	if (t[i].id==id){
		a[a.length]=t[i]
	}
if (a.length==0) return null
if (a.length==1) return a[0]
return a
}

function _GetUpLoadHost2(){
var h=location.host
switch (h){
	case "w0.5ilog.com":
	case "w1.5ilog.com":
	case "w2.5ilog.com":
		return h.replace("w","n")
}
return ""
}
function _setFormUpLoadHost(theForm){
return 

if (!_StartWith(theForm.action,"/")) return

var h=_GetUpLoadHost2()
if (h=="") return

theForm.action="http://"+h+theForm.action
}



var _5iloghost=_islocal()?"":"http://www.5ilog.com"
var _5ilogJShost=_islocal()?"":"http://js.5ilog.com"
var _cgi=_5iloghost+"/cgi-bin/"
var _w0cgi=_islocal()?"/cgi-bin/":"http://w0.5ilog.com/cgi-bin/"
var _w1cgi=_islocal()?"/cgi-bin/":"http://w1.5ilog.com/cgi-bin/"
var _5ilogImgPath=_5ilogJShost+'/qq/img/'
function _DisWZ(rtype,rid,tags,title,othercanshu){
_W(_GetWZHTML(rtype,rid,tags,title,othercanshu))
}

function _GetWZHTML(rtype,rid,tags,title,othercanshu){
othercanshu=othercanshu?"'"+othercanshu+"'":"''"
if (tags) {
	tags="'"+tags+"'"
	othercanshu+=","+tags
}else tags=""
var l="\"javascript:_QQLink('"+rtype+"',"+rid+",'"+(title?title:"")+"',"+othercanshu+tags+")\""

if (!self._QQWZAry) _QQWZAry=new Array()
_QQWZAry[_QQWZAry.length]="<div><nobr>＋<a href="+l+" target=_self>5ilog网摘</a></nobr><HR>"
+"<nobr>＋<a target=_self href=\"javascript:_goWZQQ("+tags+")\">腾讯QQ书签</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=\"javascript:_goWZ365key("+tags+")\">365Key网摘</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=\"javascript:_goWZShouker("+tags+")\">收客收藏</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=\"javascript:_goWZPoco("+tags+")\">Poco网摘</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=\"javascript:_goWZGoogle("+tags+")\">Google书签</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=\"javascript:_goWZHexun("+tags+")\">和讯网摘</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=\"javascript:_goWZYesky("+tags+")\">天极网摘</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=\"javascript:_goWZYahoo("+tags+")\">雅虎收藏</a></nobr><BR>"
	+"<HR><nobr>·<a target=_self href=javascript:_QQBookmark()>我的网摘</a></nobr><BR>"
	+"<nobr>＋<a target=_self href=javascript:bookmarkit()>IE收藏夹</a></nobr></div>"

return "<a target=_self onmouseover=\"_ShowTabMenu(_QQWZAry["+(_QQWZAry.length-1)+"],'',1)\" onmouseout=_HideMenu() href="
	+l+"><img align=absmiddle src="+_5ilogJShost+"/qq/img/bbs/34.gif border=0>网摘收藏</a>"

}

//添加收藏
function bookmarkit(url,title){
	if(!url)url=document.location
	if(!title) title=document.title
	
  try {//IE
       window.external.addFavorite(url,title)
   }catch(e) {
    try {
    	window.external.addToFavoritesBar(url, title);
   	}catch (e2) {
    	alert('加入收藏失败，请您手工加入。')
   	}
  }
}


//QQ收藏
function _QQLink(type,id,title,othercanshu,tag){
var o=new _WZObject2(tag,"",title)
if (type=="X"){
	newin(_w0cgi+"myqq/link/addFavor2.aspx?subject="
	+o.title+"&tag="+o.tags+"&url="+o.url+"&excerpt="+o.desc
	,null,600,600,1);
	return
}

var link = _w0cgi+"myqq/link/addFavor.aspx?ltype="+type+"&rid="+id;
if (o.title) link += "&subject="+o.title;
if (othercanshu) link += "&othercanshu="+encodeURIComponent(othercanshu);
if (o.tags) link+="&tag="+o.tags
if (o.desc) link+="&excerpt="+o.desc

newin(link,null,600,600,1);
}

function _goWZQQ(tags,url,title,desc){
var o=new _WZObject2(tags,url,title,desc)
window.open('http://shuqian.qq.com/post?from=3&uri='+o.url+'&title='
	+o.title+'&jumpback=2&noui=1','','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes')
}


function _goWZGoogle(tags,url,title,desc){
var o=new _WZObject2(tags,url,title,desc)
window.open('http://www.google.com/bookmarks/mark?op=add&bkmk='+o.url+'&title='
	+o.title+'&labels='+o.tags+'&annotation='+o.desc)
}

function _goWZ365key(tags,url,title,desc){
var o=new _WZObject(tags,url,title,desc)
window.open('http://www.365key.com/storeIt.aspx?t='+o.title+'&u='
	+o.url+'&c='+o.desc,'','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes')
}

function _goWZYesky(tags,url,title,desc){
var o=new _WZObject(tags,url,title,desc)
window.open('http://hot.yesky.com/dp.aspx?t='+o.title+'&u='
	+o.url+'&c='+o.desc
	,'','scrollbars=no,width=624,height=663,left=75,top=20,status=no,resizable=yes')
}
function _goWZPoco(tags,url,title,desc){
var o=new _WZObject(tags,url,title,desc)
window.open('http://my.poco.cn/fav/storeIt.php?t='+o.title+'&u='
	+o.url+'&c='+o.desc+'&img='
	,'','scrollbars=no,width=624,height=663,left=75,top=20,status=no,resizable=yes')
}
function _goWZHexun(tags,url,title,desc){
var o=new _WZObject(tags,url,title,desc)
window.open('http://bookmark.hexun.com/post.aspx?title='+o.title+'&url='
	+o.url+'&excerpt='+o.desc+'&tags='+o.tags
	,'','scrollbars=no,width=624,height=663,left=75,top=20,status=no,resizable=yes')
}
function _goWZShouker(tags,url,title,desc){
var o=new _WZObject(tags,url,title,desc)

window.open('http://www.shouker.com/mc/col/post2.aspx?title='+o.title+'&surl='
	+o.url+'&desc='+o.desc+'&tags='+o.tags+'&st=2'
	,'shoukerpost','scrollbars=no,width=624,height=663,left=75,top=20,status=no,resizable=yes')
}

function _goWZYahoo(tags,url,title,desc){
var o=new _WZObject2(tags,url,title,desc)

window.open('http://myweb.cn.yahoo.com/popadd.html?url='+o.url
	+'&title='+o.title+"&tag="+o.getdouhaotags()+"&summary="+o.desc
	, 'Yahoo'
	,'scrollbars=yes,width=780,height=550,left=80,top=80,status=yes,resizable=yes')
}

function _WZObject(tags,url,title,desc){
	var d=document;
	desc=desc?desc:(d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():''))
	this.desc=escape(desc)
	this.title=escape(title?title:d.title)
	this.url=escape(url?url:_GetTielink())
	
	if (!tags) {
		if (self._pageTag) tags=_pageTag
		else if (self._QQluntanKeyAry) tags=_QQluntanKeyAry.join(" ")
	}
	this.tags=escape(tags?tags:"")
	
	return this
}

function _WZObject2(tags,url,title,desc){
	var d=document;
	desc=desc?desc:(d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():''))
	this.desc=encodeURIComponent(desc)
	this.title=encodeURIComponent(title?title:d.title)
	this.url=encodeURIComponent(url?url:_GetTielink())

	if (!tags) {
		if (self._pageTag) tags=_pageTag
		else if (self._QQluntanKeyAry) tags=_QQluntanKeyAry.join(" ")
	}
	this.tags=encodeURIComponent(tags?tags:"")
	this.getdouhaotags=function (){
		return encodeURIComponent(decodeURIComponent(this.tags).replace(/\s+/g,","))
	}
	return this
}

function _GetTieID(s){
if (!s) s=location.href
var m=s.match(/\/cgi-bin\/(bbs|mybbs\/\w)\/\w+\/v\w*\.aspx?\?(.*&)?id=(\d+)/i)
if (!m){
	m=s.match(/v(iew)?\.(a)spx\/(\d+)\.htm/i)
}
if (m)
	return parseInt(m[3])
return 0
}

function _GetTielink(s){
if (!s) s=location.href
var id=_GetTieID(s)
if (id)	return _cgi+"sys/link/view.aspx/"+id+".htm"
return s
}
function _GetHost(url){
if (url){
	var a=url.match(/^https?:\/\/([^\/]+)/i)
	if (a.length==2) return a[1]
}
return ""
}

function _GetRiLi(){	newin('http://w0.5ilog.com/cgi-bin/myqq/home/host/rili.html',null,510,400)}
function _sendsms(logname){open("/cgi-bin/myqq/sms/send.aspx?tologname="+logname)}
function _Quan(logname){open('/cgi-bin/myqq/friends/quan.aspx?act=dispqxml&logname='+logname)}


function _GetMybbsHome(){
var bbsname=_GetMYBBSValue("bbsname","")
if (!bbsname){
	var reg=/^\/cgi\-bin\/mybbs\/\w\/(\w+)\/?/i
	var a=document.location.pathname.match(reg)
	if (!a){
		try{a=parent.document.location.pathname.match(reg)}catch(e){}
	}
	if (a) bbsname=a[1]
} 
if (bbsname) return "http://"+bbsname+".5imybbs.com"
return ""
}

function _DelHost(o,v){
var r=new RegExp("http:\\/\\/"+location.host.replace(".","\\."),"gi")
o.value=v.replace(r,"")
}

//o		返回对象
function _SelMusic(o){
if(!_checkIE5()) return;
_GetPopUpValue2({v:"document.all."+o.o.uniqueID,
		url:"/qq/sys/sel/selmusic.html"
		,w:600,h:500,isnothit:false,isappend:o.isappend,top:o.top,left:o.left});
}

//o		返回对象
function _SelShiCi(o){
if(!_checkIE5()) return;
_GetPopUpValue2({v:"document.all."+o.o.uniqueID,
		url:"/qq/sys/sel/selshici.html"
		,w:600,h:500,isnothit:false,isappend:o.isappend,top:o.top,left:o.left});
}

function _SelShow(o){
if(!_checkIE5()) return;
_GetPopUpValue2({v:"document.all."+o.o.uniqueID,
		url:"/qq/sys/sel/selshow.html"
		,w:700,h:500,isnothit:o.isnothit==false?false:true,isappend:o.isappend,top:o.top,left:o.left});
}



//liburl	libid=,lunquid=,uid=
//ltype		link,动态图片连接，否则为静态
//o		返回对象
//isappend	是否追加
function _SelImg2(o){
if(!_checkIE5()) return;
if(o.ltype==null)o.ltype=""
if(o.liburl==null)o.liburl=""
_GetPopUpValue2({v:"document.all."+o.o.uniqueID,
		url:"/qq/sys/sel/selimg.html?ltype="+o.ltype+"&liburl="+o.liburl
		,w:600,h:500,isnothit:o.isnothit==false?false:true,isappend:o.isappend,top:o.top,left:o.left});
}


function _CopyLink(link,fuzhu){
	if (!link){
			link=_GetTielink()
	}
	if (fuzhu)
		link+="\r\n"+fuzhu
	else link+="\r\n"+(document.title? document.title:"来自QQ驿站的好文")
		
	window.clipboardData.setData("Text",link);  	
  	alert('现在可以使用键盘 ctrl+v 将该连接发给朋友')
}


function _ImgTagsLink(tag){return _cgi+'imglib/listall.aspx?k='+tag}
function _ShowImgTags(tags){ //列出标签
	if (!tags) {
		_W('<a target=_blank href='+_cgi+'club/tag.aspx>什么是标签？</a>')
		return
	}

	if (!self._pageTag) self._pageTag=tags

	_W( "<span class='usr-tag'>" + _ListImgTags(tags)+"</span>")
}//_ShowImgTags

function _LunTanTagsLink(tag){return _w1cgi+'club/luntantag.aspx/'+tag.replace(/\.+$/,"")+'.htm'}
function _ShowLunTanTags(tags){ //列出标签
	if (!tags) return
	if (!self._pageTag) self._pageTag=tags

	_W("<span class='usr-tag'>" + _ListLunTanTags(tags)+"</span>")
}

function _UsrTagsLink(tag){return _cgi+'home/search.aspx/'+tag.replace(/\.+$/,"")+'.htm'}
function _ShowUsrTags(tags){ //列出标签
	if (!tags) {_W('<a target=_blank href='+_cgi+'club/tag.aspx>什么是标签？</a> <a target=_blank href=/cgi-bin/myqq/update_a.aspx#tag>设置自己的标签</a>')
		return
	}
	if (!self._pageTag) self._pageTag=tags
	
	_W("<span class=usr-tag>" + _ListUsrTags(tags)+"</span>")
}


function _ListUsrTags(tags){ return _ListTagsF(tags,_UsrTagsLink)}
function _ListLunTanTags(tags){ return _ListTagsF(tags,_LunTanTagsLink)}
function _ListImgTags(tags){ return _ListTagsF(tags,_ImgTagsLink)}

function _ListTagsF(tags,f){
	if (!tags) return ""
	var aryTag = tags.split(/\s+/gi)
	var strRe = ""	
	for (var i=0; i<aryTag.length; i++){
		strRe += '<a target=_blank href="'+f(aryTag[i])+'">'+aryTag[i]+'</a> '
	}
	return strRe
}


function _SelBlogToLunqu(of){ //blog发布到论坛，选择论区id，of为Form对象
	_GetPopUpValue("document.all."+of.uniqueID+".id.value",'/cgi-bin/sys/bbsadmin/fastSel/selBlogToLunqu.aspx',470,320)
}
function _CommentImg(oA){ //图片评论
	(_ImgPingLunTR.style.display == "block")?_ImgPingLunTR.style.display = "none":_ImgPingLunTR.style.display = "block"
	_ImgPingLunIframe.document.location = oA.url
}

function _ViewBBSTag(tags,id){ //查看文章标签
	tags=tags.replace(/\.+$/,"")
	if (!id) id=0
	else{
		if ((self.logsearchform)&&(logsearchform.k)){
		//是否存在log form
			logsearchform.k.value=tags
			logsearchform.submit()
			return
		}
	}
	var link=_w1cgi+'sys/link/bbstag.aspx/'+tags+".htm"
	if (id==0)
		open(link)
	else
		open(_w1cgi+'sys/link/tielist.aspx?id=0x'+parseInt(id).toString(16)+"&k="+tags)
}

function _SelTag(of){ //添加标签，需要提供论区id和tags
	_GetPopUpValue("document.all."+of.uniqueID+".value",'/cgi-bin/sys/bbsadmin/fastSel/selTag.aspx',500,400)
}
function _SelBBSTag(of,id){ //添加标签，需要提供论区id和tags
	_GetPopUpValue("document.all."+of.uniqueID+".keyword.value",'/cgi-bin/sys/bbsadmin/fastSel/selTag.aspx?id='+id,500,400)
}
function _AddTag(id,tags){ //添加标签，需要提供论区id和tags
	if (!tags) return
	open('/cgi-bin/class/BBSAdmin/SetLunQu.aspx?act=AddTag&id='+id+'&keyword='+tags)
}


function _ShowTags(tags){ //列出标签
if (tags=="") return
tags=tags?tags:(self._pageTag?_pageTag:"")
if (!tags) return ""

if (!self._pageTag) self._pageTag=tags
	var strRe = "<span class='s-v-key-tishi'>标签(tag)：</span><span class='s-v-keyword'>"
	_W(strRe+_ListTags(tags,0,true)+"</span> <a href="+_cgi+"club/tag.aspx target=_blank style='font-size: 0.8em'>什么是标签?</a>")
}
function _ListTags(tags,id,noQQ){ //列出标签
	if (!tags) return ""
	var aryTag = tags.split(/\s+/gi)
	var lunquid = _GetMYBBSValue("lunquid",0)
	if (id) lunquid = id
	var strRe = ""	
	for (var i=0; i<aryTag.length; i++){
		strRe += '<a target=_self href="javascript:_ViewBBSTag(\''+aryTag[i]+"',"+lunquid+')">'+aryTag[i]+'</a> '
		if (!noQQ && (parseInt(lunquid)!=0))	strRe+= '<a target=_blank style="font-size: 0.85em;" href="'
				+_w1cgi+'sys/link/bbstag.aspx/'+aryTag[i]+'.htm">驿站</a>&nbsp;&nbsp;'
	}
	return strRe
}

function _ListSelTag(n){
if (!n) n=50
var lunquid = _GetMYBBSValue("lunquid",0)

	var tail="　<a id=whatistag href=http://www.5ilog.com/cgi-bin/club/tag.aspx target=_blank>什么是标签?</a>"
	if (!self._QQluntanKeyAry) return tail
	if (_QQluntanKeyAry.length==0) return tail

	var strRe = "<div style='font-size:12px'><B>已有标签：</b>"
	var ary = _QQluntanKeyAry
var disn=15
	for (var i=0; i < ary.length && i<n; i++){
		strRe += '<a title="本论坛共'+_QQluntanKeyAry.otherN[i]+'篇文章" href="javascript:_AppendTag(\''
			+ary[i]+'\')" target=_self>'+ary[i]+'</a>'+_QQluntanKeyAry.otherN[i]+" "
		if (ary.length>disn && i==disn) strRe+=" <a href=# onclick='return _DisHidden()'>更多标签>></a><div style='display:none'>"
	}//for
	if (ary.length>disn) strRe+="</div>"
	return strRe +tail+"</div>"
}

function _DisHidden(a){
a=a?a:event.srcElement.nextSibling
	a.style.display= a.style.display=="none"?"":"none"
return false
}
function _AppendTag(s){
s=s?s:event.srcElement.innerText
var o=document.all.keyword
if (!o) return 
if (o.length) o=o[0]

if (o.value=="") {o.value=s;return}
if ((" "+o.value+" ").indexOf(" "+s+" ")>=0) return
o.value+=" " +s
}

function _ListAryTag(intFlag,n){ //列出_QQluntanKeyAry，intFlag，位1竖，位2站方连接,位3不输出管理连接
if (!n) n=10

	var lunquid = _GetMYBBSValue("lunquid",0)
	//var tail=(intFlag&4)?"":"<a href='/cgi-bin/sys/bbsadmin/tag/mantag.aspx?id="+lunquid+"' target=_blank>管理标签</a>"
	var tail=""
	if (!self._QQluntanKeyAry) return tail
	if (_QQluntanKeyAry.length==0) return tail
	var strRe = ""
	var ary = _QQluntanKeyAry
	var linker = "&nbsp;"
	if (!intFlag) intFlag = 0
	if (intFlag&1) linker = "<br>" //竖排
	var needhotqqlink = intFlag&2 
	for (var i=0; i < ary.length && i<n; i++){
		strRe += '<a title="共'+_QQluntanKeyAry.otherN[i]+'篇文章" href="javascript:_ViewBBSTag(\''+ary[i]+'\','+lunquid+')" target=_self>'+ary[i]+'</a>'+_QQluntanKeyAry.otherN[i]
		if (needhotqqlink) {
			strRe += ' <a style="font-size: 0.85em;" href="javascript:_ViewBBSTag(\''+ary[i]+'\',0)" target=_self>驿站</a>'
			//strRe += " <a target=_blank href='"+_w1cgi+"club/luntantag.aspx/"+ary[i]+".htm' title='"+_QQluntanKeyAry.otherN[i]+"个论坛/blog设置该标签'>"+_QQluntanKeyAry.otherN[i]+"</a>"
		}
		strRe+=linker
	}//for
	return strRe +=tail
}
function _GetMYBBSValue(value, defaultvalue){ //获得_MYBBS的值, value为属性名，可以是多级，如tieState.top1。defaultvalue 为默认值。
	if (self["_"+value]) return self["_"+value] //主要是lunquid的时候有用
	if (!self["_MYBBS"]) return defaultvalue
	var arrV = value.split(".")
	if (!_MYBBS[arrV[0]]) return defaultvalue
	if (arrV.length == 1) return _MYBBS[arrV[0]]
	if (!_MYBBS[arrV[0]][arrV[1]]) return defaultvalue
	if (arrV.length == 2) return _MYBBS[arrV[0]][arrV[1]]
	return "少一层次"
}
function _BeginWrite(){ 
	_OriginalWriter = document.write
	_StrGotten = "" //收集的字符串
	document.write = function (s){_StrGotten += s}
	return _OriginalWriter
}
function _EndWrite(){
	if (self._OriginalWriter) {
		document.write = _OriginalWriter
		_OriginalWriter = null 
		return _StrGotten
	}
	return null
}
function _IsBeginWrite(){if (self._OriginalWriter) return true; return false;}


function _SetMYBBSDisableHTMLWrite(){
_SetMYBBSObj({CSSDisabled:true,FuDongDiseabled:true,ChipDisabled:true,targetDisabled:true})
}

//设置_MYBBS变量
function _SetMYBBS(name,v){
 if (!self._MYBBS) _MYBBS=new Object()
 _MYBBS[name]=v
}
function _SetMYBBSObj(o){
 if (!self._MYBBS) _MYBBS=o;
 else{
 	for(var n in o) _MYBBS[n]=o[n]
 }
}


function _ZiXuan(id, j){newin('/cgi-bin/sys/bbs/zixuan.asp?'+(j==1?"j=1":"j=0")+'&id='+id)} //自选
function _Package(id){newin('/cgi-bin/sys/bbs/mail.asp?id='+id)} //打包
function _SetMagic(type, tid){open('/cgi-bin/club/magic/magic.aspx?targetType='+type+'&tid='+tid)} //释放魔法
function _GetFenLei(v,v1){_GetPopUpValue(v,_5ilogJShost+'/qq/bbsadmin/sel/selbbsfenlei.html',500,400,v1)}


function _PopChatRoom(lunquid, strName, strDesc){var a = _GetHotQQObject("Com.MessagePipe","",0.992);a.WebRoom2QMNet(lunquid, strName, strDesc);}
var chatRoom=_PopChatRoom

function _SendXXZ(imgurl){window.open("http://tlt.7town.com/ZComImgDIY/step2.asp?imageUrl="
	+escape(imgurl)+"&uid=16764&a=&b=&c=&d=&e=&f=")} //发送形象照到手机，imgurl形象照地址
	
function _SendImg(id){window.open("http://w0.5ilog.com/cgi-bin/bbs/imgadmin/viewimg_sendimg.aspx?id="+id);}
function _TBPost(id){window.open("/cgi-bin/sys/bbsadmin/qlog/tbPost.aspx?id="+id);} //引用评论
function _Report(type, subject, body) {newin('http://w0.5ilog.com/qq/myqq/express/report.html?type=' + type + (body?"&body=" + body:"")+"&url=" + escape(location),null,640,500);} //Report

//o	放置图片url对象
//space 空间参数，类似 type=1&root=&path=
function _SelImgUrl(o,space,isAbsoluteLink){
if(!_checkIE5()) return;
_GetPopUpValue("document.all."+o.uniqueID,
		"/qq/sys/netspace/?"+(space?"&"+space:"")+(isAbsoluteLink?"&isAbsoluteLink=1":"")
		,620,523);
}

function _CheckDotNET(v){
var s=window.navigator.userAgent.match(new RegExp("\\.NET CLR ([234]\\.\\d+)"))
if (s){
	return true
	//if ((!v)||(s[1]>=v)) return true
}
return false
}
function _GetQMVer(){
 var s=window.navigator.userAgent.match(new RegExp("QM\\.NET (\\d+\\.\\d+)","i"))
 return (s)? s[1]*1000:0
}
function _CheckQMVer(v){
return (_GetQMVer()>=v*1000)
}
function _CheckQMLatestVer(){ //检查是否为最新版本
return (_GetQMVer()>=0.997*1000)
}
function _DownLoadQM(){  window.open(_5iloghost+"/qq/qqspace/xuanchuan.htm")}
function _PromPtDownLoadQM(s){  if (confirm(s?s:"该功能需要安装QM.NET，立刻去下载安装吗？")) _DownLoadQM();}
function _GetHotQQObject(classname,noQMMsg,v){
if ((v)&&(!_CheckQMVer(v))){
	_PromPtDownLoadQM(noQMMsg)
	return
}
var o
try{ 
	o= new ActiveXObject("HotQQ."+classname)
}
catch (e)
{
	alert(e.message);_PromPtDownLoadQM(noQMMsg);return;
}
o.document=document
return o
}

function _SelLM(reValue,reDesc,a) //select one luntan
{
	if (!reDesc) reDesc=null;
	_GetPopUpValue(reValue,"/cgi-bin/sys/bbsadmin/fastSel/selMyLM.aspx"+((a)?a:""),360,250,reDesc);
}

function _SelLMs(reValue,reDesc) //select mulluntan
{
	_SelLM(reValue,reDesc,"?multiple=true")
}

function _SelLuntan(reValue,reDesc,a) //select one luntan
{
	if (!reDesc) reDesc=null;
	_GetPopUpValue(reValue,"/cgi-bin/sys/bbsadmin/fastSel/selMyLuntan.aspx"+((a)?a:""),360,250,reDesc);
}
function _SelLuntans(reValue,reDesc) //select mulluntan
{
	_SelLuntan(reValue,reDesc,"?multiple=true")
}

function _SelUser(reValue,reDesc,a) //select one usr
{
	if (!reDesc) reDesc=null;
	_GetPopUpValue(reValue,"/cgi-bin/sys/bbsadmin/fastSel/selFriends.aspx"+((a)?a:""),490,300,reDesc);
}

function _SelUsers(reValue,reDesc) //select mulusr
{
	_SelUser(reValue,reDesc,"?multiple=true")
}

//a参数说明multiply = false时不能多选
//onlyorg = true 时只能选择部落
function _SelOrg(reValue,reDesc,a) //select orgs
{
	if (!reDesc) reDesc=null;
	_GetPopUpValue(reValue,"/cgi-bin/sys/bbsadmin/fastSel/setGroups.aspx"+((a)?a:""),520,400,reDesc);
}

function _SelOrgOne(reValue,reDesc) //select one org
{
	_SelOrg(reValue,reDesc,"?multiple=false")
}

function _QQUsrOrg(id){window.open("/cgi-bin/club/groups/orginfo.aspx?oid="+id);}
String.prototype.getLeftN = function(n){
	if (this.length <= n) return this
	return this.slice(0,n)+".."
}
String.prototype.trim = function(){
    return this.replace(/(^\s*)|(\s*$)/g, "");
}
function _ctrl_enter_submit(){
if(!(event.ctrlKey && event.keyCode==13)) return
var ee=event.srcElement.form.elements
for (var i=0;i<ee.length;i++)
	if (ee[i].type=="submit") {ee[i].click();return}
}

function _GetUsrOnlineHTML(o){
if ((o != "F")&&(o!='')) return "<a target=_blank href="+_5iloghost
	+"/qq/qqspace/xuanchuan.htm><img border=0 title='QM在线' src="+_5ilogJShost+"/qq/img/usr/o.gif></a>"
return ""
}
function _GoFile(filename){
 if (filename.charAt(0)=="/") {location.pathname=filename;return}
 var i=location.pathname.lastIndexOf("/")
 location.pathname=location.pathname.substring(0,i+1)+filename
}
function _BlankString(){return ""}

function _TrackBack(id){ newin("/cgi-bin/sys/bbs/trackback.aspx?id="+id,null,700,500);}
function _REG(id){
	var goLink="http://w0.5ilog.com/qq/sys/register/new.htm";
	if (id)
	{
		if (isNaN(parseInt(id)))
			goLink += "?fromtype="+id;
		else
			goLink += "?fromtype=L"+id;
	}
	else
	{
	if (self._REGFromType)
		goLink += "?fromtype="+_REGFromType;
		else{
			var t="";
			if (self._lunquid) t=self._lunquid;
			else if ((self.opener)&&(opener._lunquid)) 
				t=opener._lunquid;
		
			if (t!="") 
				goLink +="?fromtype=L"+t;
			else
			{
				if (self._uid) t=self._uid;
				else if ((self.opener)&&(opener._uid)) t=opener._uid;
				else if (parent && parent.QQHomeMenu && (parent.QQHomeMenu._uid)) t=parent.QQHomeMenu._uid
				if (t!="") goLink +="?fromtype=U"+t;
			}
		}
	}//if id
	window.open(goLink);
}//_REG

function _JREG(id){
	var goLink="/cgi-bin/myqq/register/fastReg.aspx";
	if (id)
	{
		if (isNaN(parseInt(id)))
			goLink += "?fromtype="+id;
		else
			goLink += "?fromtype=L"+id;
	}
	else
	{
		var t="";
		if (self._MYBBS) t=self._MYBBS.lunquid;
		else if ((self.opener)&&(opener._MYBBS)) t=opener._MYBBS.lunquid;
		
		if (t!="") 
			goLink +="?fromtype=L"+t;
		else
		{
			if (self._uid) t=self._uid;
			else if ((self.opener)&&(opener._uid)) t=opener._uid;
			if (t!="")
				goLink +="?fromtype=U"+t
			else //t="" 看文件情况
			{
				if (_GetUrlFileName(location.toString()).substr(0,5).toUpperCase()=="MYBBS")
				{if (QueryString.id)  goLink +="?fromtype=L"+QueryString.id;}
			}
		}
	}//if id
	newin(goLink,null,600,306);
}//_REG

function _GetRenZhengHTML(){
	var n = Math.ceil(Math.random()*2147483647);
	var h=(location.host=="127.0.0.1")?"":"http://s.5ilog.com"
	return "<input type=hidden name=pass1 value="+n+"><img style='margin-bottom:-3px;' src="
		+h+"/cgi-bin/class/sys/RenZheng.aspx?id="+n+">"
}

function _SelUsr(plogname,pname){ _GetPopUpValue(plogname,'/cgi-bin/usr/selusr.aspx',400,500,pname)}

function _GetQQMagic(){
if (self._QQMagiced) return
if (document.getElementById("_QQM")){
	_includeJS("qqdhtml")
	_QQMagiced = true
	
	if (window.attachEvent) window.attachEvent("onload", new Function("_QQMagic();"))
    if (window.addEventListener) {window.addEventListener("load",new Function("_QQMagic();"),false)}
}
}
function _ViewAuth(id){newin('/cgi-bin/class/BBS/ProtectedContent.aspx?id='+id,null,700,500)}

function _BBSLinks(links){
if (!links){ return "";}
links=links.split("|");
var QQSpaceStr='/cgi-bin/class/QQSpace/QQSpace.aspx'
for (var s="",i=0,j=links.length;i<j;i++){
	if (_StartWith(links[i],QQSpaceStr)){
		var t=links[i].substr(QQSpaceStr.length+1)
		s+=' <img src='+QQSpaceStr+'?act=QQSpaceStatusImg&uid='+t.substr(0,t.indexOf("/"))+">"
		}
  	s+='<a href="'+links[i]+'">'+_GetUrlFileName(links[i])+'</a> '; 
  	}
return s;
}

function _SWF(src,width,height,styleStr,otherCanShu){
return '<object style="'+((styleStr)?styleStr:"border:1 solid black")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"'
	+' width="'+width+'" height="'+height+'"'+(otherCanShu?" "+otherCanShu:"")+'>'
	+'<param name=movie value="'+src+'"><param name=quality value=high>'
	+((styleStr)?"<param name=\"scale\" value=\"noscale\" /><param name=\"wmode\" value=\"transparent\">":"")
	+'<embed scale="noscale" src="'+src+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"'
	+' width="'+width+'" height="'+height+'"></embed></object>'
}

//跳动元素
function _TiaoDong(){
	for (var i=0;i<_TiaoDongAry.length;i++){
		_TiaoDongAry[i].style.left=((parseInt(_TiaoDongAry[i].style.left)==-1)?1:-1)+"px"
		}
}
function _AddTiaoDong(o){
 //if (!IsIE5()) return
 if (!(o))return
 o.style.position="relative"
 
 if (self._TiaoDongAry==null) {
 	_TiaoDongAry=[]
 	_TiaoDongAry[0]=o
 	setInterval("_TiaoDong()",100)
 } else
 	_TiaoDongAry[_TiaoDongAry.length]=o
 
}

function _GetImgHost(homeid){
if (homeid==null){
	var h=location.host
	switch (h){
		case "w0.5ilog.com":
		case "w1.5ilog.com":
		case "w2.5ilog.com":
			return h.replace("w","i")
		case "n0.5ilog.com":
		case "n1.5ilog.com":
		case "n2.5ilog.com":
			return h.replace("n","i")
	}
	return h
}
return "i"+homeid+".5ilog.com"
}


function _GetHomeHost(homeid){
return "w"+homeid+".5ilog.com"
}
//
function _GoUnion(id,j){
var src='/cgi-bin/sys/link/union.aspx?id='+id
if (j==1) src+="&j=1"
	window.open(src)
}

//css切换
function _GetCssPath(css){
if (css) {
	if (css.indexOf(".")<0)//不包含 . 的使用系统
		return _5ilogJShost+"/c/bbs/css/"+css+".css"

	return css
	}
//不提供使用默认
if (self._MYBBS) {
	//子版面已经改变默认了
	if (_MYBBS.css) return _GetCssPath(_MYBBS.css)
	
	//使用默认的
	if (_MYBBS.defaultcss) return _GetCssPath(_MYBBS.defaultcss)
	
	//使用自定义的
	if (_MYBBS.dingHome) return _MYBBS.dingHome+"css.css"
	
	return _GetMyBBSDingUrl(_MYBBS.bbsname)+"css.css"
}
return "css.css"
}



//输出包含
function _SetCss(){
if (!self._MyBBSDisableCSS)
_W("<LINK id=_QQCss REL=stylesheet TYPE=text/css HREF="+_GetCssPath(_GetCookie("css"))+" />")
}

function _SetCss2(){
if (!self._MyBBSDisableCSS&&!document.all._QQCss2)
_W("<LINK id=_QQCss2 REL=stylesheet TYPE=text/css HREF="+_GetCssPath(_GetCookie("css"))+" />")
}

//切换Css
function _ChangeCss(css){
 if (document.getElementById("_QQCss")) _QQCss.href=_GetCssPath(css);
 if (document.getElementById("_QQCss2")) _QQCss2.href=_GetCssPath(css); 
_SetCssCookie(css)
if (!document.all) location.reload()
}

//设置cookie
function _SetCssCookie(css){
if (css==null) {
	css=QueryString.CSS
	if (css==null) {
		_ClearCssCookie()
		return
	}
}

_SetCookies("css="+css,"3")
}


//清除css cookie
function _ClearCssCookie(){
  var s="css=;expires=Mon, 28 Dec 1998 23:59:59 UTC;path=/" //+GetCurrentFullPath(location.pathname);
  if (_EndWith(document.domain.toLowerCase(),"5ilog.com")) s+=";domain=5ilog.com"
  document.cookie=s
  
  //设为默认风格
  if (document.all._QQCss) document.all._QQCss.href="css.html";
  if (document.all._QQCss2) document.all._QQCss2.href=_GetCssPath();
}

//分类
function _QQ_FenLei(n){
if (window._QQ_FenLeiAry==null) return
if (_QQ_FenLeiAry[n])_W("<span class=s-tree-fenlei>"+_QQ_FenLeiAry[n]+"</span>")
}
__QQ_FenLei=_QQ_FenLei

function _QQ_FenLeiC(){}

function _QQ_FenLeiOption(){
if (window._QQ_FenLeiAry==null) return
for (var s="",i=0;i<_QQ_FenLeiAry.length;i++) 
	if (_QQ_FenLeiAry[i]) s+="<option value="+i+">"+_QQ_FenLeiAry[i];
_W("<option>"+s)
}

//如果是需要跳出窗口 的则输出target=_blank
function _QQ_target(){
 var f=_GetUrlFileName()
 if (_StartWith(f,"mybbs_new")) return
 if (_StartWith(f,"mybbs")||_StartWith(f,"dis")||_StartWith(f,"latest")||_StartWith(f,"search")){
 	var oDiv=document.createElement("BASE");
	oDiv.target="_blank"
	document.all.tags('HEAD')[0].appendChild(oDiv);
 }
}

//最新
var __Today=new Date();
__Today=new Date(__Today.getFullYear(),__Today.getMonth(),__Today.getDate())

function _DayDiff(d){
d=d.split(/[\/\-\s]/g)
return (__Today-new Date(d[0],d[1]-1,d[2]))/86400000
}

//4天 new
function _QQ_new(d){
  var n=_DayDiff(d);
  if ((n>=0)&&(n<4)) _W("<img src="+_5ilogJShost+"/qq/img/t1"+n+".gif width=35 height=16>")
}

//刷新new
function _QQ_new2(id){
  if (_isNew(id)) _W("<img width=28 height=11 src="+_5ilogJShost+"/qq/img/dot/new2.gif>")
}

//表情
function _QQ_BQ(n){ _W(_QQ_BQ_HTML(n)) }

function _QQ_BQ_HTML(n){
if ((n==0)||(n>66)) return ""
return "<img src="+_5ilogJShost+"/qq/img/bbs/"+n+'.gif>'
}

function _QQ_selfBiaoQing(n){_W(_QQ_selfBiaoQing_HTML(n))}
function _QQ_selfBiaoQing_HTML(n){
if ((n==0)||(n>_QQ_selfBiaoQingN)) return ""
return "<img src="+_Get_selfBiaoQingHome()+n+'.gif>'
}

function _Get_selfBiaoQingHome(){
if (_StartWith(_QQ_selfBiaoQingDir,"/")) {
	if (_StartWith(_QQ_selfBiaoQingDir,"/qq/")) return _5ilogJShost+_QQ_selfBiaoQingDir
	if (_StartWith(_QQ_selfBiaoQingDir,"/cgi-bin/mybbs/")) return _QQ_selfBiaoQingDir
	return "http://"+_GetImgHost()+_QQ_selfBiaoQingDir
}
return _QQ_selfBiaoQingDir.replace(/^http:\/\/w(\d)\.5ilog\.com\/(u\.aspx)?/i,"http://i$1.5ilog.com")
}

//显示在线人
function _disOnlineUsr(a){
   if (a==null) return
   var guoke=niming=0;
   for(var i=0;i<a.length-2;i+=2){
   	switch (a[i+1]){
   		case "n":
   			guoke++;
   			break;
   		case "":
   			niming++
   			break
   		default:
   			document.write("<a target=_self href=javascript:usrinfo('"
   				,a[i+1],"')>"
   				,a[i],"</a> ")
   	}//switch
   }//for
   if (guoke>0) document.write("过客",guoke,"人")
   if (niming>0) document.write("匿名",niming,"人")
}

function _DisOnlineUsrXML(xml,disobj){
var oxml
	if (xml.XMLDocument) 
		oxml=xml.XMLDocument
	else
		oxml=xml

var rootNodes=oxml.selectSingleNode("//usrs").childNodes
var s="",logname;
var guoke=niming=0;
for (var i=0;i<rootNodes.length;i++){
   	switch (logname=rootNodes.item(i).getAttribute("logname")){
   		case "n":
   			guoke++;
   			break;
   		case "":
   			niming++
   			break
   		default:
   			s+="<a target=_self href=javascript:usrinfo('"
   				+logname+"')>"+rootNodes.item(i).getAttribute("name")+"</a> "
   	}//switch
 }
   if (guoke>0) s+=" 过客"+guoke+"人"
   if (niming>0) s+=" 匿名"+niming+"人"
if (!disobj)disobj=xml
disobj.insertAdjacentHTML("beforebegin","<span class=default-online>"+s+"</span>")
}

//得到最后ID
function _getLID(){
	var lid=parseInt(_GetCookie("lid"));
	if (isNaN(lid)) return -1;
	return lid
}

var _QQ_LID=_QQ_MaxID=_getLID()
function _isNew(id){
	id=parseInt(id)
	if (id>_QQ_LID){
		if (id>_QQ_MaxID) {
			//重新设置
			_SetCookies("lid="+id,1)
			_QQ_MaxID=id
			}
		return true
	}
	return false
}

//简洁输出
function _W(s){document.write(s)}


//结尾带/
function GetCurrentFullPath(s){
	if (s==null)
		s=location+"";
	var i=s.indexOf("?")
	if (i>=0) s=s.substring(0,i)
	var i=s.lastIndexOf("/")
        if (i<0) return s;
	return s.substring(0,i+1)
}


function _QQPage(o,isAbsoluteLink,isNoLocal,space,base){
   if(!_checkIE5()) return
   open('/qq/sys/qqpage/qqpage2.htm?SetValue=document.all.'+o.uniqueID
   	+(isAbsoluteLink?"&isAbsoluteLink=1":"")+(isNoLocal?"&isNoLocal=1":"")
   	+(space?"&space="+escape(space):"")+(base?"&base="+base:"")
   	+(o.value?"&havehtml=1":"")
   	  ,'_blank',"status=0,menubar=0,resizable=1,scrollbars=0,width=700,height=550")
}

//o		返回对象
//liburl	选择图库 Lnnn,Innn,''
//ltype		图片连接类型 link,full,null
//base		连接base
//imgzoom		是否加入自动缩放,默认不加入
//havehtml 是否有默认html
function _QQPage2(o){
   open('/qq/sys/qqpage/qqpage2.htm?SetValue=document.all.'+o.o.uniqueID
   	+(o.liburl?"&liburl="+o.liburl:"")+(o.ltype?"&ltype="+o.ltype:"")
   	+(o.base?"&base="+o.base:"")+(o.imgzoom?"&imgzoom=1":"")
   	+(o.o.value?"&havehtml=1":"")
   	  ,'_blank',"status=0,menubar=0,resizable=1,scrollbars=0,width=700,height=550")
}
//值不能包含空格
function _ParseHTMLOBJ(s){
s=s.replace(/^<\w+|<\/\w+>$/g,"").replace(/\/?>$/g,"")
var a=s.split(/\s+/g)
var o=new Object()
for (var i=0;i<a.length;i++){
	var aa=/^(\w+)=(.*)$/.exec(a[i])
	if (aa) o[RegExp.$1.toLowerCase()]=RegExp.$2.replace(/^['"]|['"]$/g,"")
}
o.getAttribute=function(s){	return this[s]}
return o
}
function _TEXT2HTML(s){
return s.replace(/\r\n/g,"<BR>").replace(/  /g,"　")
}
//得到输入的HTML，如果是文本则转换回车等
function _GetHTML(o){
  //得到是否HTML的标志，为text的name + _html
  var sx=o.form.sx?o.form.sx:o.form[o.name+"_html"]

var s=o.value.replace(/<com5ilog:swf [^>]*\/>/gi, function($0) {
	return _Get5ilogSWF(_ParseHTMLOBJ($0)).html
      }
)

  if (sx){
  	if (sx.length){
  		if (sx[1].checked) return s
  	}else if (sx.checked) return s
  }
  	
	return _TEXT2HTML(s)
}


function _ReturnHTML2(o,v){
  o.value=v;
  var sx=o.form.sx?o.form.sx:o.form[o.name+"_html"]
  if (sx){
  	if (sx.length) sx=sx[1];
  	sx.checked=true
  }
}

//theInput 必须有value属性
//value　为初始html
//
function _qqpage(theInput,value){
   if(!_checkIE5()) return
   
   var w=open('/qq/sys/qqpage/qqpage.htm','_blank'
    	,"status=0,menubar=0,resizable=1,scrollbars=0,width=600,height=500")

    w.fromText=value
    w.fromWhere=theInput
}
//缺省的将返回放入传回object的value
function __ReturnHTML(w,html,theInput){
	if (theInput==null) return false
	theInput.value=html
	return true
}

function _checkIE5(){
if (IsIE5())return true
alert("必须用IE5或更高版本浏览器才能使用该功能！");
return false
}
function _checkIE4(){return _checkIE5()}
function _checkIE6(){
	return _getiever()>=6
}
function _checkIE55(){
if (!IsIE5())return false
}
function _getiever(){
	var t=window.navigator.userAgent.match(new RegExp("MSIE (\\d+\\.\\d+)"))
	return t?parseFloat(t[1]):0
}
	
function IsIE5(){
   return _getiever()>=5
}

//mylink
function _mylink(sn){
var o=window["_link_"+sn]
if (o==null) return

switch (o.linktype){
	case "menu":
		o.menuHTML=_mylinkHTML(o)
		if (o.fudong)
			_QQFuDong("<div class=qq-fudongmenu onmouseout=_HideMenu() onmouseover=_ShowTabMenu(_link_"
			+sn+".menuHTML)><a href=# onclick='return false'>"+o[1]+"</a></div>",o.top,o.left);
		else
		document.write("<a class=qq-menu onmouseout=_HideMenu() onmouseover=_ShowTabMenu(_link_"
			+sn+".menuHTML) href=# onclick='return false'>"+o[1]+"</a>")
		break;
	default:
		var s="";
		for (var i=0;i<o.length;i+=2)
			s+="<option value='"+o[i]+"'>"+o[i+1]
		s="<select onchange=_mylinkgo(this,'"+o.target+"')>"+s+"</select>"
		if (o.fudong)
			_QQFuDong(s,o.top,o.left);
		else document.write(s);
	
}//switch
}

//QQmylink
function _QQmylink(sn){
	var o=_GetMYBBSValue("linkset."+sn,false)
	if (!o) return
	if (o.target) o.dataArr.target = o.target
	if (o.putindaohang){ //放到导航栏里
		o.menuHTML=_mylinkHTML(o.dataArr)
		if (self["LinksetContainer"]) LinksetContainer.insertAdjacentHTML("beforeend","&nbsp;|&nbsp;<a class=qq-menu onmouseout=_HideMenu() onmouseover=_ShowTabMenu(_MYBBS.linkset[\""+sn+"\"].menuHTML) href=# onclick='return false'>"+o.dataArr[1]+"</a>")
		return
	} //if
	switch (o.showtype){
		case "menu":
			o.menuHTML=_mylinkHTML(o.dataArr)			
			if (o.fudong)
				_QQFuDong("<div class=qq-fudongmenu onmouseout=_HideMenu() onmouseover=_ShowTabMenu(_MYBBS.linkset[\""
				+sn+"\"].menuHTML)><a href=# onclick='return false'>"+o.dataArr[1]+"</a></div>",o.fudong.top,o.fudong.left);
			else
			document.write("<a class=qq-menu onmouseout=_HideMenu() onmouseover=_ShowTabMenu(_MYBBS.linkset[\""
				+sn+"\"].menuHTML) href=# onclick='return false'>"+o.dataArr[1]+"</a>")
			break;
		case "onelink": //单个连接
			document.write(_mylinkHTML2(o.dataArr))
			break;
		default:
			var s="";
			for (var i=0;i<o.dataArr.length;i+=2)
				s+="<option value='"+o.dataArr[i]+"'>"+o.dataArr[i+1]
			s="<select class='qqmylinksel linkset"+sn+"' onchange=_mylinkgo(this,'"+o.target+"')>"+s+"</select>"
			if (o.fudong)
				_QQFuDong(s,o.fudong.top,o.fudong.left);
			else document.write(s);
		
	}//switch
}//_QQmylink

//返回菜单的html内容
function _mylinkHTML(o){
var a="<nobr><a"
if (o.target!="default"){
	if (o.target) a+=" target='"+o.target+"'"
		else a+=" target=_blank"
}
a+=" href='"

var s="";
for (var i=2;i<o.length;i+=2)
	s+=a+o[i]+"'>"+o[i+1]+"</a></nobr><br>";
return s
}

function _mylinkHTML2(o){ //mylink onelink
var a="<a"
if (o.target!="default"){
	if (o.target) a+=" target='"+o.target+"'"
		else a+=" target=_blank"
}
a+=" href='"

var s="";
s+=a+o[2]+"'>"+o[3]+"</a>";
return s
}//_mylinkHTML2


function _mylinkgo(the,win){
if (the.value=="") return
switch (win){
	case "_top":top.location=the.value;break;
	case "_self":location=the.value;break;
	default:window.open(the.value);break;
}
}

//设置cookies
/*
  c	cookies值对
  expire
  	null	无过期
  	Dnnn	过期日
  	Hnnn	过期小时
  	nnn	过期月
  path	默认为/
*/
function _SetCookies(value,expire,path){
var s=value;
if (expire){
	var d = new Date()
	switch((expire+"").charAt(0)){
		case "D":
			d.setHours(24*expire.substr(1))
			break;
		case "H":
			d.setMinutes(60*expire.substr(1))
			break
		default:
			d.setDate(32*expire)
	}
	s+=";expires="+d.toGMTString()
}

document.cookie=s+_GetCookiesDomain()+";path="+_GetCookiesPath(path)
}

_SetCookies("_MM=1")

//清除cookie
function _ClearCookie(key,path,domain){
  var s=key+"=;expires=Mon, 28 Dec 1998 23:59:59 UTC"
  document.cookie=s+_GetCookiesDomain()+";path="+_GetCookiesPath(path)
}


//得到cookies的domain
function _GetCookiesDomain(domain){
if (domain) return ";domain="+domain
var d=document.domain.toLowerCase()
if (_EndWith(d,"5ilog.com")) return ";domain=5ilog.com"
if (_EndWith(d,"5iyinyue.com")) return ";domain=5iyinyue.com"
return ""
}

//得到cookies的path
function _GetCookiesPath(path){
if (path==null) return "/"
switch (path){
	case "currentpath":return GetCurrentFullPath(location.pathname)
}
return path
}

function _GetIntCook(name){
var i=parseInt(_GetCookie(name))
if (isNaN(i)) return -1
return i
}

function _GetCookie(c){
var t=document.cookie.split(";");
for (var i=t.length-1;i>=0;i--) {
	var tt=t[i].split("=");
	if (((tt[0].charAt(0)==" ")?tt[0].substring(1):tt[0])==c)
		return (tt[1])
 }
return null;
}
getcookies=_GetCookie

function newin(s,t,w,h,status){
window.open(s,(t)?t:"_blank","status="+(status?1:0)+",scrollbars=yes,menubar=0,resizable=1,width="+((w)?w:400)+",height="+((h)?h:300))
}


function init_QueryString(){
 var s1;
var s=document.location.search.substring(1);
 QueryString=new Object();
 s=s.split("&");
 for (var i=0,l=s.length;i<l;i++){
	s1=s[i].split("=");
	if (s1.length>1){
			var t=s1[1].replace(/\+/g," ")
			try{
				QueryString[s1[0]]=decodeURIComponent(t)
			}catch(e){
				QueryString[s1[0]]=unescape(t)
			}
		
		}
 }//for
}
init_QueryString();
var jinghua=(QueryString.j=="1")?1:0;


function _ViewLog(id,j){ //查看QQLog文章
j=(j==1)?"&j=1":""
	open('http://w0.5ilog.com/cgi-bin/bbs/club/v_log.aspx?lunquid=s&id='+id+j)
}
function _ViewClub(id,j){ //GG查看club文章
if (typeof(id)=="object"){
	id=_GetTieID(id.href)
}
	open(_5iloghost+'/cgi-bin/sys/link/view.aspx/'+id+'.htm'+(j?"?j=1":""))
}

//自动选择看贴连接
function _View(id,j,target){
if (typeof(id)=="object"){
	id=_GetTieID(id.href)
}
  if (j!=1) j=0;
  
  if (location.pathname.indexOf("/link/view.aspx")>=0){ //在clubv中的连接
  	_ViewClub(id,j)
  	return
  }
  
  var link="http://w0.5ilog.com/cgi-bin/sys/link/view.aspx/"+id+".htm"+(j?"?j=1":"")
  if (target=='_self') location=link
  	else open(link)
}

//看论坛
function _ViewLunTan(id,target){
  var link="http://w0.5ilog.com/cgi-bin/sys/link/luntan.aspx?id="+id;
  if (!target) target="_blank"
  if (target=="_self") location=link
  	else open(link,target)
}

//文集
function _WenJi(isNewWin,isMenuHidden,id,lognames,zixuan,sort){
var link
if ((lognames)&&(lognames.indexof(",")<0)){
	link="/cgi-bin/sys/link/wenji.aspx/"+lognames
	if (zixuan=="1") link +="/zixuan"
	link+=".htm"
	var s=""
	if (id){
		s="?id="+id
	}
	if (sort=="1") {
		if (s) s +="&o=1"
			else s="?o=1"
	}
	link+=s

}else{
  link="/cgi-bin/sys/bbs/bbs_f.asp?type=search"
  if (isMenuHidden) link +="&menuhidden=1"
  var s="id="+id
  if (lognames) s+="&logname="+lognames
  if (zixuan=="1") s+="&z=1"
  if (sort=="1") s+="&o=1"
  link += "&s="+escape(s)
}

  if (isNewWin)  window.open(link)
    else location=link
}

function _MyJiFen(){
 newin("/cgi-bin/club/jifen/my_jifen.aspx","",450,170);
}

function _Vote(id,jinghua){
 if (jinghua==null)jinghua="1"
 newin("/cgi-bin/usr/vote.aspx?id="+id+"&j="+jinghua,null,400,500);
}

function _TuiJian(id){
 newin("/cgi-bin/sys/bbsadmin/tuijian.aspx?id="+id,null,750,600);
}

function _DisVote(id,jinghua){
 if (jinghua==null)jinghua="1"
 newin("/cgi-bin/sys/bbs/vote.asp?act=list&id="+id+"&j="+jinghua);
}

function _BBSAdmin(id,jinghua,isfull){
var u="/cgi-bin/bbs/admin/nview_update"
if (location.host=="www.5ilog.com") u="http://w1.5ilog.com"+u
if (isfull) u+="full"
 window.open(u+".asp?id="+id+(jinghua?"&j=1":""));
}

function delbulletin(id,lunquid){
if (confirm("删除第"+id+"帖子？"))
 newin("/cgi-bin/class/BBS/Admin.aspx?act=delete&autogo=autoclose&id="+id+(lunquid?"&lunquid="+lunquid:""));
}
function _AdminLunquSpace(subject,body){
newin("/qq/about/tmp/shenqingshoufei.htm?subject="+subject,null,600,500);
}
function _AdminUsrSpace(subject,body){
_AdminLunquSpace(subject,body)
}
function _AdminLunquBaoliu(subject,body){
_express('flyingheart',subject,body)
}


function _express(tologname,subject,body,fromlogname){
var link=""
if (tologname) link+="tologname="+tologname

if (subject) link+="&subject=" + subject
if (body) link+="&body=" + body
if (fromlogname) link+="&logname=" + fromlogname

newin("http://w0.5ilog.com/qq/myqq/express/send.html?"+link,null,640,520);
}

function _ViewExpress(){newin("http://w0.5ilog.com/qq/myqq/express/index.html",null,682,445);}

function express_admin(){newin("http://w0.5ilog.com/qq/myqq/express/index.html",null,682,445);}

function usrinfo(s,id){
 if (s=="n"){alert("匿名用户无法查看档案！");return}
  if ((s=="?")&&(id)) newin(_w0cgi+"club/magic/magic.aspx?did=210&tid="+id,null,600,250)
  else window.open(_w0cgi+"sys/link/Home.aspx?logname="+s+"&maintype=JBXX");
}

function Login(autogo){
  if (autogo) autogo="?autogo="+autogo; else autogo=""
  newin('/qq/myqq/autolog.htm'+autogo,'_blank',333,220)
}

function ViewImg(id){  window.open("/cgi-bin/sys/link/viewimg.aspx?id="+id);}

function _Magic(tType,tid){newin("/cgi-bin/club/magic/magic.aspx?targetType="+tType+"&tid="+tid,null,600,430);}

function AddFriend(uid){  newin("/cgi-bin/class/Friends/Friends.aspx?act=add&uid="+uid);}
function _AddFriend(logname){  newin("/cgi-bin/class/Friends/Friends.aspx?act=addbylogname&lognames="+logname);}



//如果是数组则返回，否则封装到数组中
function ToArray(a){
  if (a.length==null)
     return new Array(a)
  else
     return a
}

//选择所有checkbox
function _selAllCheckBox(theCheckBox){
if (theCheckBox==null) return
var ids=ToArray(theCheckBox);
for (var i=0,l=ids.length;i<l;i++)
        ids[i].checked=true;
}

//不选择所有checkbox
function _unselAllCheckBox(theCheckBox){
if (theCheckBox==null) return
var ids=ToArray(theCheckBox);
for (var i=0,l=ids.length;i<l;i++)
        ids[i].checked=false;
}

//选择相反checkbox
function _selFanCheckBox(theCheckBox){
if (theCheckBox==null) return
var ids=ToArray(theCheckBox);
for (var i=0,l=ids.length;i<l;i++)
        ids[i].checked=!ids[i].checked;
}

//检查是否选择了
function _checkSelCheckBox(theCheckBox){
if (theCheckBox==null) return
var ids=ToArray(theCheckBox);
for (var i=0,l=ids.length;i<l;i++)
        if (ids[i].checked) return true;

return false
}

//字符串开始
function _EndWith(s,s1){
  if (s1.length>s) return false;
  return (s.substr(s.length-s1.length).toLowerCase()==s1.toLowerCase())
}

//字符串结束
function _StartWith(s,s1){
  return (s.substr(0,s1.length).toLowerCase()==s1.toLowerCase())
}

//得到url中文件名
function _GetUrlFileName(url){
  if (url==null) url=location.pathname;
  var i=url.lastIndexOf("/")
  if (i>=0) url=url.substr(i+1)
  i=url.indexOf("?")
  if (i>=0) url=url.substring(0,i-1)
  return url
}

//找到第一个parent
function _FindParentTag(e,tagname){
for(e=e.parentNode;e.tagName!="BODY";e=e.parentNode)
	if (e.tagName==tagname) return e;
return null
}

function _Face(logname,faceStr,homeid){
if (faceStr == "") return ""
switch(faceStr.charAt(0)){
	case "S":
               return "<img border=0 src=http://"+_GetImgHost(homeid)+ _GetUsrHomeUrl(logname) + "/sys/i." + faceStr.substr(1) + ">"
        case "F":
               return "<a target=_blank href=" + _GetUsrHomeUrl(logname) + faceStr.substr(1) + "><img border=0 src=http://"
               +_GetImgHost(homeid)+ _GetUsrHomeUrl(logname) + "/sys/s" + faceStr.substr(1) + ".jpg></a>"
        case "J":
                return "<img border=0 src="+_5ilogJShost+"/qq/img/face/" + faceStr + ".jpg>"
	default:
                return "<img border=0 src="+_5ilogJShost+"/qq/img/face/" + faceStr + ".gif>"
}//switch
}//face

function _GetHomeUrl(logname){
	var i=logname.indexOf("@")
	if (i>=0){
		var d=logname.substr(i+1)
		logname=logname.substr(0,i)
		return "/u/oo/"+d.charAt(0)+"/"+d+"/"+logname.charAt(0)+"/"+logname.charAt(1)+"/"+logname
	}
	return "/u/"+logname.charAt(0)+"/"+logname
}
_GetUsrHomeUrl=_GetHomeUrl

function _GetMyBBSDingUrl(bbsname){
	if (bbsname.charAt(0)=="~"){ 
	        var i = bbsname.indexOf("@")
        	if (i >= 0){
            		var d=bbsname.substr(i + 1)
            		bbsname = bbsname.substr(1, i - 1)
            		return "/cgi-bin/log/oo/"+d.charAt(0)+"/"+d
            			+"/"+bbsname.charAt(0)+"/"+bbsname.charAt(1)+"/"+bbsname+"/"
            	}else
            		return "/cgi-bin/log/"+bbsname.charAt(1)+"/"+bbsname.charAt(2)+"/"+bbsname.substring(1)+"/"
	}
	return "/cgi-bin/mybbs/"+bbsname.charAt(0)+"/"+bbsname+"/"
}

//得到root论区
function GetRootLunQu(id){
if (id>0x70000000) return id
return _IsMyBBS(id)? id&0x7fffff00 : id&0xff000
}

function _IsMyBBS(id){
return ((id>0x40000000)&&(id<0x50000000))
}

function _DisableNextClick(btn){
 btn.disabled=true
 if (btn.form.onsubmit) 
 	if (!btn.form.onsubmit()) {
 	 	btn.disabled=false
 		return false
	}
 
 btn.value='请耐心等待...'
 btn.form.submit()
}

//菜单

//隐藏menu
function _HideMenu() {
if (!document.getElementById("_menuDiV")) return 
var e=window.event.toElement
if (!e)return
if (!_menuDiV.contains(e)){
		//alert(e.outerHTML)
		_menuDiV.style.display="none"
		}
}

//显示一个表格菜单
//tabCSSClass		如果提供则使用该类标记菜单table
function _ShowTabMenu(menuContentHTML,shadowColor,shadowSize,tabCSSClass,align){
_ShowMenu("<table id=_subMenU cellspacing=1 cellpadding=3 class="+(tabCSSClass?tabCSSClass:"menutab")
	+"><tr><td nowrap align=left class=menutd>" 
		+ menuContentHTML + "</td></tr></table>",align);
_DropShadow(_subMenU,shadowColor?shadowColor:"#999999", shadowSize?shadowSize:3)
}

//menuContentHTML		菜单内容
//align		对齐方式，默认左，right
function _ShowMenu(menuContentHTML,align) {
var vSrc = window.event.srcElement;

var h = vSrc.offsetHeight;
var w = vSrc.offsetWidth;
var l = vSrc.offsetLeft  -1;
var t = vSrc.offsetTop +  h -4;
var vParent = vSrc.offsetParent;

while (vParent && (vParent.tagName.toUpperCase() != "BODY")){
		l += vParent.offsetLeft-vParent.scrollLeft
		t += vParent.offsetTop-vParent.scrollTop
		vParent = vParent.offsetParent;
}

if (document.all._menuDiV==null)
	_insertHTML("<div id=_menuDiV style='Z-INDEX: 2000; width:1px;height:1px;display:none;POSITION: absolute;'></div>")

_menuDiV.innerHTML = menuContentHTML;
_menuDiV.style.top = t+"px";
if (align=="right"){
	_menuDiV.style.display = "block";
	var t=_menuDiV.offsetWidth
	if (t==1){
		if(_menuDiV.childNodes.length>0)
			t=_menuDiV.childNodes(0).offsetWidth
		else t=200
	}
	_menuDiV.style.left =(l-t+w)+"px";
}else
	_menuDiV.style.left =(align?l-w:l)+"px";
_menuDiV.style.display = "block";
_menuDiV.onmouseout=_HideMenu
}

function _DropShadow(el, color, size){
for (var 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);
}//for
}


/*浮动元素
html	浮动的html内容
top	上
left	左
strCss 自定义的css
*/
function _QQFuDong(html,top,left,strCss){
if (self._QQFuDongAry==null) self._QQFuDongAry=new Array();
var n=_QQFuDongAry.length;

if (!(document.body)) return
if (strCss){
	if(!document.all.tableFuDong){ //还没有基准的表格
		_insertHTML("<table cellspacing=0 cellpadding=0><tr><td height=0 id=tableFuDong></td></tr></table>")
	}
	tableFuDong.insertAdjacentHTML("afterbegin",
	"<dl id=_QQFuDong"+n
	+" style='"+strCss+";width:1px;height:1px;POSITION: absolute;'><nobr>"
	+html+"</nobr></dl>")
}
else{
	html="<dl id=_QQFuDong"+n
	+" style='left:"+left+";top:"+top+";width:1px;height:1px;POSITION: absolute;'><nobr>"
	+html+"</nobr></dl>"
	_insertHTML(html)
}
_QQFuDongAry[n]=new Object()
_QQFuDongAry[n].x=0;
_QQFuDongAry[n].y=0;
_QQFuDongAry[n].fudongObject=document.all["_QQFuDong"+n];

window.setInterval("_QQFuDongMove("+n+")",10)
}

function _insertHTML(html){
	if (document.body)
		document.body.insertAdjacentHTML("afterbegin",html)
	//else	document.write(html)
}

function _QQFuDongMove(i) { 
var percent;
var XY=_QQFuDongAry[i]
diffY = document.body.scrollTop;
if(diffY != XY.y)  {
	percent = .1 * (diffY - XY.y);      
 	percent =(percent > 0)?Math.ceil(percent):Math.floor(percent);  
 		
 	XY.fudongObject.style.pixelTop += percent;
	XY.y += percent;
}

diffX = document.body.scrollLeft; 
if(diffX != XY.x) {
 	percent = .05 * (diffX - XY.x);
 	percent =(percent > 0) ?Math.ceil(percent):Math.floor(percent); 
 	
 	XY.fudongObject.style.pixelLeft += percent;
	XY.x +=  percent;
 }
}//_QQFuDongMove


/*游走元素
*/
function _QQChip(html,speed,vmin,vmax,vr){
if (self._QQChipAry==null) self._QQChipAry=new Array();

var n=_QQChipAry.length;
html="<dl id=_QQChip"+n
	+" onmouseover='_QQChipAry["+n+"].stop=true' onmouseout='_QQChipAry["+n+"].stop=false' style='Z-INDEX: 2;left: 10px; top: 10px;POSITION: absolute;'>"
	+html+"</dl>"

_insertHTML(html)


_QQChipAry[n]=new _QQChipObject(n,100,100,html)


window.setInterval("_QQChipMove("+n+")",speed?speed:120)
}

//游走object
function _QQChipObject(n,width,height,html,vmin,vmax,vr){
 this.chipObject=function(){
 	return document.all["_QQChip"+n]
 	}
 this.html=html
 
 this.vmin=vmin=vmin?vmin:2
 this.vmax=vmax=vmax?vmax:5
 this.vr=vr=vr?vr:2
 
 this.vx=vmin+vmax*Math.random();
 this.vy=vmin+vmax*Math.random();
 this.w=width;
 this.h=height;
 this.xx=10;
 this.yy=10;
 this.stop=false
}

//移动 
function _QQChipMove(i){
with (_QQChipAry[i]){
if (!chipObject()){
	_insertHTML(html)
	return
}

if (stop) return
var b=window.document.body
var pageX=b.scrollLeft;
var pageW=b.offsetWidth;
var pageY=b.scrollTop;
var pageH=b.offsetHeight;

 xx+=vx;
 yy+=vy;
 
 vx+=vr*(Math.random()-0.5);
 vy+=vr*(Math.random()-0.5);
 if(vx>(vmax+vmin))  vx=(vmax+vmin)*2-vx;
 if(vx<(-vmax-vmin)) vx=(-vmax-vmin)*2-vx;
 if(vy>(vmax+vmin))  vy=(vmax+vmin)*2-vy;
 if(vy<(-vmax-vmin)) vy=(-vmax-vmin)*2-vy;
 if(xx<=pageX){
  xx=pageX;
  vx=vmin+vmax*Math.random();
 }
 if(xx>=pageX+pageW-w){
  xx=pageX+pageW-w;
  vx=-vmin-vmax*Math.random();
 }
 if(yy<=pageY){
  yy=pageY;
  vy=vmin+vmax*Math.random();
 }
 if(yy>=pageY+pageH-h){
  yy=pageY+pageH-h;
  vy=-vmin-vmax*Math.random();
 }

  chipObject().style.pixelLeft=xx
  chipObject().style.pixelTop =yy
  
}//with
}

function _isQQ(){
 return location.host.toLowerCase().indexOf("5ilog.com")>=0
}


//v	返回时保存到的变量	类似：theform.input.value
//url	打开的页面
//w,h   窗口的宽度和高度
function _GetPopUpValue(v,url,w,h){
if (url.indexOf("?")>=0) url+="&"
	else url+="?"
 url+="SetValue="+v
 for (var i=4;i<arguments.length;i++){
  	url+="&SetValue"+(i-3)+"="+arguments[i]
  }
 _CreatePopUpDiv({url:url,w:w,h:h})
 //newin(url,null,w,h)
}

//不在点击位置弹窗口
//指定top,left位置弹
//isappend是否添加值，默认是改写
//url
//v
//isnothit
function _GetPopUpValue2(o){
if (o.url.indexOf("?")>=0) o.url+="&"
	else o.url+="?"
 o.url+="SetValue="+o.v

if (o.isappend) o.url+="&isappend=1"

if (o.ary) 
 for (var i=0;i<o.ary.length;i++){
  	o.url+="&SetValue"+(i+1)+"="+o.ary[i]
  }
  
_CreatePopUpDiv(o)
}
//url
//w,h
//isnothit	true，固定位置，否则根据点记地方
//top,left	如果固定，则提供的弹出位置
//disableclickhide
function _CreatePopUpDiv(o){ //弹出frame
	if (self._QQPopUpDivDataObj && _QQPopUpDivDataObj._hasQQPopUpDiv) _CloseQQPopUpDiv() //如果已经有了窗口则将其关掉
	if (!o.w) o.w = 400
	if (!o.h) o.h = 300

	var po = null
	if ( (!o.isnothit) && event) po = _QQGetAbsPosition(event.srcElement)
	if (po)	{
		 o.top = po.top
		 o.left = po.left
		if (o.top<0) o.top = "0px"
		if (o.left<0) o.left = "0px"
	}else{
		 if (o.top==null) o.top = "100px"
		 if (o.left==null) o.left = "100px"
	}
	var styleOver = 'this.style.border="1px solid";this.style.borderColor="#eee #aaa #aaa #eee"'
	var styleOut = 'this.style.border="1px solid #0099FC"'
	var mhtm="onmouseover='"+styleOver+"' onmouseout='"+styleOut+"'"
	
	var style = 'style="border: 1px solid; border-color:#0099FC; padding-top: 18px; width: '
		+o.w+'; height: '+o.h+'; z-index: 99; position: absolute; left: '+o.left+'; top: '+o.top+'"'

  var imghead='<img width=10 height=10 src="'+_5ilogJShost+"/qq/img/windowicon/"
	var span1='<span style="border:1px solid #0099FC" '+mhtm+'>'+imghead
	var maxhtm=span1+'fullsize.gif" alt="最大化" onclick="_QQPouUpDivMaximize()"></span>'
	var minhtm=span1+'minisize.gif" alt="最小化" onclick="_QQPouUpDivMinimize()"></span>'
	var orghtm=span1+'originsize.gif" alt="还原" onclick="_QQPouUpDivToOrigin()"></span>'
	var span2=span1+'close.gif" alt="关闭" onclick="_CloseQQPopUpDiv()"></span></span>'
			
	var str = '<div id=_QQPopUpDiv '+style+'>'
			+ '<div ondblclick="_QQPouUpDivDBLClick()" style="position: absolute; top: 0px; background: #0099FC; text-align: right; border-bottom: #0073C8 solid 1px; padding:1px; height: 18px; width: 100%; cursor: move; color: white; font-size: 12px;"><span style="position: absolute; left: 5px; top: 0px;" id="_QQPopUpDivLoading">'+(o.title?o.title:'Loading...')+'</span>'
			+ '<span style="cursor: default; display: none;" id=_QQPopUpDivIconMax>'
			+minhtm+orghtm+span2
			+ '<span style="cursor: default" id=_QQPopUpDivIconOrigin>'
			+minhtm+maxhtm+span2
			+ '<span style="cursor: default; display: none;" id=_QQPopUpDivIconMini>'
			+orghtm+maxhtm+span2
			+ '</div><span style="width: 100%; height: 100%;" id=_QQPopUpIFrameSpan><iframe name=_QQPopUpIFrame onload="try{_QQPopUpDivLoading.innerText=_QQPopUpIFrame.document.title}catch(e){}" style="width: 100%; height: 100%;" src="'
			+o.url+'" frameborder=0 scroll='+(o.scroll?o.scroll:"auto")+'></iframe></span>'
			+ '</div>'
			+ '<div id="_QQPopUpResizer" style="z-index:100; position: absolute; top: '
			+(o.top+o.h)+'px; left: '+(o.left+o.w-12)
			+'px; cursor: nw-resize;" title="拖动改变窗口大小" onmousedown="_QQPopUpDivDataObj._needHideQQPopUpDiv=false;_QQPopUpDivDataObj._miniQQPopUpDiv=false" onmouseup="setTimeout(\'_QQPopUpDivDataObj._needHideQQPopUpDiv=true;_QQPopUpDivDataObj._miniQQPopUpDiv=true\',10)">'
			+imghead+'move.gif"></div>'
if (self._QQPopDIVParent){
	_QQPopDIVParent.innerHTML=str
}else{
	_insertHTML("<div id=_QQPopDIVParent>"+str+"</div>")
}
	if (parent._QQPopUpDivDataObj)
		if (parent._QQPopUpDivDataObj._hasQQPopUpDiv) parent._QQPouUpDivMaximize() //父窗口最大化
	_QQPopUpDivDataObj = new Object() //声明全局对象保存信息用
	setTimeout("_QQPopUpDivDataObj._hasQQPopUpDiv = true;_QQPopUpDivDataObj._miniQQPopUpDiv = true;_QQPopUpDivDataObj._needHideQQPopUpDiv=true;", 10)
	setTimeout("moveobj_QQPopUpDiv = new _QQMovePopUp(_QQPopUpDiv)", 100)
	setTimeout("moveobj_QQPopUpResizer = new _QQMoveResizer(_QQPopUpResizer);", 100)
	setTimeout("_SetQQPopUpResizerPos();", 100)
}//_CreatePopUpWin

function _QQPouUpDivMinimize(){
var o=_QQPopUpDivDataObj
	if (!o._miniQQPopUpDiv) return //如果是新建PopUpDiv则不做最小化操作
	var oDiv = self._QQPopUpDiv
	_QQPopUpIFrameSpan.style.display = "none" //隐藏iframe
	_QQPopUpResizer.style.display = "none" //隐藏_QQPopUpResizer
	_QQPopUpDivShowIcon(1)
	if ( (o.state != 3) && (o.state != 1) ) _QQPopUpDivSetOriginData() //设置当前原始信息
	o.state = 1
	var w=200,h=19
	var s=oDiv.style
	s.width = w
	s.height = h
	s.top = document.body.scrollTop
	s.left = 0
	_SetQQPopUpResizerPos()
}//_QQPouUpDivMinimize

function _QQPouUpDivToOrigin(){
var o=self._QQPopUpDivDataObj
	var oDiv = _QQPopUpDiv.style
	_QQPopUpDivShowIcon(2)
	if (o) o.state = 2
	_QQPopUpIFrameSpan.style.display = "" //显示iframe	
	_QQPopUpResizer.style.display = "block" //显示_QQPopUpResizer
	var t=	o.OriginData
	oDiv.top = t.top
	oDiv.left = t.left
	oDiv.width = t.width
	oDiv.height = t.height
	_SetQQPopUpResizerPos()
}//_QQPouUpDivMinimize

function _QQPouUpDivMaximize(){
	var oDiv = self._QQPopUpDiv.style
	_QQPopUpDivShowIcon(3)
	if ( _QQPopUpDivDataObj.state != 1 ) _QQPopUpDivSetOriginData() //设置当前原始信息
	_QQPopUpDivDataObj.state = 3
	oDiv.top = 20 + document.body.scrollTop
	oDiv.left = 10
	oDiv.width = "96%"
	oDiv.height = "90%"
	_QQPopUpIFrameSpan.style.display = "" //显示iframe	
	_QQPopUpResizer.style.display = "block" //显示_QQPopUpResizer
	_SetQQPopUpResizerPos()
}//_QQPouUpDivMinimize

function _QQPouUpDivDBLClick(){ //双击工具条
	if ( _QQPopUpDivDataObj.state != 3 ) _QQPouUpDivMaximize()
	else _QQPouUpDivToOrigin()
}//_QQPouUpDivDBLClick()

function _QQPopUpDivShowIcon(n){ //显示菜单icon
	_QQPopUpDivIconMax.style.display = "none"
	_QQPopUpDivIconOrigin.style.display = "none"
	_QQPopUpDivIconMini.style.display = "none"
	switch (n)
	{
		case 1:_QQPopUpDivIconMini.style.display = "block"
		break
		case 2:_QQPopUpDivIconOrigin.style.display = "block"
		break
		case 3:_QQPopUpDivIconMax.style.display = "block"
		break
		default:
		break
	}	
}//_QQPopUpDivShowIcon

function _QQPopUpDivSetOriginData(){ //设置还原状态的信息
	var t=_QQPopUpDivDataObj.OriginData
	if (!t) t=_QQPopUpDivDataObj.OriginData = new Object()
	t.top = _QQGetAbsPosition(_QQPopUpDiv).top
	t.left = _QQGetAbsPosition(_QQPopUpDiv).left
	t.width = _QQPopUpDiv.offsetWidth
	t.height = _QQPopUpDiv.offsetHeight
}

function _CloseQQPopUpDiv(){//关闭PopUpDiv
	if (!_QQPopUpDivDataObj._hasQQPopUpDiv) return
	if (!_QQPopUpDivDataObj._needHideQQPopUpDiv) return
	_QQPopDIVParent.innerHTML=""
	_QQPopUpDivDataObj=new Object() //._hasQQPopUpDiv = false
}

function _SetQQPopUpResizerPos(){//设置QQPopUpResizer位置
	_QQPopUpResizer.style.top=_QQGetAbsPosition(_QQPopUpDiv).top+_QQPopUpDiv.offsetHeight-12
	_QQPopUpResizer.style.left=_QQGetAbsPosition(_QQPopUpDiv).left+_QQPopUpDiv.offsetWidth-12
}//_SetQQPopUpResizerPos

//返回当前值
function _GetCurPopValue(name){
  if (QueryString.SetValue==null){
  	alert("SetValue没有设置！")
  	return 
  	}
  if (self==top){
	var s="window.opener."
  }else{
	var s="window.parent."
  }
  s+=QueryString.SetValue
  var o=eval(s)

  if (typeof(o)=="object"){
  	//如果是对象，提供的是ID
  	//调用getDefaultValue方法，参数为ID
  	var func=o.getDefaultValue
  	
  	if (func) return eval("window.parent."+func+"("+s+",'"+(name?name:"")+"')")
  	
  	//没有提供方法则直接获得属性
  	if (name) return o[name]
  	//默认为value
  	return o.value
  }else{
  	//否则直接返回值
  	return s
  }
}

//返回值
function _PopValue(v){
  if (QueryString.SetValue==null){
  	alert("SetValue没有设置！")
  	return 
  	}
  if (self==top){
	var ss="window.opener."
  }else{
	var ss="window.parent."
  }

  //其他则只直接放值 
  var v2="";
  for (var i=1;i<arguments.length;i++){
  	v2=(arguments[i]+"") 
  	if (!document.all){
  		var t=QueryString["SetValue"+i]
  		var j=t.indexOf(".")
  		var tt
  		if (j>0)
  			tt=ss+"document.getElementById(t.substr(0,j))"+t.substring(j)
  		else
  			tt=ss+"document.getElementById(t)"
  		
  		eval(tt+"=v2")

  	}else
			eval(ss+QueryString["SetValue"+i]+"=v2")
  }

var t=QueryString.SetValue
var s=ss+t

var i=t.indexOf(".")
if (!document.all){
 		if (i>0) s=ss+"document.getElementById(t.substr(0,i))"+t.substring(i)
 			else s=ss+"document.getElementById(t)"
}

var o=eval(s)
if (typeof(o)=="object"){
  	//如果是对象，提供的是ID
  	//调用onchangeValue方法，第一个参数为ID，第二个为值
 	var func=o.getAttribute("onchangeValue")
	if (func) eval(ss+func+"("+s+",v)")
	else {
		if (QueryString.isappend)
			o.value += v;
		else	o.value = v;
	}
}else{
  	//否则直接将值放入
  	if (QueryString.isappend)
  		eval(s+"+=v");
  	else eval(s+"=v")
}

if (self==top) window.close()
  else parent._CloseQQPopUpDiv()
}

//换页
function _PopNextPage(url){
if (url.indexOf("?")>=0) url+="&"
	else url+="?"

 url+="SetValue="+QueryString.SetValue;
 for(var i=1;QueryString["SetValue"+i]!=null;i++)
 	url+="&SetValue"+i+"="+QueryString["SetValue"+i]
 
 location=url

}

//短路径
function _GetShortPath(sPath){
	return sPath.replace(/^http:\/\/w\d*\.5ilog\.com/gi,"");		
}//_QQ_ReturnPath

function _CheckEmail(s){
var reg=new RegExp("^(\\w|\\-|\\.)+\\w@(\\w|\\-)+(\\.(\\w|\\-)+)*\\.[A-Za-z]{2,}$");
return(reg.test(s));
}

function _QQBookmark(){
	newin(_w0cgi+"myqq/link/showLink.aspx",null,400,600,1);
}
function _QQMoveDiv (divID){
	if (!divID) return null
	var _this = this
	_this.objForMove = divID //移动对象
	this.mousedown = function(){		
		_this.objForMove.setCapture()
		_this.needMove = true
		_this.currentX = (event.x - _this.objForMove.style.pixelLeft) //保存当前位置
		_this.currentY = (event.y - _this.objForMove.style.pixelTop) //保存当前位置
		_this.currentEventX = event.x //保存当前位置
		_this.currentEventY = event.y //保存当前位置
	}//mousedown
	this.mouseup = function(){
		_this.needMove = false
		_this.objForMove.releaseCapture()
	}//mouseup
	this.mousemove = function(){
		if (!_this.needMove) return
		_this.objForMove.style.left=event.x-_this.currentX
		_this.objForMove.style.top=event.y-_this.currentY
	}//mousemove
	divID.attachEvent("onmousedown",this.mousedown)
	divID.attachEvent("onmouseup",this.mouseup)
	divID.attachEvent("onmousemove",this.mousemove)
}//_QQMoveDiv

function _QQMoveResizer (divID){ //继承自_QQMoveDiv
	_QQMoveDiv.call(this,divID)
	var _this = this
	divID.detachEvent("onmouseup",this.mouseup)
	this.mouseup = function(){
		_this.needMove = false
		_QQPopUpDiv.style.pixelWidth += (event.x-_this.currentEventX)
		_QQPopUpDiv.style.pixelHeight += (event.y-_this.currentEventY)
		_this.objForMove.releaseCapture()
	}//mousemove
	divID.attachEvent("onmouseup",this.mouseup)
}//_QQMoveResizer

function _QQMovePopUp (divID){//继承自_QQMoveDiv
	_QQMoveDiv.call(this,divID)
	var _this = this
	divID.detachEvent("onmousemove",this.mousemove)
	this.mousemove = function(){
		if (!_this.needMove) return
		_this.objForMove.style.left=event.x-_this.currentX
		_this.objForMove.style.top=event.y-_this.currentY
		_SetQQPopUpResizerPos()
	}//mousemove
	divID.attachEvent("onmousemove",this.mousemove)
}//_QQMovePopUp

function _QQGetAbsPosition(o){ //获得对象在页面中的绝对位置
	var vParent = o
	var l=0,t=0
	while (vParent.tagName.toUpperCase() != "BODY"){
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}
	return {left:l,top:t}
}//_QQGetAbsPosition

function _ATiao(){
	var o=window.event.srcElement
	o.style.position='relative';
	o.style.top='2px'
	o.attachEvent("onmouseout",_ATiaoRestore)
	
}
function _ATiaoRestore(){
var o=window.event.fromElement
o.style.top='0px'
o.detachEvent("onmouseout",_ATiaoRestore)
}


function _GetRQ(s){
var a=s.split(/[\-\/]/g)
if (a.length==3) 
	this.rq=new Date(a[0],a[1]-1,a[2])
else this.rq=new Date()

this.Week=function (){switch(this.rq.getDay()){case 0:return "星期日";case 1:return "星期一";case 2:return "星期二";case 3:return "星期三";case 4:return "星期四";case 5:return "星期五";case 6:return "星期六"}}
this.Weeken=function (){switch(this.rq.getDay()){case 0:return "Sunday";case 1:return "Monday";case 2:return "Tuesday";case 3:return "Wednesday";case 4:return "Thursday";case 5:return "Friday";case 6:return "Saturday"}}
this.Month=function (){return this.rq.getMonth()+1}
this.toString=function(){return this.rq.getFullYear()+"-"+(this.rq.getMonth()+1)+"-"+this.rq.getDate()}
return this
}

function _QQPic(theP){
	var ow=theP.getAttribute("_ow")
	if (!ow) {
		theP._ow=theP.width
		var m=364;
		if (self._QQPicMargin) m=_QQPicMargin
		var w=document.body.clientWidth-m
		if (theP.width>w){
			theP.width=w
			theP.title="滚动鼠标轮放大/缩小图片"
		}
		
		theP.onmousewheel=function(){_QQPic(this);return false}
		theP.onload=null
		
		return false
	}
	
	var zoom=parseInt(theP.style.zoom,10)||100;
	zoom+=event.wheelDelta/12;
	if (zoom>0) theP.style.zoom=zoom+'%';
}
function _ZoomImgOnload(theimg,width){
if (!width) width=150
if ((theimg.width==0)||(theimg.width>width)) theimg.width=width
theimg.onload=null
}

function _GetYahooSearch(){
return '<iframe id=_OtherSearchForm border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="no" width="468" height="60" src="http://u.114.com.cn/show/us.php?userid=59&width=468&height=60&ismargin=0&border=trans&link=0000FF&bg=FFFFFF&twidth=253&class=s46860&"></iframe>'
}

function _isZhanWai(){
if (!document.referrer) return false
var r=_GetHost(document.referrer).toLowerCase()
if (_StartWith(r,"1")) return false
return !_EndWith(r,"5ilog.com")
}


function _GetXmlDoc(){
if (_getiever()) {
	var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	xmlDoc.async = true;
	return xmlDoc
}
var xmlDoc=document.implementation.createDocument("text/xml","",null);
return xmlDoc
}

function _SetXMLOnload(xmlDoc,ONLOAD){
if (document.all) xmlDoc.onreadystatechange=ONLOAD
else {
	xmlDoc.onload=ONLOAD
	xmlDoc.readyState=4
	}
}

function _GetXMLData(oXmlurl,f,disobj){
var xmlDoc=_GetXmlDoc()
xmlDoc.load(oXmlurl);
var _disobj=disobj
_SetXMLOnload(xmlDoc,function(){
	if (xmlDoc.readyState!=4) return;
	f(xmlDoc,_disobj)
})
}
function _GetXMLDataSync(oXmlurl){
	if (_getiever()) {
	var xmlDoc=_GetXmlDoc()
	xmlDoc.async=false
	xmlDoc.load(oXmlurl);
	return xmlDoc
	}

	      var h = new XMLHttpRequest()
        h.open('GET', oXmlurl,false)
        h.send()
        return h.responseXML
}

function _isShiMingUsr(){
var bz=_GetIntCook("QQBZ")
if (bz<0) return false
if (bz&0x400) return true
return false 
}

function _isgoodusr(){
if (_isShiMingUsr()) return true
var tn=_GetIntCook("QQTN")
var ln=_GetIntCook("QQLN")
if ((tn>=0)&&(ln>=0)){
	var m=Math.max(tn,ln)
	if (m>10){
		return true
	}
}
return false 
}

function _isSEO(){
var r=document.referrer
if (!r) return false
r=_GetHost(r).toLowerCase()
if ( (r.indexOf("baidu")>0)||(r.indexOf("yahoo")>0)||(r.indexOf("google")>0)||(r.indexOf("soso")>0)
	||(r.indexOf("sogou")>0) )
	return true
return false
}
function _MaxWin(){
if (self!=top) return
top.moveTo(0,0)
top.resizeTo(screen.availWidth,screen.availHeight)
}


function _GetTagSearchForm(k){
k=k?k:""
return '<form action=/cgi-bin/sys/link/tielist.aspx id=_tagSearchForm style="margin:5px;" onsubmit="if (!this.k.value){alert(\'请输入查询内容\');this.k.focus();return false};return true">'
+'<span class=li1><a href=/cgi-bin/club/tag.aspx>标签</a>：</span>'+'<input size=40 onfocus="this.select()" value="'+k
+'" class=text type=text name=k>'
+'<input class=button type=submit value="在文章中">(多个标签用空格分开)<BR>'
+'<input class=button onclick="window.open(\''+_cgi+'club/luntantag.aspx/\'+this.form.k.value+\'.htm\')" type=button value="在论坛blog中"> '
+'<input class=button onclick="window.open(\'http://music.5ilog.com/music/search.aspx?s=\'+this.form.k.value)" type=button value="在歌曲中"> '

+'<input class=button onclick="window.open(\''+_cgi+'bookmark/search.aspx/\'+this.form.k.value+\'.htm\')" type=button value="在网摘中"> '
+'<input onclick="this.form.k.value+=\' 图片\';this.form.submit()" class=button type=button value="在图片中"> '
+'<input onclick="window.open(\''+_w1cgi+'home/search.aspx/\'+this.form.k.value+\'.htm\')" class=button type=button value="在用户中"> '
+'</form>'
}
function copen(url){open(url);return false}

function _syspop(){}

function _GetRandAry(n,sAry,dAry){
var a=new Array(n)
for (var i=0;i<n;i++) a[i]=i

var b=new Array()
for (var i=0;i<n;i++){
	var j=Math.floor(Math.random()*a.length)
	b[i]=a[j]
	a.splice(j,1)

}

if (dAry){
	for (var i=0;i<dAry.length;i++)
		dAry[i]=sAry[b[i%b.length]]
}

return b
}

function _initDataAry(o){
	var r=new Array()
	if (!o) return r
	
	var a=o.a
	var c=o.col;
	var cn=c.length-1
	var count=(a.length-1)/(c.length-1)
	for (var i=0,ii=0;i<count;i++){
		var o=new Object()
		for (var j=0;j<cn;j++) {
			o[c[j]]=a[ii++]
		}
		r[i]=o
	}
	return r
}

function _includeJS(){
for (var i=0;i<arguments.length;i++){
	var s=arguments[i]
	if (!_StartWith(s,"/")) s="/qq/js/"+s
	_W("<script src="+_5ilogJShost+s+".js><"+"/script>")
}
}

function _GetLeftStr(s,n,link,othercanshu){
if (!s) return ""
if (!othercanshu) othercanshu=""
if (s.length > n)
	return "<a href='" + link + "' title='" + s + "'" + othercanshu + ">" + s.substring(0, n) + "..</a>"

return  "<a href='" + link + "' " + othercanshu + ">" + s + "</a>"
}

function _WriteErrHead(){
//准备基础脚本
_includeJS("jsgg","standhead","/qq/img/banner/ADData","error")

_W('<link href="http://js.5ilog.com/qq/css/club.css" rel="stylesheet" type="text/css">')
}

function _islocal(){return (location.host=="127.0.0.1") || (location.host=="test.5ilog.com")}
function _WriteSysJS(isAD){
var s=location.pathname.substring("/cgi-bin/sys/link".length).replace(/\.htm$/,".js")+location.search
var h=_islocal()?"":"http://"+(isAD?"ad":"s")+".5ilog.com"
_W("<script src='"+h+"/cgi-bin/sys/js"+s+"'><"+"/script>")
}



//pop start
function _syspop2(isonlySEO,laiyuan){

if (location.host.charAt(0)=="1") return false

var r=_GetHost(document.referrer).toLowerCase()


var l265html="<script src=http://online4.lianmeng.com/cn/1/124803.php><"+"/script>"
if (_EndWith(r,"lianmeng.com")){
	document.write(l265html)
	return true
}

var v9html="<script src='http://pop.9v.cn/code/popjs.asp?uid=10770&tid=35&l=0&c=2'><"+'/script>'
if (_EndWith(r,"9v.cn")){
	document.write(v9html)
	return true
}
var skyhtml ='<SCRIPT SRC=http://play.unionsky.cn/show/?placeID=54701></'+'/script>'
var skyhtml2='<SCRIPT SRC=http://play.unionsky.cn/show/?placeID=67168></'+'SCRIPT>'
if (_EndWith(r,"unionsky.cn")){
	var r=Math.random()
	if (r<0.5){
		document.write(skyhtml)
	}else{
		document.write(skyhtml2)
	}
	
	return true
}

var cnxadhtml='<script src="http://code.cnxad.com/adcode.aspx?codecrt=pop_sp2&webuserid=7847&subid=0&encode=8JOdGK3vI6mbv0z9%2fxlw8wWe%2bixAanFzv4tFnhvQdhbRJyjgALU9ug%3d%3d&et=1&exid=0"><'+'/script>'
if (_EndWith(r,"cnxad.com")||_EndWith(r,"51ads.com")){
	_W(cnxadhtml)
	return true
}


switch(laiyuan){
	case "ent":
		changepocolink();break;
	case "ent.5imeinv":
	case "5imars":
		changelink2()
}


switch (laiyuan){
case "usrbbs":
case "blog":
     break
default:
if ( (laiyuan=="MZ" || laiyuan=="cool" || laiyuan=="clubv") && (!_GetCookie("Gllook")) ) { 
			_SetCookies("Gllook=1","H36")
			_W('<script src="http://www.llook.cn/WebAD/LLOOK.aspx?WebID=57894602-8128-4e91-bf38-7a7c87f12ad1"><'+'/script>')
	}else{

			var r=Math.random()
			var t=parseInt(_GetCookie("Gqq"))
			if (isNaN(t)) t=0
			t++
			_SetCookies("Gqq="+t,"H36")
			if (t%2==1) {
					var r=Math.random()
					if (r<10.5){
						if (r<0.4)
							document.write('<script id="youday" src="http://www.aiqianming.cn/js/button.js?webownerId=10871&childid=10000"><'+'/script>')
						else
							document.write('<script id="youday" src="http://www.aiqianming.cn/js/button.js?webownerId=10871&childid=10000"><'+'/script>')
					}else{
						aid = '10183';
						if (r<0.9)
							document.write('<script src=http://www.91qianming.cn/qq7.js><'+'/script>')
						else
							document.write('<script src=http://www.91qianming.cn/qq3.js><'+'/script>')
					}
				}
	}
}

if (_isShiMingUsr()) return false

if (_popNot0()) return false

_vpopself()

//if (_vopNotContinue()) return true

	

if (location=="http://www.5ilog.com/cgi-bin/home/") {
	//if (!_GetCookie("SEO")) 
	return false
}

var isSEO
if (_GetCookie("SEO")) {
	isSEO=true
}else {
	isSEO=_isSEO()
	if (isSEO)
		_SetCookies("SEO=1")
}

if (isonlySEO){
	if (!isSEO) return false	
}

/*var r=Math.random()
if (r<0.3){
	if (!_GetCookie("G265")) { 
			_SetCookies("G265=1","H36")
			document.write(l265html)
			refocus()
			if (!isSEO) _resetpopN(3)
			return true
	}
}else {*/

/*var vpop=false;
switch(laiyuan){
case "fengbi":
case "notlogin":
case "nottie":
case "shouquan":
case "ent":
case "WZ":
	vpop=true
	break
case "clubv":
	vpop=isSEO
	break
}
if (vpop){
}*/


var r=Math.random()
//if (r<0.5){
if (!_GetCookie("Gsky")) { 
	//taizhou game
			_SetCookies("Gsky=1","H36")
			document.write(skyhtml)
			refocus()
			if (!isSEO) _resetpopN(2)
			return true
	}
//}else{

	if ((self==top)&&(!_GetCookie("Gcnxad"))) { 
		_SetCookies("Gcnxad=1","H36")
		document.write(cnxadhtml)
		refocus()
		if (!isSEO) _resetpopN(2)
		return true
	}
//}

	if (!_GetCookie("Gv9")) { 
			_SetCookies("Gv9=1","H36")
			document.write(v9html)
			if (!isSEO) _resetpopN(2)
			refocus()
			return true
	}


/*	if (!_GetCookie("Gegoo")) { 
	//taizhou game
			_SetCookies("Gegoo=1","H36")
			document.write(egoohtml)
			refocus()
			if (!isSEO) _resetpopN(2)
			return true
	}*/

	
	
return false

}
function changelink2(){
/*if (Math.random()<0.05) return
	var t=parseInt(_GetCookie("Gpoco"))
	if (isNaN(t)) t=0
	t++
	_SetCookies("Gpoco="+t,"H36")
if ((t>10)&&(Math.random()<0.5)) return
*/
for (var i=0;i<document.links.length;i++){
	var o=document.links[i]
	if (o.href.indexOf("poco.cn")>0){
		o.href="#"
		o.target="_self"
		//o.style.textDecoration="none"
	}
}//for	
}
function changepocolink(){
/*if (Math.random()<0.05) return
	var t=parseInt(_GetCookie("Gpoco"))
	if (isNaN(t)) t=0
	t++
	_SetCookies("Gpoco="+t,"H36")
if ((t>10)&&(Math.random()<0.5)) return
*/
for (var i=0;i<document.links.length;i++){
	var o=document.links[i]
	if (o.href.indexOf("poco.cn")>0){
		var a=/pic_group_hash=(\d+)/.exec(o.href)
		if (a){
			o.href="/details.htx&pic_group_hash="+a[1]
			continue
		}
		o.style.display="none"
	}
}//for	
}
function refocus(){
	window.setTimeout("self.focus()",500)
	window.setTimeout("self.focus()",1500)
	window.setTimeout("self.focus()",3000)
	window.setTimeout("self.focus()",6000)
}

//返回是否可继续
function _vopNotContinue(isframe){
if (isframe) {
	if (_isSEO())
		_canvpop=true;
	return false
}


return _vpopself()

//if (self._deletedwenzhang)
// 	return _vpop(false) //deleted

if (_isSEO()){
	if (_goodk())
		return _vpop()
		
	return _vpopzhanwai(true) //只弹站外
}
if (_topisframe())
	return _vpop(false)


if (location.host.toLowerCase()=="w1.5ilog.com")
	return false
	
switch (_zhanneigoodk()){
	case "h漫":
	case "h动":
		return false; //_vpopdm()
	case false://站内1周弹
		return false
	default:
		 return false
}
return false

}

function _vpop(isonlyself,ggch){
if (!_GetCookie("G99")){
if (!_GetCookie("G98")){
	//_vpopself(ggch)
	//return false
}
}

if (isonlyself==true) return false

if (_popcnxad()) return true

return false
}

function _vpopzhanwai(isonlyzhanwai){

if (_popcnxad()) return true

if (isonlyzhanwai) return false

if (!_GetCookie("G98")){
	//_vpopself()
	//return false
}
return false
}

function _topisframe(){
if (top==self) return false
try{
	if (top._canvpop) return true
}catch(e){}
return false
}
function _goodk(){
return false

var r=document.referrer
if (!(r)) return false 
var a=new Array('%C6%AC','%B5%E3','%D3%B0','%D2%F9','%C9%AB') //,'pp','d7se','xiao77')//,'%B3%C9',,'%C7%E9')
//		片		点	影	淫	色
for (var i=0;i<a.length;i++){
	if (r.indexOf(a[i])>0) return true
	}

return false

}

function _zhanneigoodk(){
if (!self._QQluntanKeyAry) return false
var s=_QQluntanKeyAry.join("'").toLowerCase()
var a=new Array("h漫",'h动','激情贴图','耽美')
for (var i in a)
	if (s.indexOf(a[i])>=0) return a[i] 
return false
}

function _vpopdm(){
if (!_GetCookie("G97")){
	_CreatePopUpDiv({url:"/qq/gg/dm_vpop800x600.htm",w:810,h:615,isnothit:true,disableclickhide:true})
	_SetCookies("G97=1","D3")
	return false
}
return false
}

function _vpopself(ggch){
if (_GetCookie("G98")) return 

if (ggch){
	ggch="?ggch="+ggch
}else ggch=""

//var r=Math.random() 
//if (r<0.5){
	_CreatePopUpDiv({title:'我爱三国',url:"http://www.5isanguo.com/r.html",top:"50px",left:"10px",w:980,h:500,scroll1:"no",isnothit:true,disableclickhide:true})
//}else{
//	_CreatePopUpDiv({url:"http://www.5ilog.com/qq/gg/kk_vpop760x350.htm",w:760,h:350,isnothit:true})
//}
	//_SetCookies("G99=1","D7")
	_SetCookies("G98=1","H72")
}


function _popNot0(){
	var n=parseInt(_GetCookie("ggn"))
	if (isNaN(n)||(n<=0)) return false
	n--
	_SetCookies("ggn="+n)
	return true
}
function _resetpopN(n){
	var m=1
	if (location.host!="www.5ilog.com") m=3
	n=n?n:m
	if (_isgoodusr()) n=10
	_SetCookies("ggn="+n)
}
function _popSTART(){}
function _popEND(){}

function _PopGG(url,key,expire){
if (_GetCookie(key)) return

_SetCookies(key+"=1",expire)
window.showModalDialog('http://www.5ilog.com/qq/gg/pop.htm?url='+escape(url),''
	,'scroll:0;status:0;help:0;resizable:0;dialogWidth:0px;dialogHeight:0px');
}


function _zhanwaibookmark(url,subject){
if (url) {_bookmarkurl=url;_bookmarksubject=subject}
else{_bookmarkurl=_bookmarksubject=""}

if (_isZhanWai()){
	if (document.body){
		document.body.onbeforeunload=function(){if (!self._clicked) bookmarkit(_bookmarkurl,_bookmarksubject)}
		document.body.attachEvent("onclick",function(){_clicked=true})
	}
}
}


function _sendallimg(){
//_W('<script src="http://www.sms888.net/web/script/photojet.js?uid=3524&t=1" id="SMS888_Pic" charset="gb2312"><'+'/script>')
//return
if (Math.random()<10.5){
	uid=12085,minw=200,minh=200,showrightmenu=true;
	_W('<script charset=gb2312 src="http://code.5k3g.com/tl/picDIY/float_right.js"><'+'/script>')
}else{
	_W('<script charset=gb2312 src="http://u.7town.com/js/mdpic.js?uid=24460&a=&b=&c=&d=&e=&f=" id="9ku_pic"><'+'/script>')
}
}

function _GetAllInDiv(o,id){
	if (_getiever()) return o.all[id]
	
	var a=o.getElementsByTagName("*")
	return _GetAllByID(a,id)
}
function _GetAllByID(a,id){
	if (_getiever()) return a[id]
	var b=[]
	for(var i=0;i<a.length;i++){
		if(a[i].id==id || (!a[i].id && a[i].name==id)) b.push(a[i])
	}
	
	if (b.length==1) return b[0]
	if (b.length>1) return b
	
	return null
}
