
//刷新父窗口页面
function refreshOpenerPage(){
	try{
		window.opener.location.href = window.opener.location.href.replace('#','');
	}catch(e){}
}
//聚焦父窗口
function focusOpenerPage(){
	try{
		window.opener.focus();
	}catch(e){}
}

//打开新窗口。窗口风格固定，可指定窗口的宽度与高度。
function openNewWindow(strfileName,intWidth, intHeight){
	
	var d = Math.floor(Math.random() * 10000000000000000);
	var StrWindowName = d.toString();
	var splashWin=window.open(strfileName,StrWindowName,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1" )
	splashWin.resizeTo(intWidth ,intHeight);
	var intLeft,intTop;
	intLeft=(screen.availwidth - intWidth)/2
	intTop= (screen.availheight - intHeight)/2
	splashWin.moveTo(intLeft,intTop);
	splashWin.focus();
}

//打开新窗口。窗口风格固定，可指定窗口的宽度与高度。
function openNewWindowV(strfileName,intWidth){
	
	var d = Math.floor(Math.random() * 10000000000000000);
	var StrWindowName = d.toString();
	var splashWin=window.open(strfileName,StrWindowName,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=1" )
	splashWin.resizeTo(778 ,500);
	var intLeft,intTop;
	intLeft=(screen.availwidth - intWidth)/2
	intTop= (screen.availheight - 500)/2
	splashWin.moveTo(intLeft,intTop);
	splashWin.focus();
}

//打开新窗口。窗口风格固定，最大化。
function openFullWindow(strfileName){
	
	var d = Math.floor(Math.random() * 10000000000000000);
	var StrWindowName = d.toString();
	var splashWin=window.open(strfileName,StrWindowName,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1" )
	splashWin.resizeTo(screen.availwidth ,screen.availheight);
	splashWin.moveTo(0,0);
	splashWin.focus();
}

// function mousemenu(){return false;}
// document.oncontextmenu =mousemenu;

function scrollit_r2l(seed)       
{
	var m1  = "欢迎使用 『 海闻订票系统 』！" ;
	var m2  = " " ;
	var msg=m1+m2;
	var out = " ";
	var c = 1;
	var speed  = 200;
	var timerTwo;
	if (seed > 100)       
	{
		seed-=2;       
		var cmd="scrollit_r2l(" + seed + ")";
		timerTwo=window.setTimeout(cmd,speed);
	}
	else if(seed <= 100 && seed > 0)       
	{
		for (c=0 ; c < seed ; c++)       
			out+=" ";
		out+=msg;
		seed-=2;
		var cmd="scrollit_r2l(" + seed + ")";
		window.status=out;
		timerTwo=window.setTimeout(cmd,speed);
	}               
	else if(seed <= 0)        
	{
		if (-seed < msg.length)
		{
			out+=msg.substring(-seed,msg.length);
			seed-=2;
			var cmd="scrollit_r2l(" + seed + ")";
			window.status=out;
			timerTwo=window.setTimeout(cmd,speed);
		}
		else
		{
			window.status=" ";
			timerTwo=window.setTimeout("scrollit_r2l(100)",speed);
		}
	}
}
//scrollit_r2l(100);

function SelectAllCheckboxes(spanChk)
{
	var xState=spanChk.checked;
	var theBox=spanChk;
	elm=theBox.form.elements;
	for(i=0;i<elm.length;i++)
	{
		if(elm[i].type=="checkbox" && elm[i].id!=theBox.id)
		{
			if(elm[i].checked!=xState)
				elm[i].click();
		}
	}
}

function HighlightRow(chkB)
{
	var xState=chkB.checked;
		
	if(xState)
	{
		chkB.parentElement.parentElement.style.backgroundColor='#DEDFDE';
		chkB.parentElement.parentElement.style.color='black';
	}else 
	{
		chkB.parentElement.parentElement.style.backgroundColor='';
		chkB.parentElement.parentElement.style.color='black';
	}
}

function isSerchShow()
{
	if(document.all("trSearch").style.display=="none")
	{
		document.all("trSearch").style.display="";
	}
	else
	{
		document.all("trSearch").style.display="none";
	}
}

function ShowTable(tid)
{
	if(document.all(tid).style.display=="none")
	{
		document.all(tid).style.display="";
	}
	else
	{
		HideTable(tid);
	}
}

function HideTable(tid)
{
	document.all(tid).style.display="none";
}



