// flash notice display
function flash(message, title, icon) {
	$('div#flashBox').show()
	title = title || 'Alert'
	icon = icon || 'arrow.gif'
	popupFlash(message, title, icon)
}

function popupFlash(message, title, icon, tries) {
	//popupFlash needs to wait for ComponentArt Kernel to load
	tries = tries || 0
	if(!window.Dialog1 && tries < 10) {
		setTimeout("popupFlash('" + message + "', '" + title + "', '" + icon + "', " + (tries+1) + ")", 50)
		return
	}
	Dialog1.beginUpdate();
	Dialog1.set_value(message);
	Dialog1.set_title(title);
	Dialog1.set_icon(icon);
	Dialog1.endUpdate();
	Dialog1.show();
}


//var iTimeOut = (1000*60*<%=iBrowserTimeOut%>);
var iSleep = 600000;	//sleep for ten minutes 600000
var iErrorSleep = 60000;		//sleep for 1 minute if there was an error.
var iCounter = 1;

function refreshFunc()
{
//			iCounter = iCounter + iSleep;

//			if( ( iCounter > iTimeOut ) && ( iTimeOut > 0 ) )
//			{
//				document.location = "logout.aspx";
//				return;
//			}

//			document.getElementById('TopBanner1_refreshIt').src = "TopRefresh.aspx";
//			setTimeout("checkResults()", 15000);	//wait 15 seconds before checking the page
}

function checkResults()
{
	//if the object is not there then the iframe failed to load -- try back in a minute to load again.
	if( window.frames['TopBanner1_refreshIt'].document.getElementById('lblGotMe') == null )
		setTimeout("refreshFunc()", iErrorSleep);
	else
		setTimeout("refreshFunc()", iSleep);
}

setTimeout("refreshFunc()", 30000);	//wait for 30 seconds before doing refresh system


