function StartWizard(ixJobItem, url) {
	var callResult = TfrmPickApplication.SetCurrentJobItem(ixJobItem);
	if (callResult.error)
		alert("Unable to open the selection page; " + callResult.error);
	else {
		var callResult = TfrmPickApplication.SetCurrentJobItemReloadFlag();
		if (callResult.error)
			alert("Unable to open the selection page; " + callResult.error);
		document.location.href = url;
	}
}

//Used in OLD design only:
function NewJobItem() {
	StartWizard(0, VRSApplicationPath + "/hx/chooseapp.aspx");
    return false;
}

function EmailPasswordTo(toAddress) {
	toAddress = prompt("Please enter your email address and click OK to continue.", toAddress);
	if (!toAddress)
		return;
	var callResult = TfrmLogIn.EmailAccountInfo(toAddress);
	if (callResult.error)
		alert("Unable to send a password email; " + callResult.error);
	else
		alert("An email has been sent with your login information.  You should receive it soon.");
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

createCookie('localTimeOffset', (new Date()).getTimezoneOffset(), 1);
