var bikky = document.cookie;
function getCookie(name) {
    name += "=";
    var i = 0; 
    while (i < bikky.length) {
      var offset = i + name.length;
      if (bikky.substring(i, offset) == name) { 
        var endstr = bikky.indexOf(";", offset); 
        if (endstr == -1) endstr = bikky.length;
          return unescape(bikky.substring(offset, endstr)); 
        }
        i = bikky.indexOf(" ", i) + 1; 
        if (i == 0) break; 
      }
    return null; 
}

durl=new Array()
durl["yinsha"]="http://www.bliao.com:2001/vnet/chat/yinsha_top.htm";
//durl["vnet"]="http://gd.vnet.cn/inc/hd_icp_0903.jsp";
durl["vnet"]="http://a1.gd.vnet.cn/head/head_center.htm";
durl["cvnet"]="http://user.vnet.cn/ui/header.aspx";
durl["chinavnet"]="http://www.bliao.com/vnet/chat/client_top.html";
durl["poco"]="http://www.bliao.com/poco/top.htm";

dheight=new Array();
dheight["yinsha"]=85;
dheight["vnet"]=134;
dheight["cvnet"]=64;
dheight["chinavnet"]=85;
dheight["poco"]=125;

matcharray=new Array()
if(window.location.hostname=="chat.vnet.cn"){
	matcharray[1]="vnet"
	prefix="vnet"
}else{
	if(window.location.hostname=="chat.gd.chinavnet.com"){
 		matcharray[1]="vnet"
 		prefix="vnet"
	}else if(window.location.hostname=="bliao.chat.chinavnet.com" || window.location.hostname=="chat.chinavnet.com"){
 		matcharray[1]="cvnet"
 		prefix="cvnet"
	}else if(window.location.hostname=="chat.poco.cn"){
 		matcharray[1]="poco"
 		prefix="poco"
 		document.write("<img src=http://counter.yinsha.com:8088/?USER=chatpoco&u=0 width=2 height=2 border=0>")
	}else{
		var pattern = /^(.*)\.bliao.com/i;
		var matcharray=pattern.exec(window.location.hostname+"");
	}
}
prefix=""
if(matcharray){
	tmp_prefix=matcharray[1];
	if (durl[tmp_prefix]) {
		prefix=tmp_prefix;
		document.cookie = "yinshabliaoprefix="+escape(prefix)+";domain=bliao.com"
	}
}

if(prefix == ""){
	pf=getCookie("yinshabliaoprefix");
	if (pf)
		prefix=pf;
	else
		prefix="yinsha";
}

document.write("<div align=center><iframe src='"+durl[prefix]+"' width=760 height="+dheight[prefix]+" align=center target=_top noresize frameborder=0 border=0 bordercolor=000000 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling=no></iframe></div>");




//--- history start 如有更新请同时修改http://www.bliao.com/headjs.js

function SetCookie (name,value,expires,path,domain,secure) {       
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function uphistory(no,roomname){
	var bliaologhistory="";
	if (getCookie("bliaologhistory")){
		bliaologhistory=getCookie("bliaologhistory");

		nlist=bliaologhistory.split("\n");
		nlist.length --;
		if (nlist.length>10) {
			bliaologhistory=""
			for (i=9;i>=0;i--){
				bliaologhistory=nlist[i]+"\n"+bliaologhistory
			}
		}		
		
		tmp=new String("\n"+bliaologhistory)
		pattern =eval("tmp.match(/\\n"+no+"\\t/ig)");
		if (pattern) return;
	}
	bliaologhistory=no+"\t"+roomname+"\n"+bliaologhistory
	
	var expdate = new Date();
	expdate.setTime (expdate.getTime() + 30 * (24 * 60 * 60 * 1000));
	SetCookie("bliaologhistory",bliaologhistory,expdate,"/","bliao.com");
	SetCookie("bliaologhistory",bliaologhistory,expdate,"/","yinsha.com");
	SetCookie("bliaologhistory",bliaologhistory,expdate,"/","silversand.net");
}

var historylog
function clearhistory(){
	SetCookie("bliaologhistory","","","/","bliao.com");
	SetCookie("bliaologhistory","","","/","yinsha.com");
	SetCookie("bliaologhistory","","","/","silversand.net");
	historylog="<table border=0><tr><td>无访问历史记录<a href='javascript:location.reload()'>·刷新·</a></td></tr></table>";
	hidemenu()
	return;
}
function gethistory(){
	if (getCookie("bliaologhistory")){
		historylog=getCookie("bliaologhistory")
		nlist=historylog.split("\n");
		historylog="<table border=0><tr><td align=center>聊天室访问历史记录<hr size=1 width=90% align=center></td></tr>";
		nlist.length --;
		if (nlist.length>10) nlist.length=10;
		for (i=0;i<nlist.length;i++){
			npair=nlist[i].split("\t");
			historylog=historylog+"<tr><td><a href='http://"+npair[0]+".bliao.com' target=_blank>·["+npair[0]+"] "+npair[1]+"</a></td></tr>"
		}
		historylog=historylog+"<tr><td><hr size=1 width=90% align=center></td></tr><tr><td align=center><a href='javascript:location.reload()'>·刷新·</a><a href='javascript:clearhistory()' target=_self>·清除·</a></td></tr></table>"
	}else{
		historylog="<table border=0><tr><td>无访问历史记录<a href='javascript:location.reload()'>·刷新·</a></td></tr></table>";
	}
	return historylog;
}
var menuOffX=0	//菜单距连接文字最左端距离
var menuOffY=18	//菜单距连接文字顶端距离
var fo_shadows=new Array();
historylog=gethistory();
//当前方式
function showmenu(){
	if (!document.all) return;
	clearhidemenu();
	ie_clearshadow();
	menuobj=document.all.popmenu;
	menuobj.thestyle=menuobj.style;
	menuobj.innerHTML=historylog;
	menuobj.contentwidth=menuobj.offsetWidth;
	menuobj.contentheight=menuobj.offsetHeight;
	eventX=event.clientX
	eventY=event.clientY
	var rightedge=document.body.clientWidth-eventX
	var bottomedge=document.body.clientHeight-eventY
	var getlength
	if (rightedge<menuobj.contentwidth){
		getlength=document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX
	}else{
		getlength=ie_x(event.srcElement)+menuOffX
	}
	menuobj.thestyle.left=getlength+'px'
	if (bottomedge<menuobj.contentheight&&mod!=0){
		getlength=document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY-23
	}else{
		getlength=ie_y(event.srcElement)+menuOffY
	}
	menuobj.thestyle.top=getlength+'px'
	menuobj.thestyle.visibility="visible"
	ie_dropshadow(menuobj,"#999999",3)
	return false
}
//内嵌iframe方式
function showmenu_ifr(e){
	if (!document.all) return;
	clearhidemenu();
	ie_clearshadow();
	menuobj=document.all.popmenu;
	menuobj.thestyle=menuobj.style;
	menuobj.innerHTML=historylog;
	menuobj.contentwidth=menuobj.offsetWidth;
	menuobj.contentheight=menuobj.offsetHeight;
	thise=e
	var t=e.offsetTop;
	var l=e.offsetLeft;
	while(e=e.offsetParent){
		t+=e.offsetTop; l+=e.offsetLeft;
	}
	menuobj.thestyle.top=(t+ thise.offsetHeight)+ "px";
	menuobj.thestyle.left=(l+ thise.offsetWidth - menuobj.offsetWidth )+ "px";
	menuobj.thestyle.visibility="visible"
	ie_dropshadow(menuobj,"#999999",3)

}

function ie_y(e){  
	var t=e.offsetTop;  
	while(e=e.offsetParent){  
		t+=e.offsetTop;  
	}  
	return t;  
}  
function ie_x(e){  
	var l=e.offsetLeft;  
	while(e=e.offsetParent){  
		l+=e.offsetLeft;  
	}  
	return l;  
}  
function ie_dropshadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style
		rs.position = 'absolute';
		rs.left = (el.style.posLeft + i) + 'px';
		rs.top = (el.style.posTop + i) + 'px';
		rs.width = el.offsetWidth + 'px';
		rs.height = el.offsetHeight + 'px';
		rs.zIndex = el.style.zIndex - i;
		rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
		//el.insertAdjacentElement('afterEnd', rect);
		fo_shadows[fo_shadows.length] = rect;
	}
}
function ie_clearshadow()
{
	for(var i=0;i<fo_shadows.length;i++)
	{
		if (fo_shadows[i])
			fo_shadows[i].style.display="none"
	}
	fo_shadows=new Array();
}
function hidemenu(){
	if (window.menuobj)
		menuobj.thestyle.visibility="hidden"
	ie_clearshadow()
}

function dynamichide(e){
	if (!menuobj.contains(e.toElement))
		hidemenu()
}

function clearhidemenu(){
	if (window.delayhide)
		clearTimeout(delayhide)
}

function ie_clearshadow()
{
	for(var i=0;i<fo_shadows.length;i++)
	{
		if (fo_shadows[i])
			fo_shadows[i].style.display="none"
	}
	fo_shadows=new Array();
}

//window.open("http://italk.yinsha.com/telecom/gonggao/100630.htm")
//---history-end

