﻿var game=[[55807,"美眉睡地板","20119/30/2011930103723.gif"],[6657,"两个性感女郎","20055/21/200552122341856423.jpg"],[31628,"三个校花","200811/9/2008119195422.gif"],[3465,"猜胸部","20052/22/3465.gif"],[12283,"偷窥美女胸部","20058/29/2005922314011449.jpg"],[12205,"色情老头","20058/27/200582710255587965.jpg"],[13225,"猜胸部大小","20059/10/200591010493856410.gif"],[35536,"偷拍女骗子","20097/11/2009711213427.jpg"],[34115,"偷吻床上睡美人","20094/21/200942111725.jpg"],[56424,"美女挠脚心","201111/10/20111110125036.jpg"],[48577,"性感女郎1","201011/12/201011129116.jpg"],[25234,"杂志封面模特","200711/27/20071127142310.jpg"],[29236,"偷拍走光做封面","20083/3/200833142538.gif"],[36531,"芭芝女孩闰房激吻","20099/11/20099111681.jpg"],[36427,"偷拍偷情证据","20099/5/200995153441.jpg"],[32955,"办公室偷情接吻","20092/12/200921210558.jpg"],[34872,"亲我~快点","20096/6/200966152019.jpg"],[37050,"上课吻男生","200910/15/20091015122155.jpg"],[33906,"美女明星找茬","20094/7/200947102046.jpg"],[20661,"美女地铁出击","200612/28/20061228131127.jpg"],[47110,"健身房偷偷泡妞","20109/13/2010913102452.jpg"],[29650,"整蛊逛公园的美女","20083/29/200832984726.gif"],[21127,"草地激情结吻","20073/5/200735103802.jpg"],[13279,"看胸部猜年龄","20059/10/200591014443067812.jpg"],[31095,"电眼美女3","20088/24/200882405558.gif"],[13994,"亚当伊甸园","200510/11/20051011153117.gif"],[2430,"保险套射击","20051/13/2430.jpg"],[15403,"性感明星秀","200512/9/2005129111505.gif"],[30434,"整蛊偷懒的保姆","20086/2/200862100520.gif"],[31175,"Q版泡泡堂2","20089/19/2008919165546.gif"],[39598,"狂扁小朋友变态版","20058/29/200582913284749039.gif"],[39561,"机械小兵3.5变态版","20093/6/20093314323.jpg"],[38549,"电眼美女6","200912/22/20091222101443.jpg"],[30865,"晚安香吻","20087/21/2008721152922.gif"],[35947,"暴打火柴人","20098/7/200987103529.jpg"],[4655,"急速英雄","20053/31/4655.jpg"]]

var picpath="http://img.yx007.com:88/thumb/";
var tpic="/images/blank.gif";
var step = 1;
var downpics = 12;

var gamehtml="";var ndomain;var i=0;
for(key in game){
	var murl="http://www.yx007.com/list/play_"+game[key][0]+".htm";
	if(i >= downpics){
		gamehtml+='<li><a href="'+murl+'" target="_0"><img pic="'+picpath+game[key][2]+'" src="'+tpic+'" /><br />'+game[key][1]+'</a></li>'
	}
	else{
		gamehtml+='<li><a href="'+murl+'" target="_0"><img pic="" src="'+picpath+game[key][2]+'" /><br />'+game[key][1]+'</a></li>'
	}
	gamehtml+='\n';i++
}
var twidth=960;var alldown=false;var mnow=false;var as=80;var asm=20;var spd=as;var asx=4;
function setmove(){
	if($('games').offsetWidth<=twidth)return;
	var a=document.createElement("UL");
	a.innerHTML=$('games').innerHTML;
	$('gamesdiv').appendChild(a);
	$('mleft').onclick=function(){if(!mnow){downpic("r");movegame(twidth,"r")}};
	$('mright').onclick=function(){if(!mnow){downpic("l");movegame(twidth,"l")}}
}
function movegame(n,f){
	mnow=true;
	if(f=="l"&&$('mcontent').scrollLeft>=$('games').offsetWidth)$('mcontent').scrollLeft=0;
	if(f=="r"&&$('mcontent').scrollLeft==0)$('mcontent').scrollLeft=$('games').offsetWidth;
	if(f=="l")$('mcontent').scrollLeft+=spd;
	if(f=="r")$('mcontent').scrollLeft-=spd;
	n=n-spd;
	if(n==0) spd=20;
	if(n+as==0){
		mnow=false;
		clearTimeout(mto);
		f=f=="l"?"r":"l";
		spd=as;
		var a=window.setTimeout(function(){movegamex(as,f)},10)
	}else{
		var mto=window.setTimeout(function(){movegame(n,f)},10)
	}
}
function movegamex(n,f){
	mnow=true;
	if(f=="l"&&$('mcontent').scrollLeft>=$('games').offsetWidth)$('mcontent').scrollLeft=0;
	if(f=="r"&&$('mcontent').scrollLeft==0)$('mcontent').scrollLeft=$('games').offsetWidth;
	if(f=="l")$('mcontent').scrollLeft+=asx;
	if(f=="r")$('mcontent').scrollLeft-=asx;n=n-asx;
	if(n==0){mnow=false;clearTimeout(a)}
	else{var a=window.setTimeout(function(){movegamex(n,f)},10)}
}
function getdownnum(o){
	if(alldown)return false;
	for(i=0;i<o.length;i++)if(o[i].getAttribute("pic")!="")return o.length;
	alldown=true
}
function downpic(t){
	var a=$('games').getElementsByTagName("IMG");
	var b=getdownnum(a);
	if(!b)return;
	var c=(t=="l")?$('mcontent').scrollLeft+twidth:$('mcontent').scrollLeft-twidth;
	if(!t)c=0;
	var f=c/as;
	if(f<0)f=a.length+f;
	if(f>a.length-1)f=f-a.length;
	var t=f+downpics;
	if(t>a.length-1)t=a.length-1;
	for(i=f;i<=t;i++){if(a[i].getAttribute("pic")!="")a[i].src=a[i].getAttribute("pic");a[i].setAttribute("pic","")}
}
