// JavaScript Document
var x0=0,y0=0,x1=0,y1=0;
var offx=6,offy=6;
var moveable=false;
var hover='orange',normal='slategray';//color;
var index=10000;//z-index;
//开始拖动;
function startDrag(obj)
{
	if(event.button==1)
	{
		//锁定标题栏;
		obj.setCapture();
		//定义对象;
		//var win = obj.parentNode;
		//var sha = win;//.nextSibling;
		//记录鼠标和层位置;
		x0 = event.clientX;
		y0 = event.clientY;
		x1 = parseInt(obj.style.left);
		y1 = parseInt(obj.style.top);
		//记录颜色;
		normal = obj.style.backgroundColor;
		//改变风格;
		obj.style.backgroundColor = hover;
		//win.style.borderColor = hover;
		//obj.nextSibling.style.color = hover;
		obj.style.left = x1 + offx;
		obj.style.top  = y1 + offy;
		moveable = true;
	}
}
//拖动;
function drag(obj)
{
	if(moveable)
	{
		var win = obj.parentNode;
		var sha = win;//.nextSibling;
		obj.style.left = x1 + event.clientX - x0;
		obj.style.top  = y1 + event.clientY - y0;
		//obj.style.left = parseInt(obj.style.left) + offx;
		//obj.style.top  = parseInt(win.style.top) + offy;
	}
}
//停止拖动;
function stopDrag(obj)
{
	if(moveable)
	{
		//var win = obj.parentNode;
		//var sha = win.nextSibling;
		//var msg = obj.nextSibling;
		obj.style.borderColor     = normal;
		obj.style.backgroundColor = normal;
		//msg.style.color           = normal;
		//sha.style.left = obj.parentNode.style.left;
		//sha.style.top  = obj.parentNode.style.top;
		obj.releaseCapture();
		moveable = false;
	}
}
//获得焦点;
function getFocus(obj)
{
	if(obj.style.zIndex!=index)
	{
		index = index + 2;
		var idx = index;
		obj.style.zIndex=idx;
		//obj.nextSibling.style.zIndex=idx-1;
	}
}
//最小化;
function vodmin()
{

	var flg = myflash.style.display=="none";
	if(flg)
	{
		//Layer1.style.height  = parseInt(tbl1.height) + 2*2;
		myflash.style.display  = "";
	}
	else
	{
		//Layer1.style.height  = 240;
        myflash.style.display="none";
	}
}
//关闭;
function vodclose()
{
	Layer1.style.visibility = "hidden";
	myvod.innerHTML = "";

}
//创建一个对象;
function move(){ 
 Layer1.style.pixelTop=document.body.scrollTop+ document.body.scrollTop+Layer1.style.pixelTop;
}



 var divWidth = 0; 
 var divHeight = 0; 
 
 
window.onload = function(){
  width = window.screen.width; 
   height = window.screen.height; 
   document.all.Layer1.style.top = height -document.all.Layer1.style.height + "px"; 
   document.all.Layer1.style.left = width  -document.all.Layer1.style.width +  "px"; 
}
