function usermessage()
{
	//If there are no user messages, uncomment the next line of code
	//return
	l_div = document.getElementById('div1')
	l_div.innerHTML = "<table border=1 collspan=0 cellspan=0 style='border-collapse:collapse'>"+
		"<tr><th bgcolor=#4465A5 nowrap><b>Important Announcements</b></th></tr>"+
		//"<tr><td nowrap><a href='http://iep.aeaims.org/ims/WebIEP/docs/LogInScreenMessage.htm?e' target='_blank' class='message'>06/12/2008 IMS and IEP Shutdown</a></td></tr>"+
		//"<tr><td nowrap><a href='http://iep.aeaims.org/ims/WebIEP/docs/LogInScreenMessage.htm?e' target='_blank' class='message'>06/04/2008 Database Server Maintenance</a></td></tr>"+
		//"<tr><td nowrap><a href='http://iep.aeaims.org/ims/WebIEP/docs/LogInScreenMessage.htm?e' target='_blank' class='message'>05/28/2008 IEP and IMS Applications unavailable TODAY at 5PM</a></td></tr>"+
		//"<tr><td nowrap><a href='http://iep.aeaims.org/ims/WebIEP/docs/LogInScreenMessage.htm?e' target='_blank' class='message'>04/28/2008 ICN Maintenance</a></td></tr>"+
		"<tr><td nowrap><a href='http://iep.aeaims.org/ims/WebIEP/docs/LogInScreenMessage.htm?a' target='_blank' class='message'>IEP Version 5 Supported Browsers</a></td></tr>"+
	"<tr><td nowrap><a href='http://iep.aeaims.org/ims/WebIEP/docs/LogInScreenMessage.htm?a' target='_blank' class='message'>09/26/2007 Netscape 9.0 Printing Problems</a></td></tr>"+
		"</table>"

	//Hide the message window if they have clicked the links.
	whdiv = document.getElementById("div1")
	
	if (whdiv.offsetHeight < 30)
	{
		whdiv.style.visibility = 'hidden'
	}	
}

function webiep(whscrn)
{															
	iepurl = "webiep/"	


	//*******IEP Admin	
	if (whscrn == 1)
	{
		if (parent.k_iepadmin== "0")
		{
			alert("Your Settings Don't Allow you Access to This Screen");
			return
		}
		
		parent.k_hist[0] = ' '
		location.href = iepurl + 'WebIEPParentFrame.htm?admin'
	}				
	//*******IEP Review
	else if (whscrn == 2)
	{
		//*******Check for districts	
		if (VerifyDistricts() == false)
		{
			return
		}
		if (parent.k_iepreview== "0")
		{
			alert("Your Settings Don't Allow you Access to This Screen");
			return
		}
		
		parent.k_hist[0] = ' '
		location.href = iepurl + 'WebIEPParentFrame.htm?review'
	}
	//*******Web IEP
	else if (whscrn == 3)
	{
		parent.k_hist[0] = ' '
		//location.href	= iepurl + 'WebIEPParentFrame.htm'
		location.href	= iepurl + 'ProcessingFrame.aspx?LogInUser=true'
	}
}


//login()
//This code is in aeaims.htm	
function VerifyDistricts()
{
	var bReturn = false;
	var sDistricts = parent.us_dist;
	sDistricts += " ";
	var sSpace = " ";
	var sDist = "";
	var nBegIndex = 0;	
	var nIndex = sDistricts.indexOf(sSpace);	

	while(nIndex != -1)
	{
		sDist = sDistricts.substring(nBegIndex,nIndex);
		
		//Make sure there is at least one four digit numbers that represents a district
		if( (isNaN(parseInt(sDist,10)) == false) || (sDist.length == 4) )
		{
			bReturn = true;
			break;
		}

		nBegIndex = ++nIndex;

		if(nBegIndex < sDistricts.length)
		{
			nIndex = sDistricts.indexOf(sSpace,nBegIndex);
		}
		else
		{
			nIndex = -1;
		}
	}
	
	if(bReturn == false)
	{
		alert("This feature is not active at this time.");
		//alert("There was an error in your list of districts for which you are responsible.  Each entry must be a four digit district. Please correct the district list in IMS.  The data will not be updated in the IEP until tomorrow since the FoxPro table for this data gets transferred to the SQL table every night.  If you need immediate service, please contact the CPC.");
	}
	
	return bReturn;	
}
