function uf_InitializeConfirmDiscard(){uf_SetModifyEventHandler();uf_SetModifyEventHandlerforImages();uf_SetConfirmEventHandler();uf_SetConfirmEventHandlerforImages()}function uf_SetModifyEventHandler(){var c=document.forms.length;for(intCtr=0;intCtr<c;intCtr++){formValue=document.forms[intCtr];var b=formValue.elements.length;for(intCtr2=0;intCtr2<b;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"){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"||this.type=="image"){if(this.onclickBeforeModify){this.onclickBeforeModify()}}else{if(this.onchangeBeforeModify){this.onchangeBeforeModify()}}uf_SetModifiedFlag()}function uf_SetConfirmEventHandler(){var d=document.forms.length;var c=document.links.length;for(intCtr=0;intCtr<d;intCtr++){formValue=document.forms[intCtr];var b=formValue.elements.length;for(intCtr2=0;intCtr2<b;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.type.substr(0,6).toLowerCase()=="select"){objElem.setAttribute("prevIndex",objElem.selectedIndex)}if(objElem.onchange){objElem.onchangeBeforeConfirm=objElem.onchange}objElem.onchange=uf_ConfirmDiscardOnChange}}}}for(intCtr=0;intCtr<c;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 b;if(uf_IsModified()){if(confirm("Discard changes?")){if(this.onclickBeforeConfirm){b=(this.onclickBeforeConfirm())}uf_ResetModifiedFlag()}else{return false}}else{if(this.onclickBeforeConfirm){b=(this.onclickBeforeConfirm())}}return b}function uf_CallDiscardOnClick(){if(uf_IsModified()){if(confirm("Discard changes?")){return true}else{return false}}return true}function uf_ConfirmDiscardOnChange(){var b;if(uf_IsModified()){if(confirm("Discard changes?")){if(this.onchangeBeforeConfirm){b=this.onchangeBeforeConfirm()}uf_ResetModifiedFlag()}else{if(this.type.substr(0,6).toLowerCase()=="select"){this.selectedIndex=this.getAttribute("prevIndex");return false}}}else{if(this.onchangeBeforeConfirm){b=this.onchangeBeforeConfirm()}}return b}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"}}function uf_SetModifyEventHandlerforImages(){var b=document.getElementsByTagName("input");for(a=0;a<b.length;a++){if(b[a].id.indexOf("uc_footerCtrl.ID")!=-1){if(b[a].getAttribute("excludeonConfirmDiscard")){if(b[a].getAttribute("excludeonConfirmDiscard").toLowerCase()=="true"){continue}}else{if(b[a].getAttribute("onchangeConfirmDiscard")){if(b[a].getAttribute("onchangeConfirmDiscard").toLowerCase()=="true"){continue}}else{if(b[a].getAttribute("onclickConfirmDiscard")){if(b[a].getAttribute("onclickConfirmDiscard").toLowerCase()=="true"){continue}}}}if(b[a].onclick){b[a].onclickBeforeModify=b[a].onclick}}}}function uf_SetConfirmEventHandlerforImages(){var b=document.getElementsByTagName("input");for(a=0;a<b.length;a++){if(b[a].id.indexOf("uc_footerCtrl.ID")!=-1){if(b[a].getAttribute("onclickConfirmDiscard")){if(b[a].getAttribute("onclickConfirmDiscard").toLowerCase()=="true"){if(b[a].onclick){b[a].onclickBeforeConfirm=b[a].onclick}b[a].onclick=uf_ConfirmDiscardOnClick}}}}};