var LastSelectedElement = null; var UserEdittedFlag = false; var UpdateXrML = true;

function Cancel(){var Agree = confirm("All information entered will be lost. Are you sure you want to continue ?");if (Agree) parent.location = "TemplatePage.aspx";return false;}
function RefreshXrML(){if (UpdateXrML) parent.frames[1].location = "XmlView.aspx"; else UserEditted(); return false;}
function ClearXrML(){parent.frames[1].document.write("<html><head><title></title></head><body><p><b><font color='#0000FF' face='Verdana'>Working ...</font></b></p></body></html>"); parent.frames[1].document.close(); return false;}
function LoadSamplePage(licenseFileName){var Agree = confirm("Loading sample license will overwrite current inputs. Do you want to continue ?");if (Agree) parent.location = "Samples.aspx?file=" + licenseFileName;return false;}
function DisplayHelp(htmlPage){helpWindow = window.open(htmlPage, "help","toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes");helpWindow.focus();}
function KeyPress(){var result = true;if (event.keyCode == 13) result = false;if (result == true) UserEditted(); return result;}
function DisplayDescription2(theId, htmlPage){if (LastSelectedElement != null){LastSelectedElement.style.fontWeight = 'normal';LastSelectedElement.style.color = "Blue";}LastSelectedElement = document.getElementById(theId); LastSelectedElement.style.fontWeight = 'bold';LastSelectedElement.style.color = "#CC0900";document.getElementById("DescriptionFrame").src = htmlPage;}
function DisplayDescription(theId, html){if (LastSelectedElement != null){LastSelectedElement.style.fontWeight = 'normal';LastSelectedElement.style.color = "Blue";}LastSelectedElement = document.getElementById(theId); LastSelectedElement.style.fontWeight = 'bold';LastSelectedElement.style.color = "#CC0900";Description.innerHTML = html;}
function SetDefaultDescription(){LastSelectedElement = document.getElementById("TutorialLabel"); LastSelectedElement.style.fontWeight = 'bold';LastSelectedElement.style.color = "#CC0900";document.getElementById("DescriptionFrame").src = "Descriptions/Tutorial.htm";return false;}
function DisplayCalendar(){return false;}
function IntegerHandler(e){ var key = (navigator.appName == "Netscape") ? e.which : e.keyCode;if ( (key > 47 && key < 58)  || (key > 32 && key < 41) || (key == 8 || key == 9 || key == 45 || key == 46) || (key > 95 && key < 106) )return true;else return false;}
function FloatHandler(e){var key = (navigator.appName == "Netscape") ? e.which : e.keyCode;if ( (key > 47 && key < 58)  || (key > 32 && key < 41) || (key == 8 || key == 9 || key == 45 || key == 46 || key == 190) || (key > 95 && key < 106) || (key == 110) ) return true;else return false;}
function RightsListBoxSelect(itemSelect, rightControlID){with(itemSelect){var rightSelect = options[selectedIndex].value; RightsListBox(rightSelect, rightControlID) } UserEditted(); return false;}
function RightsListBox(right_name, rightControlID){EnableInput(right_name, rightControlID, "DestinationCheckBox"); EnableInput(right_name, rightControlID, "DestX509Radio"); EnableInput(right_name, rightControlID, "DestX509Upload"); EnableInput(right_name, rightControlID, "DestRefreshBtn"); EnableInput(right_name, rightControlID, "DestOthersRadio"); EnableInput(right_name, rightControlID, "DestOthersDropDownList"); EnableInput(right_name, rightControlID, "DestOthersTextBox"); EnableInputA(right_name, rightControlID, "RendererCheckBox"); EnableInputA(right_name, rightControlID, "RendererX509Radio"); EnableInputA(right_name, rightControlID, "RendererX509Upload"); EnableInputA(right_name, rightControlID, "RendererRefreshBtn"); EnableInputA(right_name, rightControlID, "RendererCertificateTextBox"); EnableInputA(right_name, rightControlID, "RendererOthersRadio"); EnableInputA(right_name, rightControlID, "RendererOthersTextBox"); return false;}
function EnableInput(rightsName, parentControlID, controlName){var name = parentControlID + "_" + controlName;var theElement = document.getElementById(name); if (theElement != null){if (rightsName == "Play" || rightsName == "Print"){theElement.disabled = true;}else {theElement.disabled = false;}}}
function EnableInputA(rightsName, parentControlID, controlName){var name = parentControlID + "_" + controlName;var theElement = document.getElementById(name);if (theElement != null){if (rightsName == "Move" || rightsName == "Adapt"){theElement.disabled = true;}else {theElement.disabled = false;}}}
function UserEditted(){if (UserEdittedFlag == false){var theElement = document.getElementById("RefreshXrML");if (theElement != null){theElement.style.color = "#AB0000"; theElement.style.fontWeight = 'bold'; UserEdittedFlag = true;}theElement = document.getElementById("RefreshXrML2");if (theElement != null){theElement.style.color = "#AB0000";theElement.style.fontWeight = 'bold';UserEdittedFlag = true;}} return true;}
function OnCalendarClick(calID, ImageID){var editObject = document.getElementById(calID); theCal.select(editObject, ImageID, 'M/d/yyyy', editObject.value); }
function DateHandler(e){ var key = (navigator.appName == "Netscape") ? e.which : e.keyCode; if ( (key > 47 && key < 58)  || (key > 32 && key < 41) || (key == 8 || key == 9 || key == 45 || key == 46 || key == 191) || (key > 95 && key < 106) ) return true; else return false;}
function DisplayError(){alert("Error(s) found in one or more inputs.  Please check and correct.");}

