var cnt = 0;
var fdTm;
var fnt=0;
var i766 = m = {
	Id: 'index_id_' + Math.random().toString().replace('.', '_'),
	$: function(o){
		return document.getElementById(o);
	},
	IE:10,
	addFavorite: function(){
		var Title = document.title;
		var url = window.location.href;
		try{
			window.external.addFavorite(url, Title);
			return false;
		}catch(e){
			try{
				window.sidebar.addPanel(Title, url, "");
				return false;
			}catch (e){
				alert("加入收藏失败，请使用Ctrl+D进行添加");
				return false;
			}
		}
	},
	fadeIn: function(){
		this.$('focus_show').style.cssText = "filter: alpha(opacity="+ cnt*10 +"); opacity:"+cnt*10+";"; 
		if(cnt<10){
			fdTm = window.setTimeout("m.fadeIn()", 80);
			cnt++;
		}
		else{
			cnt = 0;
			window.clearTimeout(fdTm);
		}
	},
	setHomepage: function(obj){
		var url = 'http://'+window.location.hostname+'/';
		try{
			obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);
			return false;
		}catch(e){
			if(window.netscape) {
				try {
					netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				}catch(e){
					alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
					return false;
				}
				var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
				prefs.setCharPref('browser.startup.homepage', url);
				return false;
			}
			return false;
		}
	},
	copyData: function(iData){
		var s = v = '';
		if(iData==null)
		s = window.location.href + '\r\n' + document.title;	
		else s = iData;
		
		try{
			window.clipboardData.setData("text", s);
			v += '复制成功，按CTRL+V发送给好友、论坛或博客。';
		}catch(e){
			v += '浏览器限制，请复制以下链接和标题给好友、论坛或博客：\n\n' + s;
		}
		alert(v);
	},
	
	trim: function(s){
		return s.replace(/(^\s*)|(\s*$)/g, "");
	},
	search: function(f){
		f.Keywords.value = this.trim(f.Keywords.value);
		if(f.Keywords.value==''){
			alert('请输入搜索关键字！');
			f.Keywords.focus();
			return false;
		}
		return true;
	},
	marquee: function(obj){
		if(!this.$(obj))return;
		var div = this.$(obj);
		var timer = timer1 = null;
		var ul = div.getElementsByTagName('ul')[0];
		ul.innerHTML+=ul.innerHTML;
		var li = div.getElementsByTagName('li')[0];
		var lc = div.getElementsByTagName('li').length / 2;
		if(!li)return;
		marquee_start1(timer,timer1,lc,ul,li);
		function marquee_start1(timer,timer1,lc,ul,li){
			var j=0;
			timer = setInterval(function(){
				var x = li.offsetHeight;
				var h = (lc * x);	
				if(ul.scrollTop == h){ul.scrollTop = 0;j=0;}
				var i = 0;
				
				if(timer1){clearInterval(timer1);ul.scrollTop = x*j;}
				
				timer1 = setInterval(function(){
					if(i>=x){
						clearInterval(timer1);
						return;
					}
					i++;
					ul.scrollTop+=1;
					
				}, 10);
				j++;
			}, 2500);
		}
	},
	marquee1: function(obj1){
		if(!this.$(obj1))return;
		var div1 = this.$(obj1);
		var timer2 = timer3 = null;
		var ul1 = div1.getElementsByTagName('ul')[0];
		ul1.innerHTML+=ul1.innerHTML;
		var li1 = div1.getElementsByTagName('li')[0];
		var lc1 = div1.getElementsByTagName('li').length / 2;
		if(!li1)return;
		marquee_start2(timer2,timer3,lc1,ul1,li1);
		function marquee_start2(timer2,timer3,lc1,ul1,li1){
			var j2=0;
			timer2 = setInterval(function(){
				var a = li1.offsetHeight;
				var e = (lc1 * a);		
				if(ul1.scrollTop == e){ul1.scrollTop = 0;j2=0;}
				var k = 0;
				if(timer3){clearInterval(timer3);ul1.scrollTop = a*j2;}
				
				timer3 = setInterval(function(){
					if(k>=a){
						clearInterval(timer3);
						return;
					}
					k++;
					ul1.scrollTop+=1;
				}, 1);
				j2++;
			}, 2600);
		}
	},
	Focus: function(s,t){
		if(!this.$(s))return;
		if(!this.$(t))return;
		var thumb_div = this.$(t).getElementsByTagName('div')[0];
		var image_div = this.$(s);
		var thumb_ul = thumb_div.getElementsByTagName('ul')[0];
		var thumb_li= thumb_div.getElementsByTagName('li');
			if(thumb_li.length>4)thumb_ul.innerHTML+=thumb_ul.innerHTML;
		var thumb_lis = thumb_div.getElementsByTagName('li');
		var thumb_lic = thumb_lis.length;
		if(thumb_lic==0)return;
		var li_width = thumb_lis[0].offsetWidth;
			thumb_ul.style.width = (li_width * thumb_lic) + 'px';
		var w = (thumb_lic / 2) * li_width;	  //获得一半的宽度
		var timer = timer1 = null;
		var d = 'left';
		var a = this.$(t).getElementsByTagName('a');
		var Index = 0;
		thumb_div.scrollLeft = 0;
		setImg(0);
		a[0].onclick = function(){clearInterval(timer);d='left';doSlide(d, 4);timer = setInterval(function(){setImg(Index);return false;}, 3000);return false;};
		a[1].onclick = function(){clearInterval(timer);d='right';doSlide(d, 4);timer = setInterval(function(){setImg(Index);return false;}, 3000);return false;};
		a[0].onfocus = a[1].onfocus = function(){this.blur();};
		for(var i=0;i<thumb_lis.length;i++){
			thumb_lis[i].setAttribute('Index', i.toString());
			thumb_lis[i].onclick = function(){
				clearInterval(timer);
				var iIndex = Math.floor(this.getAttribute('Index').toString());
				this.getElementsByTagName('a')[0].onclick = function(){return false;};
				Index=iIndex;
				setImg1(iIndex);
				timer = setInterval(function(){setImg(Index);return false;}, 3000);
				return false;
			};
		}
		focus_start(d);
		function focus_start(direction){
			if(Index % 4==0 && Index!=0){
				if(thumb_li.length>4)doSlide(d, 4);
				return;
			}
			timer = setInterval(function(){setImg(Index);}, 3000);
		}
		function doSlide(d, n){
			Index = (thumb_div.scrollLeft / li_width);
			for(var i=0;i<thumb_lis.length;i++){
				thumb_lis[i].className = '';
			}
			if(d=='left'){
				/*左邊*/
				if(thumb_div.scrollLeft >= w){
					thumb_div.scrollLeft = 0;
				}
				thumb_lis[Index].className = '';
				for(var i=0;i<(li_width * n);i++){
					if(i >= (li_width * n))break;
					thumb_div.scrollLeft += 1;
				}
				Index = (thumb_div.scrollLeft / li_width);
			}else if(d=='right'){
				/*右邊*/
				if(thumb_div.scrollLeft == 0){
					thumb_div.scrollLeft = w;
				}
				thumb_lis[Index].className = '';
				for(var i=0;i<(li_width * n);i++){
					if(i >= (li_width * n))break;
					thumb_div.scrollLeft -= 1;
				}
				Index = (thumb_div.scrollLeft / li_width);
			}
				setImg1(Index);
		}
		
		function setImg(idx){
			if(thumb_li.length<8)
			{
				if(idx>3)
				{idx=0;Index=0;}
				
			}
			else
			{
				if(idx==8)
				{idx=0;}
				
			}		
			if(Index % 4==0 && Index!=0){
				d="right";
				if(thumb_li.length>4)
				{doSlide(d, 4);
				 Index-=1;}
			}
			for(var i=0;i<thumb_lis.length;i++){
				thumb_lis[i].className = '';
			}
			thumb_lis[idx].className = 'current selected';
			var ii = thumb_lis[idx].getElementsByTagName('img')[0];
			if(!ii)return;
			var img = '';
			if(ii.getAttribute('image')){
				img = ii.getAttribute('image').toString();
			}else{
				img = ii.getAttribute('src').toString();
			}
			var url = thumb_lis[idx].getElementsByTagName('a')[0].href;
			image_div.innerHTML = "<a href=\""+url+"\"target=\"_blank\"><img src=\""+img+"\" /></a>";
			Index+=1;
			cnt = 0;
			window.clearTimeout(fdTm);
		}
		function setImg1(idx){
			for(var i=0;i<thumb_lis.length;i++){
				thumb_lis[i].className = '';
			}

			thumb_lis[idx].className = 'current selected';
			var ii = thumb_lis[idx].getElementsByTagName('img')[0];
			if(!ii)return;
			var img = '';
			if(ii.getAttribute('image')){
				img = ii.getAttribute('image').toString();
			}else{
				img = ii.getAttribute('src').toString();
			}
			var url = thumb_lis[idx].getElementsByTagName('a')[0].href;
			image_div.innerHTML = "<a href=\""+url+"\"target=\"_blank\"><img src=\""+img+"\" /></a>";
			Index+=1;
			cnt = 0;
			window.clearTimeout(fdTm);
		}
	},
	scrolllist:function(slist,detail,cur_li){
		var last=0;
		var tab= new Array();
		function $( id ){ return document.getElementById( id );}
		run=function(l){
			if(l!=last)
			{
				if( tab[last] != null){
					tab[last].className = "off";
				}
				if( tab[l] != null ){
					tab[l].className = "on";
				}
				last=l;
			}
		};
		firstrun=function(){
			for(var i=0;i< tab.length;i++)
			{
				if(i=0)
				{
					tab[i].className = "on";
				}
				else
				{
					tab[i].className = "off";	
				}
			}
		};
		addfun=function(){
			for(var i = 0; i < tab.length; i++)
			{
				tab[i].numid=i;
				tab[i].onmouseover = function(){ 
					run(this.numid);
				}	
			}
		};
     	info=function(){
			if( slist == null || detail == null ) return;
			var tabs = slist.split(".");
			if( tabs[0] == null || tabs[1] == null || $( tabs[0] ) == null ) return;
			tab = $(tabs[0]).getElementsByTagName( tabs[1] );
			last = (cur_li== null ) ? 0:(cur_li-1);
			addfun();
		};
		info();
		
	},
	tab: function(id, evt){
		if(!this.$(id))return;
		evt = evt==null ? 'click' : evt;
		var self = this;
		var li = this.$(id).getElementsByTagName('li');
		if(li.length==0)return;
		for(var i=0;i<li.length;i++){
			li[i].className = '';
			eval("li[i].on"+evt+" = function(){return itab(this);};");
			li[i].onfocus = function(){this.blur();};
		}		
		itab(li[0]);
		function itab(o){
			if(typeof(o.getAttribute('tab'))!='string'){
				var aa = o.getElementsByTagName('a');
				if(aa)aa[0].setAttribute('target','_blank');
				return true;
			}
			var vTab = '';
			for(var i=0;i<li.length;i++){
				li[i].className = '';
				vTab = li[i].getAttribute('tab');
				if(typeof(vTab)=='string'){
					if(self.$(vTab))
					self.$(vTab).style.display = 'none';
				}
			}
			o.className = 'current';
			vTab = o.getAttribute('tab');
			if(typeof(vTab)=='string' && vTab.toString()!=''){
				if(self.$(vTab))
				self.$(vTab).style.display = 'block';
			}
			return false;
		}
	},
	autoplay:function(){
		var itab=0;
        setInterval(function(){
			document.getElementById("rhd").getElementsByTagName("li")[itab].onclick();
			itab=itab+1;
			if(itab>2)itab=0;
		},6000);
	},
	init: function(){
		if(navigator.appName == "Microsoft Internet Explorer"){
			var userAgent = navigator.userAgent;
			var s = 'MSIE';
			this.IE = parseFloat(userAgent.substr(userAgent.indexOf(s) + s.length));	
		}
		a.init();
	}
};

var a = {
	ns : {},
	//update top time 2011-11-30
	time: {top: 8000, rip: 6000, banner: 5000},
	timer: new Array(),
	remove: function(name, func){
		if(this.timer[name])clearInterval(this.timer[name]);
		if(m.$(name + '_' + m.Id)){
			var s = m.$(name + '_' + m.Id);
			s.parentNode.removeChild(s);
		}
		if(typeof(func)=='function')func();
	},
	mask: function(o){
		var div = o.getElementsByTagName('a')[0];
		var obj = o.getElementsByTagName('object')[0];
		if(typeof(obj)=='undefined')return;
		div.style.position = 'relative';
		div.style.display = 'block';
		div.style.styleFloat = 'left';
		div.style.cssFloat = 'left';
		div.style.left = 0;
		div.style.top = 0;
		obj.style.position = 'absolute';
		obj.style.left = 0;
		obj.style.top = 0;
		obj.zIndex = 0;
		var i=document.createElement('img');
		i.style.position = 'absolute';
		i.src='http://static.766.com/a/images/blank.gif';
		i.style.width=obj.offsetWidth+'px';
		i.style.height=obj.offsetHeight+'px';
		i.style.top=0;
		i.style.left = 0;
		i.style.zIndex = 1;
		i.style.border = 0;
		div.appendChild(i);	
		return i;
	},
	getcookie: function(name){
		var CookieFound = false;
		var start = 0;
		var end = 0;
		var CookieString = document.cookie;
		var i = 0;
		while(i <= CookieString.length){
			start = i;
			end = start + name.length;
			if (CookieString.substring(start, end) == name){
				CookieFound = true;
				break;
			}
			i++;
		}
		if(CookieFound){
			start = end + 1;
			end = CookieString.indexOf(";",start);
			if (end < start)end = CookieString.length;
			var getvalue = CookieString.substring(start, end);
			return unescape(getvalue);
		}
		return "";
	},
	setcookie: function(name,value,stime,domain){
		try{
			domain = domain==null ? top.location.hostname : domain;
		}catch(e){
			domain = domain==null ? location.hostname : domain;
		}
		stime = stime==null ? (3 * 60 * 60 * 1000) : stime;
		var extime= new Date();
		extime.setTime(extime.getTime() + stime);
		value = escape(value);
		var nameString = name + "=" + value;
		var expiryString = ";expires="+ extime.toGMTString();
		var domainString = ";domain="+domain;
		var pathString = ";path=/";
		var setvalue = nameString + expiryString + domainString + pathString;
		document.cookie = setvalue;
	},
	createAdClose: function(o, name, func, type){
		var self = this;
		var s = type=='swf' ? '' : 'top:-'+o.offsetHeight+'px;';
		var a = document.createElement('a');
		a.href = '#close';
		a.title = '关闭';
		with(a.style){
			position = 'relative';
			zIndex = 100000;
		}
		a.innerHTML = '<img src="http://static.766.com/a/images/close.jpg" style="float:right;right:0;border:0;width:13px;height:13px;position:relative;z-index:10000;'+s+'" />';
		a.onclick = function(){self.remove(name, func);return false;};
		o.appendChild(a);
		return a;
	},
	createAdDiv: function(name, w, h, mask){
		var div = document.createElement('div');
		with(div.style){
			position = 'absolute';
			zIndex = 999;
			left = 0;
			top = 0;
			width = w + 'px';
			height = h + 'px';
		}
		div.id = name + '_' + m.Id;
		document.body.appendChild(div);
		this.innerAd(name + '_' + m.Id, name, w, h, mask);
		return div;
	},
	createAdDiv1: function(name, w, h, mask){
		var div = document.createElement('div');
		with(div.style){
			position = 'absolute';
			zIndex = 999;
			left = 0;
			top = 0;
			width = w + 'px';
			height = h + 'px';
		}
		var obj=div.id = name + '_' + m.Id;
		document.body.appendChild(div);
		w = w == null ? '100%' : w;
		h = h == null ? '100%' : h;
		var s = '<div style="position:relative;z-index:1;" width="'+w+'" height="'+h+'"><img src=\"http://img.ue.766.com/common/a/gb.gif\" style=\"position:absolute; z-index:7;width:60px; height:60px; top:340px; left:0; cursor:pointer;\"/>';
		if(m.$(obj) && typeof(this.ns[name])=='object'){
			if(this.ns[name].type=='swf'){
				s += "<a href=\""+this.ns[name].url+"\" style=\"position:absolute; z-index:6;\">\
					<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \
					codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"  \
					width=\""+w+"\"  height=\""+h+"\" >\
						<param name=\"movie\" value=\""+this.ns[name].img+"\">\
						<param name=\"quality\" value=\"high\">\
						<param name=\"wmode\" value=\"transparent\">\
					<embed src=\""+this.ns[name].img+"\" \
						quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" \
						type=\"application/x-shockwave-flash\"  width=\""+w+"\"  height=\""+h+"\" ></embed>\
					</object></a>";
			}else{
				s += '<img src=\"gb.gif\" style=\"position:absolute; z-index:7;width:60px; height:60px;top:340px; left:0; cursor:pointer;\"/><a href="'+this.ns[name].url+'" style="float:left;"><img src="'+this.ns[name].img+'" width="'+w+'" height="'+h+'" border="0"  style=\"position:absolute; z-index:6; top:0 ;left:0; \"/></a>';
			}
			s+='</div>';
			m.$(obj).innerHTML = s;
			/*透明gif蒙板*/
			mask = mask==null ? true : false;
			if(this.ns[name].type == 'swf' && mask){
				this.mask(m.$(obj));
			}
		}
	
		return div;
	},
	innerAd : function(obj, name, w, h, mask){
		w = w == null ? '100%' : w;
		h = h == null ? '100%' : h;
		var s = '<div style="position:relative;z-index:1;" width="'+w+'" height="'+h+'">';
		if(m.$(obj) && typeof(this.ns[name])=='object'){
			if(this.ns[name].type=='swf'){
				s += "<a href=\""+this.ns[name].url+"\" style=\"float:left;\">\
					<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \
					codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\"  \
					width=\""+w+"\"  height=\""+h+"\" >\
						<param name=\"movie\" value=\""+this.ns[name].img+"\">\
						<param name=\"quality\" value=\"high\">\
						<param name=\"wmode\" value=\"transparent\">\
					<embed src=\""+this.ns[name].img+"\" \
						quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" \
						type=\"application/x-shockwave-flash\"  width=\""+w+"\"  height=\""+h+"\" ></embed>\
					</object></a>";
			}else{
				s += '<a href="'+this.ns[name].url+'" style="float:left;"><img src="'+this.ns[name].img+'" width="'+w+'" height="'+h+'" border="0" /></a>';
			}
			s+='</div>';
			m.$(obj).innerHTML = s;
			/*透明gif蒙板*/
			mask = mask==null ? true : false;
			if(this.ns[name].type == 'swf' && mask){
				this.mask(m.$(obj));
			}
		}
	},
	top_ad_float: function(o){
		var t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
		var w = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
		var h = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
		o.style.left = ((w - 800) / 2) + 'px';
		if(m.IE > 6)
		o.style.top = ((h - 400) / 2) + 'px';
		else
		o.style.top = (t + (h - 400) / 2) + 'px';
		o.style.position = (m.IE > 6) ? 'fixed' : 'absolute';
	},	
	/*前弹*/
	top_ad: function(){
		var self = this;
		if(typeof(this.ns.top)=='object'){
			var topAd = this.createAdDiv('top', 800, 400);
			if(window.addEventListener){
				window.addEventListener('scroll', function(){self.top_ad_float(topAd);}, false);
				window.addEventListener('resize', function(){self.top_ad_float(topAd);}, false);
			}else{
				window.attachEvent('onscroll', function(){self.top_ad_float(topAd);});	
				window.attachEvent('onresize', function(){self.top_ad_float(topAd);});	
			}
			this.top_ad_float(topAd);
			this.createAdClose(topAd, 'top', function(){self.rip_ad();},this.ns.top.type);
			this.timer['top'] = setTimeout(function(){self.remove('top', function(){self.rip_ad();});}, self.time.top);
		}else{
			self.rip_ad();
		}
	},
	top_ad1: function(){
		var self = this;
		if(typeof(this.ns.top)=='object'){
			var topAd = this.createAdDiv('top', 800, 400);
			if(window.addEventListener){
				window.addEventListener('scroll', function(){self.top_ad_float(topAd);}, false);
				window.addEventListener('resize', function(){self.top_ad_float(topAd);}, false);
			}else{
				window.attachEvent('onscroll', function(){self.top_ad_float(topAd);});	
				window.attachEvent('onresize', function(){self.top_ad_float(topAd);});	
			}
			this.top_ad_float(topAd);
			this.createAdClose(topAd, 'top', function(){self.top_ad_thumb();},this.ns.top.type);
			this.timer['top'] = setTimeout(function(){self.remove('top', function(){self.top_ad_thumb();});}, self.time.top);
		}else{
			self.rip_ad();
		}
	},
	/*前弹(小)*/
	top_ad_thumb: function(){	
		var self = this;
		if(typeof(this.ns.top_thumb)=='object'){
			var topAd = this.createAdDiv('top_thumb', 80, 80);
			with(topAd.style){
				position = 'absolute';
				left = 'auto';
				right = '0px';
				top = '200px';
			}
			topAd.innerHTML=topAd.innerHTML+'<ul><li title="播放"></li><li title="关闭"></li></ul>';
			var dul=topAd.getElementsByTagName("ul");
			var dli=topAd.getElementsByTagName("li");
			dul[0].className='ullbar';
			dli[0].onclick=function(){
				self.top_ad1();
				self.remove('top_thumb',function(){});
			};
			dli[1].onclick=function(){
				self.remove('top_thumb',function(){});
			};
			dli[0].onmouseover=function(){this.style.color="#f00"};
			dli[0].onmouseout=function(){this.style.color="#fff"};
			dli[1].onmouseover=function(){this.style.color="#f00"};
			dli[1].onmouseout=function(){this.style.color="#fff"};
		}
	},
	/*撕页*/
	rip_ad: function(){
		this.top_ad_thumb();
		var self = this;
		if(typeof(this.ns.rip)=='object'){
			var ripAd = this.createAdDiv1('rip', 450, 400);
			with(ripAd.style){
				position = 'absolute';
				left = 'auto';
				right = 0;
				top = 0;
				overflow = "hidden";
			}
			rimg=ripAd.getElementsByTagName("img");
			rimg[0].onclick=function(){
				self.remove('rip', function(){self.float_ad();});
			}
			this.timer['rip'] = setTimeout(function(){self.remove('rip', function(){self.float_ad();});}, self.time.rip);
		}else{
			self.float_ad();
		}
	},
	rip_ad1: function(){
		var self = this;
		if(typeof(this.ns.rip)=='object'){
			var ripAd = this.createAdDiv1('rip', 450, 400);
			with(ripAd.style){
				position = 'absolute';
				left = 'auto';
				right = 0;
				top = 0;
				overflow = "hidden";
			}
			rimg=ripAd.getElementsByTagName("img");
			rimg[0].onclick=function(){
				self.remove('rip', function(){self.rip_ad_thumb()});
			}
			this.timer['rip'] = setTimeout(function(){self.remove('rip', function(){self.rip_ad_thumb();});}, self.time.rip);
		}else{
			self.float_ad();
		}
	},
	/*撕页(小)*/
	rip_ad_thumb: function(){	
		var self = this;
		if(typeof(this.ns.rip_thumb)=='object'){
			var ripAd = this.createAdDiv('rip_thumb', 80, 80);
			with(ripAd.style){
				position = 'absolute';
				left = 'auto';
				right = 0;
				top = 0;
			}
			ripAd.innerHTML=ripAd.innerHTML+'<ul><li title="播放"></li><li title="关闭"></li></ul>';
			var dul=ripAd.getElementsByTagName("ul");
			var dli=ripAd.getElementsByTagName("li");
			dul[0].className='ullbar';
			dli[0].onclick=function(){
				self.rip_ad1();
				self.remove('rip_thumb',function(){});
			};
			dli[1].onclick=function(){
				self.remove('rip_thumb',function(){});
			};
			dli[0].onmouseover=function(){this.style.color="#f00"};
			dli[0].onmouseout=function(){this.style.color="#fff"};
			dli[1].onmouseover=function(){this.style.color="#f00"};
			dli[1].onmouseout=function(){this.style.color="#fff"};
			
		}
	},
	video_hide:function(){
		clearTimeout(this.timer['video']);
		var aa = m.$("div_show");
		if(aa) aa.parentNode.removeChild(aa);
		this.video_ad_thumb();
	},
	video_fload:function(Div){
		if(Div){
			var t = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
			var h = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
			var w = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
			var l=0;
			var r2 = parseInt(t+(h-Div.offsetHeight-1));
			var r1 = parseInt(h-Div.offsetHeight-1);
			Div.style.left = (l)+'px';
			if(m.IE > 6)
			Div.style.top = (r1) + 'px';
			else
			Div.style.top = (r2) + 'px';
		}
	},
	video_ad:function(){
		var videourl = "http://static.766.com/source/flash/winPlayer.swf?ads="+this.ns.video.img+"&link="+this.ns.video.url;
		var rip_video = document.createElement("div");
		rip_video.id = "div_show";
		rip_video.style.width="338px";
		rip_video.style.height="270px";
		rip_video.innerHTML = '<div style="cursor:pointer; position:absolute; width:15px; height:15px; float:right; left:315px;top:5px;" onclick="a.video_hide()" >&nbsp;&nbsp;&nbsp;&nbsp;</div><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \
				codebase=" http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" \
				width="334" height="270">\
				<param name="movie" value="'+videourl+'">\
				<param name="quality" value="high">\
				<param name="wmode" value="transparent">\
				<embed src="'+videourl+'" \
					quality="high" wmode="transparent"\
					pluginspage=" http://www.macromedia.com/go/getflashplayer"\
					type="application/x-shockwave-flash" \
					width="334"  height="270">\
				</embed>\
			</object>';
		document.body.appendChild(rip_video);
		if(m.IE>6){
			m.$("div_show").style.position="fixed";
			m.$("div_show").style.zIndex=100000;
		}else{
			m.$("div_show").style.position="absolute";
			window.attachEvent("onscroll",function(){a.video_fload(m.$("div_show"));});
			window.attachEvent("onresize",function(){a.video_fload(m.$("div_show"));});
		}
		a.video_fload(m.$("div_show"));
		this.timer['video']=setTimeout("a.video_hide()",10000);
	},
	video_ad_thumb:function(){
		if(typeof(this.ns.video_thumb)=='object'){
		var self=this;
		var rip_video_thumb = document.createElement("div");
		rip_video_thumb.id = "div_show_thumb";
		rip_video_thumb.innerHTML = '<div style="cursor:pointer; width:42px; height:18px; text-align:center;overflow:hidden; text-indent:-1000px; background-image:url(http://img.ue.766.com/common/showthumb/close.gif);" title="关闭">关闭</div><div style="cursor:pointer; width:42px; height:278px;text-align:center;overflow:hidden;text-indent:-1000px;background-image:url('+a.ns.video_thumb.img+');" title="播放">播放</div>';
		document.body.appendChild(rip_video_thumb);
		var rd=rip_video_thumb.getElementsByTagName("div");
		rd[1].onclick=function(){
				self.video_ad();
				rip_video_thumb.parentNode.removeChild(rip_video_thumb);
		};
		rd[0].onclick=function(){
				rip_video_thumb.parentNode.removeChild(rip_video_thumb);
		};
		if(m.IE>6){
			m.$("div_show_thumb").style.position="fixed";
		}else{
			m.$("div_show_thumb").style.position="absolute";
			window.attachEvent("onscroll",function(){a.video_fload(m.$("div_show_thumb"));});
			window.attachEvent("onresize",function(){a.video_fload(m.$("div_show_thumb"));});
		}
		a.video_fload(m.$("div_show_thumb"));
		}
	},
	float_ad: function(){
		this.rip_ad_thumb();
		if(typeof(this.ns.video)=='object'){
			var self = this;
			var n = self.getcookie('star_766_video').toString();	
			n = n=='' ? '0' : n;
			n = parseInt(n);
			self.setcookie('star_766_video', (n + 1).toString(), (6 * 60 * 60 * 1000), '766.com');
			if(n<=0){
				self.video_ad();
			}else{
				self.video_ad_thumb();
			}
		}
		m.marquee('marquee1');
		m.marquee1('marquee2');
	},
	banner_ad: function(){
		if(m.$('topAd1').innerHTML!=''){
			var self = this;
			m.$('topAd1').style.display = 'block';
			var time1 = setTimeout(function(){
				clearInterval(time1);
				m.$('topAd1').style.display = 'none';
				if(typeof(starAd1)!='undefined')
				{
					new starAd1();
				}
			}, self.time.banner);
		}else{
			if(typeof(starAd1)!='undefined')
			{
				new starAd1();
			}
		}
	},
	stat: function(){
		var getUrl = document.getElementsByTagName('a');
		var url = '';
		var re = /^http\:\/\/get\.766\.com\/go\.php\?id\=([\d]+)$/i;
		var id = [];
		for(var i=0;i<getUrl.length;i++){
			url = getUrl[i].href.toString();
			if(re.test(url)){
				id.push(url.replace(re,'$1'));
			}
		}
		var IDString = id.join(',');
		var iframe = document.createElement('iframe');
		with(iframe.style){
			height = '0';
			width = '0';
			frameBorder = 0;
			display = 'none';
		}
		iframe.setAttribute('src', 'http://dynamic.766.com/publish/stat/index.php?url='+escape(window.location.href)+'&idstring='+IDString);
		document.body.appendChild(iframe);
	},
	init : function(){	
		/*透明gif蒙板*/
		if(m.$('topAd')){
			if(m.$('topAd').innerHTML==''){
				m.$('topAd').style.display = 'none';
			}else{
				m.$('topAd').style.display = 'block';
			}
		}
		if(m.$('banner1'))this.mask(m.$('banner1'));
		if(m.$('banner2'))this.mask(m.$('banner2'));
		if(m.$('banner3'))this.mask(m.$('banner3'));
		if(m.$('banner4'))this.mask(m.$('banner4'));
		if(m.$('banner5'))this.mask(m.$('banner5'));
		if(m.$('banner6'))this.mask(m.$('banner6'));
		if(m.$('ad1'))this.mask(m.$('ad1'));
		if(m.$('ad2'))this.mask(m.$('ad2'));
		if(m.$('ad3'))this.mask(m.$('ad3'));
		if(m.$('ad4'))this.mask(m.$('ad4'));
		if(m.$('ad5'))this.mask(m.$('ad5'));
		if(m.$('ad6'))this.mask(m.$('ad6'));
		if(m.$('ad7'))this.mask(m.$('ad7'));


		
		if(m.$('topAd')){
			m.$('topAd').onmouseover = function(){
				if(m.$('topAd1'))
				m.$('topAd1').style.display = 'block';
			};
		}
		if(m.$('topAd1').innerHTML!=""){
			var	div_topAd=m.$('topAd1');
			var div = div_topAd.getElementsByTagName('a')[0];
			var obj = div_topAd.getElementsByTagName('object')[0];
			if(typeof(obj)=='undefined')return;
			div.style.position = 'relative';
			div.style.display = 'block';
			div.style.styleFloat = 'left';
			div.style.cssFloat = 'left';
			div.style.left = 0;
			div.style.top = 0;
			obj.style.position = 'absolute';
			obj.style.left = 0;
			obj.style.top = 0;
			obj.zIndex = 0;
			var i=document.createElement('img');
			i.style.position = 'absolute';
			i.src='http://static.766.com/a/images/blank.gif';
			i.style.width='980px';
			i.style.height='400px';
			i.style.top=0;
			i.style.left = 0;
			i.style.zIndex = 1;
			i.style.border = 0;
			div.appendChild(i);	
			m.$('topAd1').innerHTML=m.$('topAd1').innerHTML+"<div id=\"closetopAd1\" style=\"height:13px;width:13px; background:url(http://static.766.com/a/images/close.jpg);display:block; position:absolute;  bottom:0; left:967px; cursor:pointer; \"></div>";
			
			m.$('topAd1').onmouseout = function(){
				this.style.display = 'none';
			};
		}
		if(m.$('closetopAd1')){
			m.$('closetopAd1').style.zIndex=2;
			m.$('closetopAd1').onmouseover = function(){
				if(m.$('topAd1'))
				m.$('topAd1').style.display = 'block';
			};
			m.$('closetopAd1').onclick = function(){
				m.$('topAd1').style.display = 'none';
			};
			
		}
		if(typeof(this.ns.video)=='object'){
			var va = document.createElement('a');
			va.style.display = 'none';
			va.href = this.ns.video.url;
			va.innerHTML = this.ns.video.img;
			document.body.appendChild(va);
		}
		this.banner_ad();
		if(window.addEventListener){
			window.addEventListener('load', function(){a.stat();}, false);
		}else{
			window.attachEvent('onload', function(){a.stat();});
		}
	}
};
document.write('<script type="text/javascript" src="http://js.ue.766.com/common/a/index.js"></script>');
document.write('<script type="text/javascript" src="http://js.ue.766.com/common/a/float.js"></script>');


