function PositiveIntOnly(i) {
		var keycode = window.event.keyCode;

		if (keycode < 48 || keycode > 57) {
			window.event.returnValue = false;
		}
}


function enableScreen()
{		
	divModal.style.width = "0px";
	divModal.style.height = "0px";			
}

function disableScreen()
{
	divModal.style.width = document.body.scrollWidth;
	divModal.style.height = document.body.scrollHeight;			
}

function checkModal()
{
	hiddenValue = document.getElementById("modalDiv");
	var State = hiddenValue.value;
	if(State=='true')
		disableScreen();
	else
		enableScreen();
}


/******************************
***** WINDOWING FUNCTIONS *****
******************************/

/* opens a modal dialog window */
function OpenModalDialog( target, width, height )
{
	// set default width and height
	width	= width == null ? 600 : width;
	height	= height == null ? 400 : height;
	
	var winSettings		= "dialogWidth: " + width + "px; dialogHeight: " + height + "px; scroll: no; status: no";
	var returnValues	= new Array();
	
	// open a new modal dialog, and await return
	returnValues = window.showModalDialog( target, returnValues, winSettings );
	
	// if values returned from modal dialog
	if ( returnValues != null )
	{				
		// if we need to refresh the parent page
		if ( returnValues[ "refreshFlag" ] == "1" )
		{
			// refresh the page (do it this way to not get an annoying dialog)
			window.location.href = window.location.href;
		}
	}
}


/* returns value array from modal dialog */
function ReturnModalDialogValues( returnFlagID )
{
	var returnDialogValues = document.getElementById( returnFlagID ).value == '1';
	
	// if modal dialog flagged to return
	if ( returnDialogValues )
	{
		// return values
		var returnValues = new Array();
		returnValues[ "refreshFlag" ] = "1";
		window.returnValue = returnValues
		
		window.close();
	}
}


/* opens an modal information dialog window */
function OpenInformationDialog( target, width, height )
{
	// set default width and height
	width	= width == null ? 400 : width;
	height	= height == null ? 450 : height;
	
	var winSettings	= "dialogWidth: " + width + "px; dialogHeight: " + height + "px; scroll: no; status: no";
		
	// open a new modal dialog
	window.showModalDialog( target, self, winSettings );
}

function GetDDLSelectedText(ddList) {	
	return ddList.options[ddList.selectedIndex].text;
}