<!--

// I could get into closures here, etc, to protect the API, but I'm not going to atm due to time constraints.

// The following change functions exist so the application can be extended w/o having to recode how the flash
// app interacts with it.

function ChangeDate(state, districtId, schoolId)
{
	LaunchUrl("ChooseMeal.aspx?State=" + state + "&DistrictID=" + districtId + "&schoolID=" + schoolId);
}


function ChangeMealPeriod(state, districtId, schoolId, date)
{
	LaunchUrl("ChooseMeal.aspx?State=" + state + "&DistrictID=" + districtId + "&schoolID=" + schoolId + "&Date=" + date);
}


function ChangeLine(state, districtId, schoolId, date, period)
{
	LaunchUrl("ChooseMeal.aspx?State=" + state + "&DistrictID=" + districtId + "&schoolID=" + schoolId + "&Date=" + date + "&Period=" + period);
}


function LaunchUrl(url)
{
	if (window.opener == null || window.opener == "undefined" || window.opener.closed)
	{
		parentWin = window.open(url);
	}
	else
	{
		window.opener.location.href=url;
	}

	window.close();
}

function LoadApp(line, linename)
{
	//alert("LoadApp.aspx?LineID=" + line + "&LineName=" + linename, "AppWindow");
	alert(history.length);
	if(history.length>0){
	alert(history.length);
	window.location.replace("LoadApp.aspx?LineID=" + line + "&LineName=" + linename);
	}else{
	appWin = window.open("LoadApp.aspx?LineID=" + line + "&LineName=" + linename, "AppWindow", 'scrollbars=no,resizable,width=773,height=550, left=0, top=0, copyhistory=no');
}
}

//-->
function test()
{
alert(history.length);

}
function LoadAppNew(url)
{
	//alert("LoadApp.aspx?LineID=" + line + "&LineName=" + linename, "AppWindow");
	//var Backlen=history.length;  
   //history.go(-Backlen); 
	//window.location.href=url;
	//history.go(0);
	
	
	
	//appWin = window.open(url, "AppWindow", 'scrollbars=no,resizable,width=773,height=550, left=0, top=0, copyhistory=no');

}