﻿
var changeStepURL = "";  // the url value that changes when the step arrows are clicked.
var changeStepText = "";
var changeStepDlgHeight = 85;


function openWhatsThis(dialogContext)
{
	var theText = "";

	switch(dialogContext)
	{
		case "SchoolYear":
			theText = 'This date determines which products are offered in your school store.  Some schools offer two possible sales years; 2009-2010 and 2010-2011.<br/><br/>Make sure the year displayed here matches your desired year. For example, your school store header should display "2010-2011 Sales" if you want to make a purchase for the 2010-2011 school year.';
			break;
	}

	getEl("WhatsThisText").innerHTML = theText;
	
	$("#dlgWhatsThis").dialog({width: 400, autoOpen: false, draggable: false, resizable: false, modal: false});
	$("#dlgWhatsThis").dialog("open");
}

function closeWhatsThis()
{ 
	$("#dlgWhatsThis").dialog("close");
}

function openHelpDialog()
{
	$("#dlgHelp").dialog({ width: 900, autoOpen: false, draggable: false, resizable: false, modal: false });
	$("#dlgHelp").dialog("open");
}

function closeHelpDialog()
{ 
	$("#dlgHelp").dialog("close");
}

function cancelChangeStep()
{
	$("#dlgChangeStep").dialog("close");
}

function doChangeStep()
{
	document.aspnetForm.action = changeStepURL;
	document.aspnetForm.submit();
}

function openChangeStepDlg()
{
	getEl("dlgChangeStepText").innerHTML = changeStepText;
	$("#dlgChangeStep").dialog({ autoOpen: false, width: 450, height: changeStepDlgHeight, modal: true, resizable: false, draggable: false });
	$("#dlgChangeStep").dialog("open");
}

function openHelpDlg1()
{
	$("#dlgHelp1").dialog({ position: [(($(document).width() / 2) - 150), 35], width: 500, height: 525, autoOpen: false, draggable: false, resizable: false, modal: false });
	$("#dlgHelp1").dialog("open");
}

function openHelpDlg2()
{
	$("#dlgHelp2").dialog({ position: [(($(document).width() / 2) - 150), 35], width: 500, height: 525, autoOpen: false, draggable: false, resizable: false, modal: false });
	$("#dlgHelp2").dialog("open");
}

