<script type="text/javascript">
    dontApplyConflictJS=true;
</script>
<%if(session.getAttribute("SERVICEDESK_NEWUI_PAGE")!= null && request.getParameter("isNewUIAvailable")!=null && request.getParameter("isNewUIAvailable").equals("yes")){%>
<link rel="stylesheet" type="text/css" href="css/headerTop.css">
<link rel="stylesheet" type="text/css" href="css/settings_newUI.css">
<link rel="stylesheet" type="text/css" href="assets/css/multiple-select.min.css">
<link rel="stylesheet" href="assets/css/perfect-scrollbar.min.css"/>
<link rel="stylesheet" type="text/css" href="assets/css/notie.css">
<script type="text/javascript" src="assets/js/i18n/i18n.js"></script>
<script type="text/javascript" src="assets/js/i18n/messages_${LANGUAGE_UNICODE}.js"></script>
<%if(request.getParameter("jqueryWithProtoReq")!=null && request.getParameter("jqueryWithProtoReq").equals("yes")){%>
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/prototype.js"></script>
<%}%>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="assets/js/multiple-select.min.js"></script>
<script type="text/javascript" src="assets/js/perfect-scrollbar.min.js"></script>
<%if(request.getParameter("spectrumPlugin")!=null && request.getParameter("spectrumPlugin").equals("yes")){%>
<link rel="stylesheet" type="text/css" href="assets/css/spectrum.min.css">
<script type="text/javascript" src="assets/js/spectrum.min.js"></script>
<%}%>
<script src="js/tooltipJs.js" type="text/javascript"></script>
<style type="text/css">
    #text {margin:50px auto; width:500px}

    .hotspot {color:#900; padding-bottom:1px; cursor:pointer;}

    #tt {position:absolute;  display:block;  bgcolor : #666666;}
    #tttop {display:block; height:5px; margin-left:5px; background : #666666; overflow:hidden; border-top-left-radius: 15px; border-top-right-radius: 15px;}
    #ttcont {display:block; padding:2px 12px 3px 7px; margin-left:5px; background:#666; color:#FFF}
    #ttbot {display:block; height:5px; margin-left:5px; background : #666666; overflow:hidden; border-bottom-right-radius: 15px;}
</style>
<script type="text/javascript">
    jQuery(function(){
        if(jQuery("#settingsdiv").hasClass("assetLeftPanel")===true || jQuery(".isCMDBSetting #settingsdiv").hasClass("assetLeftPanel")===true){
            jQuery(".assetMainFrame .floatRightAsset select#moduleId,.assetMainFrame.BarCodeConfigList select#moduleId,.assetMainFrame .floatRight select#moduleId,.assetNumFormat.assetMainFrame select#moduleId,.assetMainFrame.assetRPAconfig select#moduleId").multipleSelect({
                single:true,
                width:200
            });
            jQuery("select#roles,select#ciType,.assetMainFrame.fieldList select#assettype").multipleSelect({
                single:true,
                width:350
            });
            setPinOption = function(isPinned){
                jQuery.ajax({
                    url: "setLeftMenuPin.do",
                    type: "POST",
                    data:'isPinned='+isPinned,
                    dataType: 'json'
                });
            };
            jQuery(document).on("click",".assetLeftPanel #mainMenu .pinIco",function(){
                setPinOption(1);
                jQuery(this).addClass("unpinIco").removeClass("pinIco");
                jQuery("body").addClass("responsive");
                var gridID=jQuery(".commonGridWid").attr("id");
                if(gridID!==null && gridID!== undefined) {
                    var paginationGridControl = Ext.getCmp('' + gridID);
                    paginationGridControl.setWidth(screen.width - 260);

                }
            });
            jQuery(document).on("click",".assetLeftPanel #mainMenu .unpinIco",function(){
                setPinOption(0);
                jQuery(this).addClass("pinIco").removeClass("unpinIco");
                jQuery("body").removeClass("responsive");
                var gridID=jQuery(".commonGridWid").attr("id");
                if(gridID!==null && gridID!== undefined) {
                    var paginationGridControl = Ext.getCmp('' + gridID);
                    paginationGridControl.setWidth(screen.width - 130);
                }
            });
            jQuery("select#defaultFilter").multipleSelect({
                single:true,
                width:350
            });
            jQuery("#navigation").addClass("assetConfigNav");
            jQuery("div#settingsdiv.assetLeftPanel .widgetOuterWrapper").perfectScrollbar();
            jQuery(".assetLeftPanel").append('<a id="mainMenu" href="javascript:void(0)" title="Pin Panel" class="pinPanel"><i class="ico pinIco"></i></a>');
            <c:if test="${sessionScope.LEFTPANELMENU_PIN eq '1'}">
                if(jQuery("#settingsdiv").hasClass("assetLeftPanel")===true) {
                    jQuery(".assetLeftPanel #mainMenu .pinIco").click();
                }
            </c:if>
        }
        jQuery("select#paginationrowcount").multipleSelect({
            single:true,
            onClick:function(){
                var isGridloaded=setInterval(function() {
                    if(jQuery(".x-mask-msg-default").is(":visible")===false) {
                        var gridID = jQuery(".commonGridWid").attr("id");
                        if (jQuery("body").hasClass("responsive") === false) {
                            if (gridID !== null && gridID !== undefined) {
                                var paginationGridControl = Ext.getCmp('' + gridID);
                                paginationGridControl.setWidth(screen.width - 130);
                            }
                        } else {
                            if (gridID !== null && gridID !== undefined) {
                                var paginationGridControl = Ext.getCmp('' + gridID);
                                paginationGridControl.setWidth(screen.width - 260);
                                
                            }
                        }
                        paginationGridControl.setHeight(undefined);
                        paginationGridControl.maxHeight = 350;
                        paginationGridControl.body.setStyle({
                            
                            'max-height': '350px'
                        });                        
                        paginationGridControl.updateLayout();
                         var gridID3=jQuery(".emailGridWid").attr("id");
                        if(gridID3!==null && gridID3!== undefined) {
                            var paginationGridControl = Ext.getCmp('' + gridID3);
                            if(jQuery("#PlusMinusImg").attr("src")=='icon_minus.gif'){
                                paginationGridControl.setWidth(screen.width - 145); 
                            }
                            paginationGridControl.setHeight(undefined);
                            paginationGridControl.maxHeight = 270;
                            paginationGridControl.body.setStyle({
                                
                                'max-height': '270px'
                            });
                            paginationGridControl.updateLayout();
                        }
                        clearInterval(isGridloaded);
                    }
                },100)
            }
        });
        jQuery("select#macroList").multipleSelect({
            single:true
        });
        //Email to Rec config multiple select elements
        if(jQuery("form[action='MailServerConfiguration'] select#project").length){
            jQuery("form[action='MailServerConfiguration'] select#project").multipleSelect({
                single:true,
                width: 350, 
                onClick:function(){
                     setTimeout(function(){jQuery("#ServiceLine").multipleSelect("refresh");},100);
                }
            });
             jQuery("form[action='MailServerConfiguration'] select#ServiceLine").multipleSelect({
                single:true,
                width: 350, 
                onClick:function(){
                     setTimeout(function(){jQuery("select#category,select#urgencyID,select#impactID,select#submit_through").multipleSelect("refresh");},100);
                }
            });
             jQuery("form[action='MailServerConfiguration'] select#category").multipleSelect({
                single:true,
                width: 350, 
                onClick:function(){
                     setTimeout(function(){jQuery("#subCategoryId").multipleSelect("refresh");},100);
                }
            });  
               jQuery("select#subCategoryId,select#urgencyID,select#impactID").multipleSelect({
                single:true,
                width: 350
            });          
            jQuery("select#folderslist").multipleSelect({
                selectAll: false,
                width: 350
            });
        }
        jQuery("select#feedbackHtmlType,select#datasource,select#SurveyID,select#provider").multipleSelect({
            single:true,
            width:350
        });
        //Project config multiple select elements
      
        //Project config single select elements
        if(jQuery("select#projectType,select#projectTemplate").length){
            jQuery("select#projectType,select#projectTemplate").multipleSelect({
                single: true,
                width: 350
            });
        }
        jQuery("select[multiple]:not(.ms-offscreen)#location,select[multiple]:not(.ms-offscreen)#department,select[multiple]:not(.ms-offscreen)#roles,select[multiple]:not(.ms-offscreen)#users,select#specificRoles[multiple]").multipleSelect({
            selectAll:false,
            filter:true
        });
        jQuery("#levelOneIntervalHours,#levelOneIntervalMins,#levelTwoIntervalHours,#levelTwoIntervalMins,select#levelOneNotificationhour").multipleSelect({
            single:true,
            width:70
        });
        setTimeout(function(){
            var gridID=jQuery(".commonGridWid").attr("id");
            if(gridID!==null && gridID!== undefined) {
                var paginationGridControl = Ext.getCmp('' + gridID);
                paginationGridControl.setWidth(screen.width - 130);
                if(jQuery("body").hasClass("responsive")===true && jQuery("#settingsdiv").hasClass("assetLeftPanel")===true){
                    paginationGridControl.setWidth(screen.width - 260);
                }
                paginationGridControl.setHeight(undefined);
                paginationGridControl.maxHeight = 350;
                paginationGridControl.body.setStyle({
                    'max-height': '350px'
                });
                paginationGridControl.updateLayout();
            }
            if(jQuery(".commonGridWid2").length){
                for(var i=0;i<jQuery(".commonGridWid2.x-grid").length;i++){
                     var gridElem=jQuery(".commonGridWid2.x-grid")[i];
                     var gridID2=gridElem.id;
            if(gridID2!==null && gridID2!== undefined) {
                var paginationGridControl = Ext.getCmp('' + gridID2);
                paginationGridControl.setWidth(screen.width - 150);
                paginationGridControl.setHeight(undefined);
                paginationGridControl.maxHeight = 200;
                paginationGridControl.body.setStyle({
                    
                    'max-height': '200px'
                });
                paginationGridControl.updateLayout();
            }
                }
            }
              var gridID3=jQuery(".emailGridWid").attr("id");
            if(gridID3!==null && gridID3!== undefined) {
                var paginationGridControl = Ext.getCmp('' + gridID3);
                paginationGridControl.setHeight(undefined);
                paginationGridControl.maxHeight = 270;
                paginationGridControl.body.setStyle({
                    
                    'max-height': '270px'
                });
                paginationGridControl.updateLayout();
            }
        },500);
        jQuery(document).on("mouseover","#navigation>div > ul >li",function(e){
            jQuery("#subNavigation > ul:visible").position({
                my: "center top",
                at: "center top+35",
                of: ".current_tab",
                collision: "none"
            });
        });
        jQuery(window).on("scroll",function(){
            var scrollPos=jQuery(window).scrollTop();
            if(scrollPos>30){
                jQuery("#outerWrapper").addClass("minHt70");
                jQuery("#header_new").addClass("fixedHeader");
            }else{
                jQuery("#outerWrapper").removeClass("minHt70");
                jQuery("#header_new").removeClass("fixedHeader");
            }
        });
        jQuery(document).on("click","#profilePictureLnk",function(){
            if(!jQuery(".userNav").hasClass("open")){
                jQuery(".userNav").show().addClass("open");
            }
            else{
                jQuery(".userNav").hide().removeClass("open");
            }
        });
        jQuery(document).on("click",function(e){
            if(!jQuery(e.target).is(".userNav,.userNav *,#profilePictureLnk")){
                jQuery(".userNav").hide().removeClass("open");
            }
        });
        jQuery("select#assetmodulelist").multipleSelect({
            single:true,
            width:250
        });
        jQuery(".assetMainFrame .formfield select#accessto[multiple]").multipleSelect({
            selectAll:false,
            width:350
        });
        jQuery("#assetModuleType").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                var checkExist=setInterval(function() {
                    if(jQuery(".assetMainFrame .formfield select#accessto[multiple]").is(":visible")===true) {
                        jQuery(".assetMainFrame .formfield select#accessto[multiple]").multipleSelect({
                            selectAll: false,
                            width: 350
                        });
                        clearInterval(checkExist);
                    }
                });
            }
        });
        jQuery("#assettypediv select#assettype").multipleSelect({
            single:true
        });
        jQuery("select#assetfields").multipleSelect({
            single:true
        });
        jQuery("select#visibleComponentType").multipleSelect({
            single:true
        });
        jQuery("select#assetreconciliationrule").multipleSelect({
            single:true
        });
        jQuery("select#relationshipparam").multipleSelect({
            single:true
        });
        jQuery('.assetMainFrame form[action="userAcceptanceConfigOperation"] select[multiple]#itemtypeid,.assetMainFrame form[action="userAcceptanceConfigOperation"] select[multiple]#locationid,.assetMainFrame form[action="userAcceptanceConfigOperation"] select[multiple]#departmentid,.assetMainFrame form[action="userAcceptanceConfigOperation"] select[multiple]#roleid').multipleSelect({
            selectAll: false,
            width: 350,
            filter:true
        });
        jQuery(".assetMainFrame select#Assetadvfiltervalues").multipleSelect({
            single:true,
            width:350
        });
        jQuery(".assetMainFrame select#assetItemType").multipleSelect({
            single:true,
            width:350
        });
        //survey-analysis chart width update
        if(jQuery("#SurveyAnalysis").is(":visible")) {
            var containerWidth=jQuery("#SurveyAnalysis").width()-50;
            $("#SurveyAnalysis").updateFusionCharts({
                width: containerWidth
            });
        }
        if(jQuery(".assetMainFrame").hasClass("ciTypeAttr")){
            jQuery("select#assetid,select#purchaseid,select#salvageid,select#typeid").multipleSelect({
                single:true,
                width:350
            });
        }
        jQuery(".assetMainFrame #BarCode select#Assetadvfilter").multipleSelect({
            single:true,
            width:350
        });
        jQuery(".assetMainFrame.notifyGeneric select#Assetadvfilter").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                setTimeout(function(){
                    jQuery("select#Assetadvfiltervalues").multipleSelect("refresh");
                },100);
            }
        });
        jQuery(".assetMainFrame.notifyGeneric select#conditionfield").multipleSelect({
            single:true
        });
        jQuery(".assetMainFrame.notifyGeneric select#genericNotificationCategory").multipleSelect({
            single:true
        });
        jQuery(".assetMainFrame.notifyGeneric select#resolutionHour").multipleSelect({
            single:true
        });
        jQuery(".assetMainFrame.notifyGeneric select#resolutionMin").multipleSelect({
            single:true
        });
        jQuery(".assetMainFrame.notifyGeneric select#severity").multipleSelect({
            single:true
        });
        jQuery(".assetMainFrame.notifyGeneric select#NotificationProfile").multipleSelect({
            single:true
        });
        jQuery(window).on("load",function(){
            jQuery("select#assetModuleIds").multipleSelect({
                single: true,
                width: 350
            });
        });
        jQuery("select#htmlcontrol").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                setTimeout(function(){
                    if(jQuery("select#htmlcontrol").val()==="18" || jQuery("select#htmlcontrol").val()==="13"){
                        var checkExistSelect1=setInterval(function(){
                            if(jQuery("select[id^=columnType]").is(":visible")===true) {
                                jQuery("select[id^=columnType],select[id^=fieldType]").multipleSelect({
                                    single: true,
                                    width: 350
                                });
                                clearInterval(checkExistSelect1);
                            }
                        },100);
                    }else if(jQuery("select#htmlcontrol").val()==="19"){
                        var checkExistSelect2=setInterval(function(){
                            if(jQuery("select#assetModuleIds").is(":visible")===true) {
                                jQuery("select#assetModuleIds").multipleSelect({
                                    single: true,
                                    width: 350
                                });
                                clearInterval(checkExistSelect2);
                            }
                        },100);
                    }
                },200);
            }
        });
        if(jQuery("select#htmlcontrol").val()==="18" || jQuery("select#htmlcontrol").val()==="13"){
            var checkExistMacroEdit1=setInterval(function(){
                if(jQuery("select[id^=columnType]").is(":visible")===true) {
                    jQuery("select[id^=columnType],select[id^=fieldType]").multipleSelect({
                        single: true,
                        width: 350
                    });
                    clearInterval(checkExistMacroEdit1);
                }
            },100);
        }
        jQuery(".sms_record select#project").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                jQuery("select#service").multipleSelect("refresh");
            }
        });
        jQuery(".sms_record select#service").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                jQuery("select#category").multipleSelect("refresh");
            }
        });
         jQuery(".sms_record select#category").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                jQuery("select#subCategory").multipleSelect("refresh");
            }
        });
         jQuery(".sms_record select#subCategory").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                jQuery("select#submit_through").multipleSelect("refresh");
            }
        });
		
 		jQuery(".mailNotifyTemp select#assettype").multipleSelect({
            single:true,
            width:350
        });
         jQuery(".mailNotifyTemp select#assetstatus").multipleSelect({
            single:true,
            width:350
        });
       
         jQuery("select#assettype").on("change",function(){
            setTimeout(function(){
                jQuery("select#assetfields").multipleSelect("refresh");
            },100);
        });
		jQuery("select#scheduler, select#hoursInterval, select#hour, select#date,select#assetAction, select#moduleId:not(.ms-offscreen), select#macro, select#accesspermission, select#fixedField, select#componentId, select#dependentField, select#name, select#templateType,select#additionalfield, select#notificationtype, select#macroentering, select#fixedfieldid, select#lifecyclefield, select#specfictemplate, select#status, select#className, select#propertyName, select#Template, select#depreciationSelect,select#itemtype, select#ConnectionStyle,select#assetstate, select#submit_through, .assetNotifyRule select#assettype, .assetPrePost select#actionType,select#fieldid,select#actionId,select#defaultfieldid").multipleSelect({
            single:true,
            width:350
        });
 		
          jQuery(".assetImportTemp select#type").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                
                var projectSelectExist=setInterval(function(){
                if(jQuery("select:not(.ms-offscreen)#project").is(":visible")){
                    jQuery("select:not(.ms-offscreen)#project").multipleSelect({
                        single:true,
                        width:350
                    });
                    
                    clearInterval(projectSelectExist);
                }
            },100);
            if(jQuery("select#assetfields + .ms-parent").is(":visible")){
                setTimeout(function(){
                    jQuery("select#assetfields").multipleSelect("refresh");
                },500);
            }

          }
      });
		var checkExistProgress=setInterval(function(){if(jQuery("#progressMsg").is(":visible")===false){jQuery(".assetImportTemp select#project").multipleSelect({
            single:true,
            width:350
          });clearInterval(checkExistProgress)}},100);
		var projectApplied2=false;
          jQuery(".assetImport select#assettype").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                if(projectApplied2===false){
                var projectSelectExist2=setInterval(function(){
                if(jQuery("select:not(.ms-offscreen)#assetstate").is(":visible")){
                    jQuery("select:not(.ms-offscreen)#assetstate").multipleSelect({
                        single:true,
                        width:350
                    });
                    projectApplied2=true;
                    clearInterval(projectSelectExist2);
                }
            },100);
            }

          }
      });
		jQuery(".assetNotifyRule select#assetstatus1, .assetNotifyRule select#assetstatus").multipleSelect({
                    single:true
            });

      jQuery(".assetNotifyRule select#assetstatus1 + .ms-parent").hide();
          jQuery(".assetNotifyRule select#actiontype").multipleSelect({
            single:true,
            onClick:function(){
               setTimeout(function(){
console.log("code block");
               jQuery("select#assetstatus, select#assetstatus + .ms-parent, select#assetstatus1, select#assetstatus1 + .ms-parent ").hide();
                var catID=jQuery("#actiontype").val();
                if(catID==="4"){
                    jQuery("select#assetstatus + .ms-parent").show();
                    
                }
                if(catID==="6"){
                    jQuery("select#assetstatus1 + .ms-parent").show();
            
                }
            },100);
            }
         });
 		jQuery(".fileIp").append('<label class="choosedFileName">Choose</label>');
          jQuery(document).on("change","#importXslFile",function(){
            var filename = jQuery(this).val();
            jQuery(this).siblings('.choosedFileName').text(filename.split('\\').pop());
        });
        setTimeout(function(){jQuery("select#projectType,select#projectTemplate").multipleSelect("refresh");},500);
        jQuery(document).on("change","#attachScript",function(){
            var filename = jQuery(this).val();
            if(filename==""){
                jQuery(this).siblings('.choosedFileName').text("Choose");
            }else{
                jQuery(this).siblings('.choosedFileName').text(filename.split('\\').pop());
            }
        });
        jQuery(document).on("change","select#fieldid",function(){
            setTimeout(function(){jQuery("select#actionId").multipleSelect("refresh")},500);
        });
        jQuery(document).on("mouseup",".applyCloseIco .olclo img,.applyCloseIco .olclo",function(){
            document.querySelector('body').classList.remove("showPopupTitle");
    });
        jQuery("select#announcementAdditionalList").multipleSelect({
                single:true,
                width:350
    });
        jQuery(".assetMainFrame select#componentType,.assetMainFrame select#fixedfieldType").multipleSelect({
            single:true,
            width:350
        });
        jQuery(".assetMainFrame select#componentType").on("change",function(){
            setTimeout(function(){
                jQuery(".assetMainFrame select#fixedfieldType").multipleSelect("refresh")
            },500)
        });
        jQuery("select#searchAttributes").multipleSelect({
            single:true,
            width:200
        });
        jQuery(".avoidTooltipCollision").hover(function(){
           $("#tt").addClass("rightAlign");
        },function(){
            $("#tt").hide();
            $("#tt").removeClass("rightAlign");
        });
        jQuery("select.isVisibleDropDown:not(.ms-offscreen)").multipleSelect({
            single:true
        });
        jQuery("select#assetmoduleId,select#timescale,select#searchField,select#ParticipatedDetails").multipleSelect({
            single:true,
            width:200
        });
        jQuery(".assetNumFormat.assetMainFrame select#Macro,.assetNumFormat.assetMainFrame select#assettype,select#ruleType,select#templateList,select#parameter1,select#constraint1,select#conditionaloperators1,select#ruleconditionals1,select#parentType,select#parent").multipleSelect({
            single:true,
            width:350
        });
        jQuery("body").append('<div id="scriptingConfirmBoxDiv" class="activeAlert"></div>');
         if(jQuery("#settingsdiv").hasClass("assetLeftPanel")===true || jQuery(".isCMDBSetting #settingsdiv").hasClass("assetLeftPanel")===true){
            jQuery("#scriptingConfirmBoxDiv").addClass("cmdbAlertContainer");
         }
        jQuery(document).on("click",".notie-button",function(){
            jQuery(this).parents(".notie-container").remove();
            jQuery("#notie-overlay")[0].remove();
        });
        jQuery(document).on("change","select#parameter1",function(){
            var isSelectLoaded=setInterval(function(){
                if(jQuery("select#fieldvalue1:not(.ms-offscreen)").length){
                    jQuery("select#fieldvalue1:not(.ms-offscreen)").multipleSelect({
                        single:true,
                        width:350
                    });
                    clearInterval(isSelectLoaded);
                }
            },100);
        });
        if(jQuery(".assetMainFrame").hasClass("assetImportTemp")==true){
            var isSelectBoxAppended1 =setInterval(function() {
                    if( jQuery("#FixedFieldsAssetDetails select:not(.ms-offscreen)").length>0){
                        jQuery("#FixedFieldsAssetDetails select:not(.ms-offscreen)").multipleSelect({
                            single:true,
                            width:350
                        });
                        clearInterval(isSelectBoxAppended1);
                    }
            },100);
        }
        jQuery(document).on("change",".assetImportTemp #type",function(){
            var isSelectBoxAppended =setInterval(function() {
                if( jQuery("#FixedFieldsAssetDetails select:not(.ms-offscreen)").length>0){
                    jQuery("#FixedFieldsAssetDetails select:not(.ms-offscreen)").multipleSelect({
                        single:true,
                        width:350
                    });
                    clearInterval(isSelectBoxAppended);
                }
            },100);
        });
        var preBgColor=jQuery("#bgColor").val();
        <%if(request.getParameter("spectrumPlugin")!=null && request.getParameter("spectrumPlugin").equals("yes")){%>
        jQuery(".leaveConfig #bgColor").spectrum({
           color: "#"+preBgColor,
            change: function(color) {
                jQuery("#bgColor").val(color.toHex());
            }
        });
        <%}%>
        jQuery("select#menu,select#assetpreshippedtype,select#preshippedfixedfield").multipleSelect({
            single:true,
            width:350
        });
        jQuery("form[action*='ManageAdditionalParma_'] select#ModuleType").on("change",function(){
            var checkExistSel=setInterval(function() {
                    if(jQuery(".assetMainFrame select#assetreconciliationrule").is(":visible")===true) {
                        jQuery(".assetMainFrame select#assetreconciliationrule").multipleSelect({
                            selectAll: false,
                            width: 350
                        });
                        clearInterval(checkExistSel);
                    }
                });
        });
    });
        function alert(message) 
        {
           jQuery("body").append('<div id="notie-overlay" class="notie-overlay notie-background-overlay" style="opacity: 0.7;    transition: 0.3s;"></div>');
           jQuery("#scriptingConfirmBoxDiv").append('<div class="notie-container" style="top: 0px; transition: 0.3s;"><div class="notie-textbox "><div class="notie-textbox-inner">'+message+'</div></div><div class="notie-button notie-background-warning">OK</div></div>');
        }
         function customConfirm(message,successCallFunc,cancelCallFunc){   
           jQuery("body").append('<div id="notie-overlay" class="notie-overlay notie-background-overlay" style="opacity: 0.7;    transition: 0.3s;"></div>');         
          jQuery("#scriptingConfirmBoxDiv").append('<div id="scriptingConfirmBoxDiv" class="activeAlert"><div class="notie-container" style="top: 0px; transition: 0.3s;"><div class="notie-textbox notie-background-info"><div class="notie-textbox-inner">'+message+'</div></div><div class="notie-button notie-element-half notie-background-success" onClick="'+successCallFunc+'()">OK</div><div class="notie-button notie-element-half yesBtn"  onClick="'+cancelCallFunc+'()">Cancel</div></div></div>');
        }
        function getValueFromCustomConfirm(message){
            return new Promise((resolve, reject) => {
              jQuery("body").append('<div id="notie-overlay" class="notie-overlay notie-background-overlay" style="opacity: 0.7;    transition: 0.3s;"></div>');         
          jQuery("#scriptingConfirmBoxDiv").append('<div id="scriptingConfirmBoxDiv" class="activeAlert"><div class="notie-container" style="top: 0px; transition: 0.3s;"><div class="notie-textbox notie-background-info"><div class="notie-textbox-inner">'+message+'</div></div><div class="notie-button notie-element-half notie-background-success" id="customConfirmOk">OK</div><div class="notie-button notie-element-half yesBtn" id="customConfirmCancel">Cancel</div></div></div>');
         
            jQuery("#customConfirmOk").on("click", () => {
                resolve(true);
            });

            jQuery("#customConfirmCancel").on("click", () => {
                resolve(false);
            });
        });
        }        
        function getValueFromAlert(message){
                return new Promise((resolve, reject) => {
                  jQuery("body").append('<div id="notie-overlay" class="notie-overlay notie-background-overlay" style="opacity: 0.7;    transition: 0.3s;"></div>');         
              jQuery("#scriptingConfirmBoxDiv").append('<div id="scriptingConfirmBoxDiv" class="activeAlert"><div class="notie-container" style="transition: 0.3s;"><div class="notie-textbox notie-background-info wid100"><div class="notie-textbox-inner">'+message+'</div></div><div class="notie-button notie-element-half notie-background-success" id="customConfirmOk">OK</div></div></div>');
             
                jQuery("#customConfirmOk").on("click", () => {
                    resolve(true);
                });
            });
        }
</script>
<%}%>
<%if(session.getAttribute("SERVICEDESK_NEWUI_PAGE")!= null && request.getParameter("isNewUIPopupAvailable")!=null && request.getParameter("isNewUIPopupAvailable").equals("yes")){%>
<link rel="stylesheet" type="text/css" href="css/settingsPopup_newUI.css">
<link rel="stylesheet" type="text/css" href="assets/css/multiple-select.min.css">
<%if(request.getParameter("jqueryReq")!=null && request.getParameter("jqueryReq").equals("yes")){%>
    <script type="text/javascript" src="assets/js/jquery.min.js"></script>
<%}%>
<%if(request.getParameter("jqueryWithProtoReq")!=null && request.getParameter("jqueryWithProtoReq").equals("yes")){%>
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/prototype.js"></script>
<%}%>
<script type="text/javascript" src="assets/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="assets/js/i18n/i18n.js"></script>
<script type="text/javascript" src="assets/js/i18n/messages_${LANGUAGE_UNICODE}.js"></script>
<script type="text/javascript" src="assets/js/multiple-select.min.js"></script>
<link rel="stylesheet" type="text/css" href="assets/css/notie.css">
<script type="text/javascript">
    jQuery(function(){
        jQuery(".fileIp").append('<label class="choosedFileName">Choose</label>');
        if(jQuery(".imgULdLabel").is(":visible")===true){
            jQuery(".fileIp").after('<label class="choosedFileName">Choose</label>');
        }
        jQuery(document).on("change","#importFile,#file",function(){
            var filename = jQuery(this).val();
            jQuery(this).siblings('.choosedFileName').text(filename.split('\\').pop());
        });
        jQuery("#quickcategory").multipleSelect({
            single:true,
            width:350
        });
        jQuery("#mainContentArea1.repoUpload select#category").multipleSelect({
            single:true,
            width:350,
            onClick:function(){
                 setTimeout(function(){jQuery("#mainContentArea1.repoUpload select#subcategory").multipleSelect("refresh");},500);
            }
        });
        jQuery("#mainContentArea1.repoUpload select#subcategory").multipleSelect({
            single:true,
            width:350
        });
      <%--   jQuery("#mainContentArea1.repoUpload select#roleid").multipleSelect({
            selectAll:false,
            width:350,
            filter:true
        });
        jQuery("#mainContentArea1.repoUpload select#userid").multipleSelect({
            selectAll:false,
            width:160,
            filter:true
        }); --%>
        jQuery("select#quicksubcategory").multipleSelect({
            single:true,
            width:350
        });
        jQuery("form[action='DeleteManageAdditionConfig'] select#paginationrowcount").multipleSelect({
            single:true,
            width:70
        });
        if(jQuery("form").attr("action")==="DeleteManageAdditionConfig"){
            var isGridExist=setInterval(function(){
                if(jQuery(".popupGridWid").is(":visible")){
                    var gridID=jQuery(".popupGridWid").attr("id");
                    if(gridID!==null && gridID!== undefined) {
                        var paginationGridControl = Ext.getCmp('' + gridID);
                        paginationGridControl.setWidth(630);
                    }
                    clearInterval(isGridExist);
                }
            });
        }
        jQuery("select#depreciationSelect").multipleSelect({
            single:true,
            width:350
        });
        jQuery("select#componentId").multipleSelect({
            single:true,
            width:350
        });
        jQuery("select#accessto[multiple]:not(.ms-offscreen)").multipleSelect({
            selectAll: false,
            filter:true,
            width: 350
        });
        jQuery(".mainFrameForm.exceptionForm select#FromHour,.mainFrameForm.exceptionForm select#FromMinute,.mainFrameForm.exceptionForm select#ToHour,.mainFrameForm.exceptionForm select#ToMinute").multipleSelect({
            single:true
        });
        jQuery('form[action="ManageAdditionalParma_Modify"] select#accesspermission:not(.ms-offscreen),select#barcodeTemplateId,select#menu').multipleSelect({
            single:true,
            width:350
        });
        jQuery(document).on("mouseup",".addbuttons",function(){
            var checkButtonExist=setInterval(function(){
                if(parent.document.querySelector('body').classList.contains("applyCloseIco")){
                    if(jQuery("body",parent.document).find("#NSPopTransparent").length==0){
                    parent.document.querySelector('body').classList.remove("showPopupTitle");
                    clearInterval(checkButtonExist);
                    }
                }
            },100);
        });
        jQuery('select#dependentField').multipleSelect({
            single:true,
            width:350
        });
        jQuery('#endtime,#starttime').on('focus', function() {
             jQuery('#CalendarControl').position({
                my: 'left top',
                at: 'left bottom',
                of: this
            });
        });
        jQuery("body").append('<div id="scriptingConfirmBoxDiv" class="activeAlert"></div>');
        jQuery(document).on("click",".notie-button",function(){
            jQuery("#scriptingConfirmBoxDiv").empty();
            jQuery("#notie-overlay").remove();
            jQuery("body",parent.document).find("#overCap").removeClass("visibilityHidden");
        });
    });
    function alert(message) 
    {
        jQuery("body").append('<div id="notie-overlay" class="notie-overlay notie-background-overlay" style="opacity: 0.7;    transition: 0.3s;"></div>');
       jQuery("#scriptingConfirmBoxDiv").append('<div class="notie-container"><div class="notie-textbox "><div class="notie-textbox-inner">'+message+'</div></div><div class="notie-button notie-background-warning">OK</div></div>');
       jQuery("body",parent.document).find("#overCap").addClass("visibilityHidden");
    }
     function getValueFromCustomConfirm(message){
        return new Promise((resolve, reject) => {
          jQuery("body").append('<div id="notie-overlay" class="notie-overlay notie-background-overlay" style="opacity: 0.7;    transition: 0.3s;"></div>');         
      jQuery("#scriptingConfirmBoxDiv").append('<div id="scriptingConfirmBoxDiv" class="activeAlert"><div class="notie-container" style="transition: 0.3s;"><div class="notie-textbox notie-background-info wid100"><div class="notie-textbox-inner">'+message+'</div></div><div class="notie-button notie-element-half notie-background-success" id="customConfirmOk">OK</div><div class="notie-button notie-element-half yesBtn" id="customConfirmCancel">Cancel</div></div></div>');
        jQuery("#customConfirmOk").on("click", () => {
            resolve(true);
        });

        jQuery("#customConfirmCancel").on("click", () => {
            resolve(false);
        });
    });
    }
    function getValueFromAlert(message){
            return new Promise((resolve, reject) => {
              jQuery("body").append('<div id="notie-overlay" class="notie-overlay notie-background-overlay" style="opacity: 0.7;    transition: 0.3s;"></div>');         
          jQuery("#scriptingConfirmBoxDiv").append('<div id="scriptingConfirmBoxDiv" class="activeAlert"><div class="notie-container" style="transition: 0.3s;"><div class="notie-textbox notie-background-info wid100"><div class="notie-textbox-inner">'+message+'</div></div><div class="notie-button notie-element-half notie-background-success" id="customConfirmOk">OK</div></div></div>');         
            jQuery("body",parent.document).find("#overCap").addClass("visibilityHidden");
            jQuery("#customConfirmOk").on("click", () => {
                resolve(true);
            });
        });
    }
</script>
<%}%>