var ob1=document.getElementById("setlayer")
var reob1=document.getElementById("resetlayer")
var thsetlayer=document.getElementById("thsetlayer")
var foursetlayer=document.getElementById("foursetlayer")
var fivesetlayer=document.getElementById("fivesetlayer")
var sixsetlayer=document.getElementById("sixsetlayer")
var sevensetlayer=document.getElementById("sevensetlayer")
var ninesetlayer=document.getElementById("ninesetlayer")
var createLayer
var j=29
var i=1
//注意要调整I的位置，I代表当前弹出层的起始高度
var stateName
var obstate
var newiframe
var screenwidth=(document.body.scrollWidth)/2-190
var obarray=new Array(ob1,reob1,thsetlayer,foursetlayer,fivesetlayer,sixsetlayer,sevensetlayer,ninesetlayer)

//当有新的对象需要控制时，需通过上面的document.getElementById获取对象，然后添加到数组中
//注意控制对象与被控制对象的关系，如果控制对象的ID为A，则被控制对象的ID为A_self
for(k=0;k<obarray.length;k++)
{
//获取所有的控制对象，当单击其中任一控制对象时，则发生下裂动作
	obarray[k].onclick=function()
	{
	stateName=this.id
	//将当前对象的ID传值给stateName
	mystart=window.setInterval(movedown,"1")
	mystart
	//每一毫秒执行一下movedown过程，并且获取当前时间函数的语柄，以便后面中止

	createLayer=document.createElement("div")
	//createLayer.setAttribute("id","newlayer")
	createLayer.style.cssText="position:absolute; width:100%; height:640px; z-index:1; left: 0px; top: 0px; background:#CCCCCC;filter:alpha(opacity=40);-moz-opacity:0.4; "
	document.body.appendChild(createLayer)
	//建立一个新层，让其他层的所有用控件失效,以便用户点击弹出层并关闭它，才能点其他层
	
	nowstateName=stateName+"_self"
	obstate=document.getElementById(nowstateName)
	newiframe=document.createElement("iframe")
	newiframe.style.cssText="width:100%;height:92%;"
	newiframe.setAttribute("scrolling","no")
	newiframe.setAttribute("frameBorder","0")
	newiframe.setAttribute("src",nowstateName+".htm")
	obstate.appendChild(newiframe)
	//新建一个对象iframe，通过该IFRAME引用外部文件，显示内容，注意该IFRAME引用的文件对象和滑动层的ID一致，名称以htm结尾
	}
}

function movedown()
{
nowstateName=stateName+"_self"

if(j>=0)
	{
	i=i+j
	j--	
	obstate.style.cssText="position:absolute;margin-top: "+i+"px;left:"+screenwidth+"px;width:420px; height:300px; line-height:22px; font-size:12px;  color:#fff; display:block;overflow:hidden; "
	}
	else
	{
	j=0
			obstate.onclick=function()
					{
					document.body.removeChild(createLayer)
					clearInterval(mystart)
					re_mystart=window.setInterval(moveup,"1")
					re_mystart
					}

	
	}
}


function moveup()
{
if(i>=0)
{
i=i-j
j++
obstate.style.cssText="position:absolute;margin-top:"+i+"px;left:"+screenwidth+"px;display:block;width:420px; height:300px;font-size:12px; line-height:22px;"
}
else
{
clearInterval(re_mystart)
obstate.style.cssText="display:none"
obstate.removeChild(newiframe)
i=1
j=29
}
}
function changealpha(ob)
{
	ob.style.cssText="line-height:20px; height:20px; font-size:12px; font-weight:bold; color:#666666;filter:alpha(opacity=70);-moz-opacity:0.7;border:1px solid #fff;"
	ob.focus()
	}
function re_alpha(ob)
{
	ob.style.cssText="line-height:20px; height:20px; font-size:12px; font-weight:bold; color:#666666;filter:alpha(opacity=10);-moz-opacity:0.1;border:1px solid #fff;"
	}
