﻿//取出COOKIE name=变量名
function fGetCookie(name) {
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0) { 
    offset = document.cookie.indexOf(search);
    if (offset != -1) { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end));
    }
  }
  return cookieValue;
}

//设置COOKIE 变量名,内容,时间(小时)
function fSetCookie(name, value, hours) {
  var expire = "";
  var domain = "; domain=aothink.com; path=/";
  if(hours != "") {
    expire = new Date((new Date()).getTime() + hours * 60 * 60 * 1000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + domain;
}

//获取URL参数
function Request_URL()
{
	var strHref = top.document.referrer;
	if (strHref=="")
	{
		strHref=this.location.href;
	}
	strHref=strHref.replace("http://","");
	var arrTmp = strHref.split("/");
	if (arrTmp[1]=="28")
	{
		return "28";
	}
	else
	{
		var arrTmp = strHref.split(".");
		return arrTmp[1];
	}
}

come_from=fGetCookie("come_from"); //取出值
if (come_from=="")
{
	come_from=Request_URL();
	fSetCookie("come_from",come_from,1);
}

//=====================

var asw_xinming=new Array();
var asw_qq=new Array();
var sort_array=new Array();
var aswkey=new Array();

asw_xinming[0]="肖老师";
asw_qq[0]="675191720";
aswkey[0]="fdee4b408eca5a6effd649a8899efcdb87326330ca388f933545499b3a0ad73b";

asw_xinming[1]="陶老师";
asw_qq[1]="934352092";
aswkey[1]="956a8bf2b8e837981aeb07232ed07b6e33440e5e9c0e62d1d97d2bd0eea34d5a";

asw_xinming[2]="王老师";
asw_qq[2]="631188951";
aswkey[2]="2a7a1dee22a7388acbf32df0c93fe6d5c3124c9ef5fb32c0080ef44a5d4bcc8f";

asw_xinming[3]="张老师";
asw_qq[3]="372320830"; 
aswkey[3]="d8c0dd820a82fc78dd33ef44277d30e04484050a7f78aa4bab6769187b0f7c03";

asw_xinming[4]="宋老师";
asw_qq[4]="380173526";
aswkey[4]="5f9240b9ab65af1a789839bfa6a976335a971a529827b0d6e221d4eee3b9c0b4";

asw_xinming[5]="徐老师";
asw_qq[5]="438519379";
aswkey[5]="4fa3d0b283eb32aacadd87799c9baa1f00042d5074077b533da21b2f2ceaeec3";

asw_xinming[6]="陈老师";
asw_qq[6]="502502827";
aswkey[6]="7ad4565f0f6f353bd469c2cb4aa8e8ef82d6bf4ca785bbcfdd4998878d908128";

asw_xinming[7]="王老师";
asw_qq[7]="827914160"; 
aswkey[7]="585c35a7552bed90a9ab0b6e0acdd5af6de407279167f0f552d9839c9af69b0b";

asw_xinming[8]="杨老师";
asw_qq[8]="364304114"; 
aswkey[8]="304c2263719532911fd65d03804ce440c6c493c2ede6258992a516dc6460279d";

asw_xinming[9]="刘老师";
asw_qq[9]="764893302"; 
aswkey[9]="c4c3d0fbd86a82bc864a6df23a5b43ae5530ce544c5e758aab135a66ec068e1e";

asw_xinming[10]="李老师";
asw_qq[10]="502502820"; 
aswkey[10]="3278c419f16d11832444318fad7fe66f7f442e61f14b9c8cf8fd70e87ebac02a";

asw_xinming[11]="刘老师";
asw_qq[11]="896764537"; 
aswkey[11]="19d9a0281754f20f174bb9e7e51715fa45115d7106ce59104584611e21233c12";

asw_xinming[12]="宋老师";
asw_qq[12]="956554032";
aswkey[12]="22d4cd20c57eb9b0fd924f790815cc707181fcc6f287cc54c16ca0f647dae240";

asw_xinming[13]="杨老师";
asw_qq[13]="784011372";
aswkey[13]="c0b4ce700a4afa6317730c8ce5f8de250dd76c9f2ef11ac0e99f02e8b89041e4";

asw_xinming[14]="谢老师";
asw_qq[14]="499162839";
aswkey[14]="4850f400950bc8a748fa931c503fe0416239b40fc0232038ee01e782f3f11e36";

asw_xinming[15]="刘老师";
asw_qq[15]="421412072";
aswkey[15]="79fa7ca105af68d93695f648a7f24156d334fcdc33b05c97a8c9171c8a63f984";

asw_xinming[16]="肖老师";
asw_qq[16]="985569659";
aswkey[16]="885010480c29e1c46aa04a7be0d49ec70924e1799d1e2c9694fb1af43aaab2bf";

var sort_array=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
var show_xinming,show_qq,showkey,qq_list="";
sort_array.sort(function(){return Math.random()>0.5?-1:1;});

for (i=0;i<=16;i++) 
{
	show_xinming=asw_xinming[sort_array[i]];
	show_qq=asw_qq[sort_array[i]];
        showkey=aswkey[sort_array[i]];
	qq_list+="<a href=\"http://sighttp.qq.com/cgi-bin/check?sigkey="+showkey+"\"; target=_blank; onclick=\"var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey="+showkey+"';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;\"><img border='0' SRC='http://wpa.qq.com/pa?p=1:"+show_qq+":41' alt='奥思维QQ服务'>"+show_xinming+"</a><BR>";
}




var showbody="<TABLE width='110' border='0' align='center' cellPadding='0' cellSpacing='0'><TR><TD><img src='/web/88852qqonline/images/top.gif' width='115' height='65' onclick='closeBanner();' /></TD></TR><TR id='qqstab1'><TD align='center'>"+qq_list+"</TD></TR><TR><TD align='center' height='35'><img src='/web/88852qqonline/images/bottom.gif' width='115' height='30' onclick='qqstabBanner();' /></TD></TR></TABLE>";

	var delta=0.15
	var collection;
	var closeB=false;
	function floaters() {
		this.items	= [];
		this.addItem	= function(id,x,y,content)
				  {
					document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute;  top:20px;right:35px;width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
					var newItem				= {};
					newItem.object			= document.getElementById(id);
					newItem.x				= x;
					newItem.y				= y;

					this.items[this.items.length]		= newItem;
				  }
		this.play	= function()
				  {
					collection				= this.items
					setInterval('play()',10);
				  }
		}
		function play()
		{
			if(screen.width<=648 || closeB)
			{
				for(var i=0;i<collection.length;i++)
				{
					collection[i].object.style.display	= 'none';
				}
				return;
			}
			for(var i=0;i<collection.length;i++)
			{
				var followObj		= collection[i].object;
				var followObj_x		= (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
				var followObj_y		= (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);
				if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
					var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
					dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
					followObj.style.left=followObj.offsetLeft+dx;
					}

				if(followObj.offsetTop!=(document.documentElement.scrollTop+followObj_y)) {
					var dy=(document.documentElement.scrollTop+followObj_y-followObj.offsetTop)*delta;
					dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
					followObj.style.top=followObj.offsetTop+dy;
					}
				followObj.style.display	= '';
			}
		}	
		function closeBanner()
		{
			closeB=true;
			return;
		}
		function qqstabBanner()
		{
			if(document.all.qqstab1.style.display=='none')
			{
			   document.all.qqstab1.style.display=''
			}
			else 
			{
				document.all.qqstab1.style.display='none'
		    }
		}
		
	var theFloaters = new floaters();
	//theFloaters.addItem('followDiv2',6,30,showbody);
	theFloaters.addItem('followDiv1','document.body.clientWidth-115',50,showbody);
	theFloaters.play();

