function uf_InitializeConfirmDiscard(){uf_SetModifyEventHandler();uf_SetConfirmEventHandler()}function uf_SetModifyEventHandler(){var b=document.forms.length;for(intCtr=0;intCtr<b;intCtr++){formValue=document.forms[intCtr];var a=formValue.elements.length;for(intCtr2=0;intCtr2<a;intCtr2++){objElem=formValue.elements[intCtr2];objType=objElem.type.toLowerCase();if(objElem.getAttribute("excludeonConfirmDiscard")){if(objElem.getAttribute("excludeonConfirmDiscard").toLowerCase()=="true"){continue}}else{if(objElem.getAttribute("onchangeConfirmDiscard")){if(objElem.getAttribute("onchangeConfirmDiscard").toLowerCase()=="true"){continue}}else{if(objElem.getAttribute("onclickConfirmDiscard")){if(objElem.getAttribute("onclickConfirmDiscard").toLowerCase()=="true"){continue}}}}if(objType!="button"&&objType!="hidden"&&objType!="submit"&&objType!="reset"&&objType!="password"){if(objType=="checkbox"||objType=="radio"){if(objElem.onclick){objElem.onclickBeforeModify=objElem.onclick}objElem.onclick=uf_ModifyEventHandler}else{if(objElem.onchange){objElem.onchangeBeforeModify=objElem.onchange}objElem.onchange=uf_ModifyEventHandler}}}}}function uf_ModifyEventHandler(){if(this.type=="checkbox"||this.type=="radio"){if(this.onclickBeforeModify){this.onclickBeforeModify()}}else{if(this.onchangeBeforeModify){this.onchangeBeforeModify()}}uf_SetModifiedFlag()}function uf_SetConfirmEventHandler(){var b=document.forms.length;var a=document.links.length;for(intCtr=0;intCtr<b;intCtr++){formValue=document.forms[intCtr];var c=formValue.elements.length;for(intCtr2=0;intCtr2<c;intCtr2++){objElem=formValue.elements[intCtr2];if(objElem.getAttribute("onclickConfirmDiscard")){if(objElem.getAttribute("onclickConfirmDiscard").toLowerCase()=="true"){if(objElem.onclick){objElem.onclickBeforeConfirm=objElem.onclick}objElem.onclick=uf_ConfirmDiscardOnClick}}if(objElem.getAttribute("onchangeConfirmDiscard")){if(objElem.getAttribute("onchangeConfirmDiscard").toLowerCase()=="true"){if(objElem.onclick){objElem.onclickBeforeSaveValue=objElem.onclick}objElem.onclick=uf_SaveValueOnClick;if(objElem.onchange){objElem.onchangeBeforeConfirm=objElem.onchange}objElem.onchange=uf_ConfirmDiscardOnChange}}}}for(intCtr=0;intCtr<a;intCtr++){objElem=document.links[intCtr];if(objElem.getAttribute("onclickConfirmDiscard")){if(objElem.getAttribute("onclickConfirmDiscard").toLowerCase()=="true"){if(objElem.onclick){objElem.onclickBeforeConfirm=objElem.onclick}objElem.onclick=uf_ConfirmDiscardOnClick}}}}function uf_SaveValueOnClick(){if(this.type.substr(0,6).toLowerCase()=="select"){this.setAttribute("prevIndex",this.selectedIndex)}if(this.onclickBeforeSaveValue){return this.onclickBeforeSaveValue()}}function uf_ConfirmDiscardOnClick(){var a;if(uf_IsModified()){if(confirm("Discard changes?")){if(this.onclickBeforeConfirm){a=(this.onclickBeforeConfirm())}uf_ResetModifiedFlag()}else{return false}}else{if(this.onclickBeforeConfirm){a=(this.onclickBeforeConfirm())}}return a}function uf_CallDiscardOnClick(){if(uf_IsModified()){if(confirm("Discard changes?")){return true}else{return false}}return true}function uf_ConfirmDiscardOnChange(){var a;if(uf_IsModified()){if(confirm("Discard changes?")){if(this.onchangeBeforeConfirm){a=this.onchangeBeforeConfirm()}uf_ResetModifiedFlag()}else{if(this.type.substr(0,6).toLowerCase()=="select"){this.selectedIndex=this.getAttribute("prevIndex");return false}}}else{if(this.onchangeBeforeConfirm){a=this.onchangeBeforeConfirm()}}return a}function uf_IsModified(){if(document.getElementById("hfModified")){if(document.getElementById("hfModified").value.toLowerCase()!="false"&&document.getElementById("hfModified").value.toLowerCase()!="true"){document.getElementById("hfModified").value="false"}if(document.getElementById("hfModified").value.toLowerCase()=="true"){return true}else{return false}}else{return false}}function uf_ResetModifiedFlag(){if(document.getElementById("hfModified")){document.getElementById("hfModified").value="false"}}function uf_SetModifiedFlag(){if(document.getElementById("hfModified")){document.getElementById("hfModified").value="true"}};
