if (window.confirmCancel) { var cancon = confirmCancel(); if( cancon == true && window.resetPageState) {resetPageState();}return cancon; } else { if (window.resetPageState) {resetPageState();} return true; }