//菜单竖向滚动
//FRD is float relation div
var FRD_X=0; //FRD当前X
var FRD_Y=60; //FRD当前
var FRD_MIN_Y=60; //Y轴最小值
var FRD_lock=0;
var FRD_myTimer=null;
function FRD_hide()
{
	layerhide('FLOATRELATIONDIV');
	setlayerpox("FLOATRELATIONDIV",-200,-200);
	clearInterval(FRD_myTimer);
	//FRD_lock=1;	
}

function FRD_Scroll()
{
	if (FRD_lock)
	{
	}
	else
	{
	
		FRD_lock=1; //加锁
		y1=document.body.scrollTop;
		if ( y1>(FRD_Y-FRD_MIN_Y) )
		{
			FRD_Y=FRD_Y+10;
			if (FRD_Y>(y1+FRD_MIN_Y))
			{
				FRD_Y=y1+FRD_MIN_Y;
			}
		}
		else 
		{
			FRD_Y=FRD_Y-10;
			if ( FRD_Y<(y1+FRD_MIN_Y) )
			{
				FRD_Y=y1+FRD_MIN_Y;
			}
		}
		if (FRD_Y < FRD_MIN_Y)
		{
			FRD_Y=FRD_MIN_Y;
		}
		setlayerpox("FLOATRELATIONDIV",FRD_X,FRD_Y);
		//window.status="scrolltop="+CURRENT_Y+",div_top="+div_y;
		//setTimeout("myScroll()",500);
		FRD_lock=0;//解锁
	}
}

function FRD_init0()
{
	
	//每秒一次
	FRD_Scroll();
	//setTimeout("myScroll()",500);
	FRD_myTimer=setInterval("FRD_Scroll()",100);
}
//菜单竖向滚动 结束
//改变表格 行背景颜色
function changeTrColor(idName,noChangeN,className1,className2)
{
	myTable=document.getElementById(idName);
	myTrs=myTable.getElementsByTagName("tr");
	myTrsLength=myTrs.length;
	for (i=0;i<myTrsLength;i++)
	{
		if (i>=noChangeN)
		{
			myTrs[i].className=className1;
			if (i<myTrsLength-1)
			{
				i++;
				myTrs[i].className=className2;				
			}
		}
	}
}
//改变表格 行背景颜色 结束

function mykeydown(e)
{
	if (document.all)
	{
  	  if (e.srcElement.tagName== "INPUT") return(true);
  	  if (e.srcElement.tagName== "TEXTAREA") return(true);
	}
	else if (document.documentElement)
	{
		if (e.target.tagName== "INPUT") return(true);
		if (e.target.tagName== "TEXTAREA") return(true);
	}
	return(false);
}

function no_uso(evento){
	//if(document.all) setTimeout('self.close()',6000);
	//else if(document.getElementById) setTimeout('self.close()',6000)
	return(false);
}

function myflase()
{
  //alert("continus test!");
  return(false);
}

if(document.all){
	//document.onkeydown=new Function("self.event.returnValue=false");
	document.onkeydown=mykeydown;
	document.onselectstart=new Function("self.event.returnValue=false");
	document.onselect=myflase;
	document.ondragstart=myflase;
	document.onselect=myflase;
	document.ondragstart=myflase;
	document.oncopy=myflase;
	document.onbeforecopy=myflase;
	document.onmouseup=myflase;
	//document.selecttion.empty();
	document.oncontextmenu =new Function("self.event.returnValue=false");

}
else if(document.documentElement){
	document.addEventListener("mousedown", myflase, null);
	document.addEventListener("keydown", myflase, null);
	document.addEventListener("change", myflase, null);
	document.addEventListener("load", myflase, null);
	document.addEventListener("abort", myflase, null);
	document.addEventListener("blur", myflase, null);
	document.addEventListener("focus", myflase, null);
	//document.addEventListener("reset", myflase, null);
	document.addEventListener("resize", myflase, null);
	document.addEventListener("onselect", myflase, null);
	document.onmousedown=mykeydown;
	document.onkeydown=mykeydown;
	document.onchange=mykeydown;
	document.onload=myflase;
	document.onabort=myflase;
	document.onblur=myflase;
	document.onfocus=myflase;
	//document.onreset=myflase;
	document.onresize=myflase;
	document.onselect=myflase;
	//document.onmove=myflase;
}
else if(document.layers){
	document.captureEvents(Event.MOUSEDOWN|Event.KEYDOWN|Event.LOAD|Event.ABORT|Event.BLUR|Event.CHANGE|Event.FOCUS|Event.MOVE|Event.RESET| Event.RESIZE|Event.SELECT|Event.UNLOAD);
	document.onmousedown=mykeydown;
	document.onkeydown=mykeydown;
	document.onload=no_uso
	document.onabort=no_uso
	document.onblur=no_uso
	document.onchange=mykeydown;
	document.onfocus=no_uso
	document.onmove=no_uso
	//document.onreset=no_uso
	document.onresize=no_uso
	document.onselect=no_uso	
}

function init0()
{
	FRD_init0();
}
/* for Mozilla */
if (document.addEventListener) {
  document.addEventListener("DOMContentLoaded", init0, null);
}


window.onload = init0;
