");
}
}));
//Previous Button
var prevhandler;
$(document).ready((function () {
if($("#PreviousButton")){
prevhandler = $("#PreviousButton").prop('onclick');
$("#PreviousButton").prop("onclick", null).off("click");
//$("#PreviousButton").attr('onclick','');
$("#PreviousButton").on('click', function(){
if($("input.dirty,textarea.dirty,select.dirty").length > 0){
ConfirmDialog("Changes have been made which will be lost. Are you sure you wish to continue?");
return false;
}
else {
prevhandler.call();
return true;
}
});
}
}));
function ConfirmDialog(message) {
$('').appendTo('body')
.html('
' + message + '
')
.dialog({
dialogClass: "no-close",
modal: true,
title: 'Warning',
zIndex: 10000,
autoOpen: true,
width: 'auto',
resizable: false,
buttons: {
Yes: function() {
$(this).dialog("close");
prevhandler.call();
//restore previous click behaviour incase page takes a while to load
//$("#PreviousButton").prop("onclick", null).off("click");
//$("#PreviousButton").on("click", prevhandler);
},
No: function() {
$(this).dialog("close");
}
},
close: function(event, ui) {
$(this).remove();
}
});
}
// Read a page's GET URL variables and return them as an associative array.
function getUrlVars()
{
var vars = [], hash;
var qs = window.location.href.slice(window.location.href.indexOf('?') + 1);
qs = qs.slice(0, (qs.indexOf('#') > 0 ? qs.indexOf('#') : qs.length));
var hashes = qs.split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
//function iOS() {
// return ([
// 'iPad Simulator',
// 'iPhone Simulator',
// 'iPod Simulator',
// 'iPad',
// 'iPhone',
// 'iPod'
// ].includes(navigator.platform)
// // iPad on iOS 13 detection
// || (navigator.userAgent.includes("Mac") && "ontouchend" in document))
// && !window.MSStream
//}
//if(iOS()){
// window.onload = function() {
// if (!window.jQuery) {
// setTimeout(function(){ document.location.href = '/ie';},500);
// }
// }
//}