// JavaScript Document

function findObject(n,d)
{
	var p,i,x; 
	if(!d)
	{
		d=document;
	}
	if( (p=n.indexOf("?")) >0 && parent.frames.length )
	{
		d=parent.frames[n.substring(p+1)].jspcument;
		n=n.substring(0,p);
	}
	if( !(x=d[n]) && d.all )
	{
		x=d.all[n];
	}
	for (i=0;!x&&i<d.forms.length;i++)
	{
		x=d.forms[i][n];
	}
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
	{
		x=findObject(n,d.layers[i].jspcument);
	}
	if(!x && d.getElementById)
	{
		x=d.getElementById(n);
	}
	return x;
}

//open New Window
function openNewWin(winWidth,winHeight,winUrl)
{
	var winLeft=Math.max(0,(screen.availWidth-winWidth-10)/2);
	var winTop=Math.max(0,(screen.availHeight-winHeight-30)/2);
	var obj=window.open(winUrl,'_blank','left='+winLeft+',top='+winTop+',height='+winHeight+',width='+winWidth+',status=no,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=no,directories=no');
	obj.focus();
}

//open New Window align center
function openReportNewWinC(winUrl)
{
	var winOjbect = window.open(winUrl,'_blank','left=5,top=5,height='+(screen.availHeight-160)+',width='+(screen.availWidth-30)+',status=no,toolbar=yes,scrollbars=yes,menubar=yes,location=no,resizable=yes,directories=no');
	winOjbect.focus();
}

//Are you sure to delete this record?
function isDeleteConfirm( goURL )
{
	if(confirm("确认要删除该条记录吗？"))
    { 
		document.postForm.action = '' + goURL ;
		document.postForm.submit() ;
	}
}

function isNumberStr(s)
{
	var c;
	for(i=0;i<s.length;i++)
	{
		c=s.substr(i, 1);
		if( !((c>='0')&&(c<='9')) )
		{
			if(c!=".")
			   return false;
		}
	}
	return true;
}
