function updateUploadBoxes(){uploadBoxes=[];$(".x-control.x-upload-box").each(function(index,ub){var $ub=$(ub),uploadForm,typ;$ub.id=ub.id;uploadForm=$("*[data-form]",$($ub));$ub.supportedTypes=[];typ=$ub.data("file-types");$ub.supportedTypes=typ.length>0?typ.split(","):[];$ub.serviceUrl=$ub.data("serviceurl");$ub.initCallback=function(){};$ub.successCallback=function(){};$ub.failureCallback=function(){};$ub.cancelCallback=function(){};$ub.progressCallback=function(){};$ub.input=$("*[data-input]",$($ub));$ub.remove=$("*[data-remove-button]",$($ub));$ub.isFileSelected=function(){return $ub.input.val().length<1?!1:!0};$ub.isValid=function(){var input,type,found,i;if(!this.isFileSelected())return!0;if(input=$("*[data-input]",$($ub)),type=input.val().substr((~-input.val().lastIndexOf(".")>>>0)+2).toLowerCase(),this.supportedTypes.length>0){for(found=!1,i=0;i>>0)+2).toLowerCase(),this.supportedTypes.length>0){for(found=!1,i=0;i-1&&(mask+="abcdefghijklmnopqrstuvwxyz"),chars.indexOf("A")>-1&&(mask+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),chars.indexOf("#")>-1&&(mask+="0123456789"),chars.indexOf("!")>-1&&(mask+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\"),result="",i=length;i>0;--i)result+=mask[Math.round(Math.random()*(mask.length-1))];return result}function initDropDownMenus(){function mouseenter(){$(this).addClass("hovered")}function mouseleave(){$(this).removeClass("hovered")}var $submenus=$(".main-menu > ul > li .nav-2"),config;$submenus.length!=0&&(config={sensitivity:2,interval:100,over:mouseenter,timeout:200,out:mouseleave},$submenus.parent().hoverIntent(config),initThreeLevelDropDownMenu())}function initThreeLevelDropDownMenu(){var totalSiteWidth=960,totalThreshold=30,$topLi=$(".threeLevel");$topLi.length!=0&&$topLi.each(function(){var totalWidth=0;$(this).find(".level_3_ul").each(function(){totalWidth+=$(this).width()+1});totalWidth>totalSiteWidth-totalThreshold&&(totalWidth=totalSiteWidth);$(this).find(".submenu > li").width(totalWidth);var relPos=parseInt($(this).position().left)+1,availableSpace=totalSiteWidth-relPos,excess=availableSpace-totalWidth;excess<0&&(-excess>relPos&&(excess=-relPos),$(this).find(".submenu").css({left:excess}))})}function switchVersion(){var switchversion=localStorage.getItem("switchVersion");if(!switchversion){$(".switch-version-outer-container").addClass("enabled");$(".button-switch").on("click",function(){localStorage.setItem("switchVersion",!0);$(".switch-version-outer-container").removeClass("enabled")})}}function newsBoxGrid(){$(".news-article-list > ul").masonry({columnWidth:".grid-sizer",itemSelector:".item"});$(window).resize(function(){$(".news-article-list > ul").masonry({columnWidth:".grid-sizer",itemSelector:".item"})})}function InitHomePageMainBanner(){function preloadHoverImages(){var bgimages=[],preloader;$bannerItems.find(".image-container").each(function(){var bgurl=GetBgImageUrl($(this));bgimages.push(bgurl)});preloader=new ItemLoader(bgimages,function(){hoverEnabled=!0})}function initHoverEffects(){function mouseenter(){if(!hoverEnabled)return!1;$bannerItems.eq($(this).index()).is(":visible")||($blurredBg.is(":visible")&&$blurredBg.velocity("fadeOut",{duration:500}),$bannerItems.eq($(this).index()).velocity("fadeIn",{duration:500},{display:"block"}).siblings().velocity("fadeOut",{duration:500}))}function mouseleave(){$blurredBg.is(":visible")||($bannerItems.velocity("fadeOut",{duration:500}),$blurredBg.velocity("fadeIn",{duration:500}))}$menuItems.hover(function(){$(this).siblings().addClass("blurred")},function(){$(this).siblings().removeClass("blurred")});$menuItems.length>0&&$menuItems.hoverIntent({sensitivity:3,interval:50,over:mouseenter,out:function(){}});$menu.length>0&&$menu.hoverIntent({sensitivity:3,interval:50,over:function(){},out:mouseleave})}var clicked=!1,hoverEnabled=!1,$galleryContainer=$(".main-gallery-container"),$blurredBg=$galleryContainer.find(".blurred-bg"),$bannerItems=$galleryContainer.find(".banner-list li"),$menu=$galleryContainer.find(".banner-list-menu"),$menuItems=$galleryContainer.find(".banner-list-menu > li"),$hiddenContainer=$galleryContainer.find(".hidden-container"),$primaryContainer=$galleryContainer.find(".primary-image-container"),bluredImage,preloader1;$hiddenContainer.velocity({opacity:0},{display:"none"});$bannerItems.velocity({opacity:0},{display:"none"});bluredImage=GetBgImageUrl($blurredBg);preloader1=new ItemLoader([bluredImage],function(){});$primaryContainer.on("click",function(){if(!clicked){clicked=!0;preloadHoverImages();function showAndAnimate($element,delay){setTimeout(function(){$element.css("display","inline-block").addClass("animate zoomIn")},delay)}$(this).velocity("fadeOut",{duration:700});$hiddenContainer.velocity("fadeIn",{duration:700});showAndAnimate($menuItems.filter(".item0"),700);showAndAnimate($menuItems.filter(".item1"),850);showAndAnimate($menuItems.filter(".item2"),1e3);showAndAnimate($menuItems.filter(".item3"),1150);showAndAnimate($menuItems.filter(".item4"),1300);setTimeout(function(){$menuItems.removeClass("animate");initHoverEffects()},2e3)}})}function toggleMenu(){function mouseenter(){$(this).hasClass("hasChildren")?$(".overlay").show():$(".overlay").hide();$(this).children(".submenu-wrapper").show()}function mouseleave(){$(this).children(".submenu-wrapper").hide()}var mainMenu=$(".main-menu > ul"),menuItem=$(".main-menu > ul > li"),$menuItemSub=$(".main-menu > ul > li"),secondMenuItemSub=$(".main-menu > ul > li.has-mega-menu .submenu-wrapper > ul > li"),config;$menuItemSub.length!=0&&(config={sensitivity:3,interval:100,timeout:100,over:mouseenter,out:mouseleave},$menuItemSub.hoverIntent(config),secondMenuItemSub.first().addClass("hovered"),$(".main-menu > ul > li.has-mega-menu .submenu-wrapper").mouseleave(function(){secondMenuItemSub.first().addClass("hovered")}),mainMenu.mouseleave(function(){setTimeout(function(){$(".overlay").hide()},100)}),secondMenuItemSub.hover(function(){$(this).addClass("hovered")},function(){$(this).removeClass("hovered")}))}function menuEffect(){$(".main-menu .nav-1 > li").hover(function(){$(this).siblings().addClass("blurred")},function(){$(this).siblings().removeClass("blurred")})}function stickyHeader(){var header=$(".header-region"),headerHeight=header.height(),scrlTop=$(window).scrollTop(),spacer;header.before("
<\/div>");spacer=$(".spacer");scrlTop>=132?(spacer.height(headerHeight),header.addClass("sticky").addClass("fadeInDown")):(spacer.height(0),header.removeClass("sticky").removeClass("fadeInDown"));$(window).scroll(function(){scrlTop=$(window).scrollTop();scrlTop>=132?(spacer.height(headerHeight),header.addClass("sticky").addClass("fadeInDown")):(spacer.height(0),header.removeClass("sticky").removeClass("fadeInDown"))})}function stickyFooter(){var footerContainer=$(".footer-region"),barContainer=$(".footer-region .region-area-one");barContainer.offset().top+barContainer.height()>=footerContainer.offset().top&&barContainer.removeClass("is-fixed").addClass("is-static");$(document).scroll(function(){barContainer.offset().top+barContainer.height()>=footerContainer.offset().top&&barContainer.removeClass("is-fixed").addClass("is-static");$(document).scrollTop()+window.innerHeight ul > li").eq(0).children(".milestone-box").addClass("selected");$(".history-page .slider-container ul li").eq(0).addClass("shown");$(".history-page .slider-container ul li").eq(0).children(".slide-container").children(".info-container").velocity({left:0},{delay:200,duration:400});$(".history-page .toogle-history-menu").click(function(){$(this).parent().hasClass("open")?($(".milestones-container .date").velocity("fadeOut",{duration:100}),$(".milestones-container .intro").velocity("fadeOut",{duration:100}),setTimeout(function(){$(".milestones-container .info-container").removeClass("static")},200),$(this).siblings(".title-container").velocity("fadeOut",{duration:100}),$(".milestones-container .intro").velocity("fadeOut",{duration:100}),$(this).parent().removeClass("open"),$(".milestones-container .date").velocity("fadeIn",{delay:200,duration:300})):($(this).parent().addClass("open"),$(".milestones-container .info-container").velocity("fadeOut",{duration:100}),setTimeout(function(){$(".milestones-container .info-container").addClass("static")},100),$(this).siblings(".title-container").velocity("fadeIn",{delay:500,duration:300}),$(".milestones-container .intro").velocity("fadeIn",{delay:400,duration:300}),$(".milestones-container .info-container").velocity("fadeIn",{delay:500,duration:300}))});$(window).height()>750&&$(".history-page .slider-container ul").scrollsnap({snaps:".snap",proximity:375,latency:1e3,easing:"easeInOutExpo",duration:500});$(".history-page .milestone-box").click(function(){var index=$(this).parent().index(),selectedSlide=$(".history-page .slider-container ul li").eq(index);selectedSlide.hasClass("shown")?cont.animate({scrollTop:contHeight*index},1):(selectedSlide.css("opacity",0),cont.animate({scrollTop:contHeight*index},1),selectedSlide.velocity({opacity:1},{duration:200}))});cont.scroll(function(){scrlTop=$(cont).scrollTop();var nearestSlide=Math.floor((scrlTop+contHeight/2)/contHeight),selectedSlide=$(".history-page .slider-container ul li").eq(nearestSlide),selectedMile=$(".milestones-container ul li").eq(nearestSlide).children(".milestone-box");selectedMile.hasClass("selected")||($(".milestone-box.selected").removeClass("selected"),selectedMile.addClass("selected"),$(".history-page .slider-container ul li.shown").removeClass("shown"),selectedSlide.addClass("shown"))})}function InitOwlHistoryAnimations(){var thumbsCont=$(".milestones-container ul"),thumbHeight=$("#menuBar > li").height();$(".site-container, .content-container").css("height","100%");$(".footer-region").hide();$(".header-region").addClass("sticky");$("#fullpage").fullpage({menu:"#menuBar",scrollingSpeed:700,normalScrollElements:"#menuBar, .header-region, .footer-region",animateAnchor:!1,paddingTop:"56px",onLeave:function(index,nextIndex){thumbsCont.animate({scrollTop:thumbHeight*nextIndex-62},400)}});$("#menuBar > li").on("click",function(){index=$(this).attr("data-menuanchor");$.fn.fullpage.silentMoveTo(index)});$(".history-page .toogle-history-menu").click(function(){$(this).parent().hasClass("open")?($(".milestones-container .date").velocity("fadeOut",{duration:100}),$(".milestones-container .intro").velocity("fadeOut",{duration:100}),setTimeout(function(){$(".milestones-container .info-container").removeClass("static")},200),$(this).siblings(".title-container").velocity("fadeOut",{duration:100}),$(".milestones-container .intro").velocity("fadeOut",{duration:100}),$(this).parent().removeClass("open"),$(".milestones-container .date").velocity("fadeIn",{delay:200,duration:300})):($(this).parent().addClass("open"),$(".milestones-container .info-container").velocity("fadeOut",{duration:100}),setTimeout(function(){$(".milestones-container .info-container").addClass("static")},100),$(this).siblings(".title-container").velocity("fadeIn",{delay:500,duration:300}),$(".milestones-container .intro").velocity("fadeIn",{delay:400,duration:300}),$(".milestones-container .info-container").velocity("fadeIn",{delay:500,duration:300}))})}function initPhotoGalleryDocument(){$(".document-gallery .photogallery-normal > ul > li").length>1&&$(".document-gallery .photogallery-normal > ul").owlCarousel({paginationSpeed:1e3,rewindNav:!0,autoPlay:7e3,singleItem:!0,pagination:!0,navigation:!0,navigationText:!1,mouseDrag:!1,stopOnHover:!0,transitionStyle:"fade",addClassActive:!0})}function initChosenMenuFunction(){$(".main-menu .chosen-search-container select").chosen({enable_split_word_search:!0,search_contains:!0}).trigger("chosen:open");var brandField=$(".main-menu .chosen-container .chosen-search input");brandField.each(function(){$(this).watermark("SEARCH FOR A BRAND")});$(".main-menu .chosen-search-container select").chosen().change(function(){var label=$(this).children("option[value= '"+$(this).val()+"']").text();brandField.val(label);window.location.href=$(this).val()})}function initVideoPopUp(){$(".pop-up-video").fancybox({type:"iframe",padding:0,height:450,openEffect:"none",closeEffect:"none"})}function InitParallax(){var $scene=$(".global-presence-page .region-area-two").parallax()}function initAnimatedNumbers(){var countUpOptions={useEasing:!1,useGrouping:!1};setTimeout(function(){$(".global-presence-page .inner-area-two .info-box").addClass("animated fadeInDown");$(".global-presence-page .inner-area-two .info-box .number").each(function(idx){var number=parseInt($(this).text()),id,numAnim;$(this).text("");id="countNum_"+idx;$(this).prop("id",id);numAnim=new countUp(id,0,number,0,3.5,countUpOptions);numAnim.start()})},200)}function initIcheckContact(){$(".x-contact-form .form-row.radio input").iCheck({cursor:!0,labelHoverClass:"hovered"})}function initIcheckOnlineRegistration(){var checkToggleInput=$(".online-registration-form .control-area-four .form-row.checkbox input, .online-registration-form .control-area-six .form-row.checkbox input");$(".online-registration-form .form-row.checkbox input").iCheck({cursor:!0,labelHoverClass:"hovered"});checkToggleInput.on("ifChecked",function(){$(this).closest(".control-area").next().velocity("slideDown",{duration:400})});checkToggleInput.on("ifUnchecked",function(){$(this).closest(".control-area").next().velocity("slideUp",{duration:400})})}function InitTabs(){$(".x-control.x-tab-panel").each(function(i,wrapper){$("*[data-tab-click]",$(wrapper)).click(function(){var thisTab=$(this),innerWrapper=thisTab.closest(".x-tab-panel"),thisTabIndex=thisTab.data("tab-index");thisTab.addClass("active").siblings().removeClass("active");$("li[data-tab-content-index="+thisTabIndex+"]",innerWrapper).addClass("active").siblings().removeClass("active");EventManager.trigger("lazyload")})})}function customNavigation(){EventManager.trigger("lazyload");var owlObj=$(this),slide=owlObj[0].$owlItems,lastSlide=owlObj[0].maximumItem,prev=owlObj[0].buttonPrev,next=owlObj[0].buttonNext,prevText,nextText,indexNum=owlObj[0].currentItem;indexNum==0?(prevText=slide.eq(lastSlide).children("li").attr("data-name"),nextText=slide.eq(indexNum+1).children("li").attr("data-name")):indexNum==lastSlide?(prevText=slide.eq(indexNum-1).children("li").attr("data-name"),nextText=slide.eq(0).children("li").attr("data-name")):(prevText=slide.eq(indexNum-1).children("li").attr("data-name"),nextText=slide.eq(indexNum+1).children("li").attr("data-name"));prev.text(prevText);next.text(nextText)}function firstInit(){EventManager.trigger("lazyload");var owlObj=$(this),slide=owlObj[0].$owlItems,lastSlide=owlObj[0].maximumItem,prev=owlObj[0].buttonPrev,next=owlObj[0].buttonNext,prevText,nextText,indexNum=owlObj[0].currentItem,paginationLinks=owlObj[0].paginationWrapper.find(".owl-page");indexNum==0?(prevText=slide.eq(lastSlide).children("li").attr("data-name"),nextText=slide.eq(indexNum+1).children("li").attr("data-name")):indexNum==lastSlide?(prevText=slide.eq(indexNum-1).children("li").attr("data-name"),nextText=slide.eq(0).children("li").attr("data-name")):(prevText=slide.eq(indexNum-1).children("li").attr("data-name"),nextText=slide.eq(indexNum+1).children("li").attr("data-name"));prev.text(prevText);next.text(nextText);$.each(this.owl.userItems,function(i){var titleData=$(this).attr("data-name");$(paginationLinks[i]).children("span").text(titleData)})}function InitStoresOwlCarousel(){$(".store-place-container > ul").owlCarousel({paginationSpeed:1e3,rewindNav:!0,autoPlay:5e3,singleItem:!0,pagination:!0,navigation:!0,navigationText:!1,mouseDrag:!1,stopOnHover:!0,transitionStyle:"fade",addClassActive:!0,afterInit:firstInit,afterUpdate:firstInit,afterMove:customNavigation})}function scrollToSection(container,section,offset,speed){container.click(function(){$("html,body").animate({scrollTop:$(section).offset().top-offset},speed,"easeInOutExpo")})}function InitStockDiagram(){$(".diagram-container").highcharts("StockChart",{rangeSelector:{selected:1,inputDateFormat:"%d/%m/%Y",inputEditDateFormat:"%Y-%m-%d",buttonTheme:{states:{hover:{style:{color:"#000"}},select:{fill:"#b2a17e",style:{color:"white"}}}}},yAxis:{gridLineWidth:0,lineColor:"black"},xAxis:{tickLength:0,tickWidth:0,lineColor:"#e1e1e1"},chart:{backgroundColor:"transparent",spacingLeft:1,spacingRight:1},title:{text:"Folli Follie Group Stock Price",align:"left",x:0,style:{color:"#b2a17e","font-size":"17px","line-height":"20px","font-weight":"400"}},navigator:{maskFill:"rgba(178,161,126,0.3)",outlineColor:"#e1e1e1",series:{color:"#b2a17e",fillOpacity:.1,lineWidth:1,lineColor:"#b2a17e"}},credits:{enabled:!1},scrollbar:{barBackgroundColor:"#b2a17e",buttonArrowColor:"#b2a17e",trackBackgroundColor:"#f1f1f1",height:10},series:[{name:"Folli Follie Group",color:"#b2a17e",lineWidth:3,data:stockData,tooltip:{valueDecimals:2}}]},function(){setTimeout(function(){$("input.highcharts-range-selector",$(".diagram-container")).datepicker({changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",maxDate:(new Date).getDate(),onSelect:function(){this.onchange();this.onblur()}})},0)})}function ToggleContactDepartments(){$(".contact-partner-container.department .title-container").click(function(){$(this).parent().hasClass("opened")?($(this).parent().removeClass("opened"),$(this).siblings(".info-container").velocity("slideUp",{duration:400})):($(this).parent().addClass("opened"),$(this).parent().parent().siblings().children().removeClass("opened"),$(this).parent().parent().siblings().children().find(".info-container").velocity("slideUp",{duration:400}),$(this).siblings(".info-container").velocity("slideDown",{duration:400}))})}function InitIcheckCvPage(){$(".cv-form-page .form-row.radio .radio-wrapper input[type='radio'], .cv-form-page .form-row.check .check-wrapper input[type='checkbox']").iCheck({cursor:!0,labelHoverClass:"hovered"});$(".fancy-terms").fancybox({type:"iframe"})}function InitDatePicker(){$(".cal-from").datepicker({changeMonth:!0,changeYear:!0,dateFormat:"dd/mm/yy",beforeShowDay:$.datepicker.noWeekends,beforeShow:function(){$(".cal-to").val()==""&&$(".cal-from").datepicker("option","maxDate",null)},onSelect:function(){var dateMin=$(".cal-from").datepicker("getDate"),rMin=new Date(dateMin.getFullYear(),dateMin.getMonth(),dateMin.getDate()+1);$(".cal-to").datepicker("option","minDate",rMin)}});$(".cal-to").datepicker({changeMonth:!0,changeYear:!0,dateFormat:"dd/mm/yy",beforeShowDay:$.datepicker.noWeekends,beforeShow:function(){$(".cal-from").val()==""&&$(".cal-to").datepicker("option","minDate",null)},onSelect:function(){var dateMin=$(".cal-to").datepicker("getDate"),rMax=new Date(dateMin.getFullYear(),dateMin.getMonth(),dateMin.getDate()-1);$(".cal-from").datepicker("option","maxDate",rMax)}});$(".cal-to, .cal-from").keyup(function(e){(e.keyCode==8||e.keyCode==46)&&($.datepicker._clearDate(this),$.datepicker.datepicker("option","minDate",null),$.datepicker.datepicker("option","maxDate",null))})}function initMyAccountFunctions(){typeof InitMyAccountFunctions=="function"&&InitMyAccountFunctions()}function initCheckoutFunction(){typeof InitCheckoutFunctions=="function"&&InitCheckoutFunctions()}function initProductDetailsFunction(){typeof initProductDetails=="function"&&initProductDetails()}function initWaterInputs(){$(".waterInput").length<1||$(".waterInput").each(function(){var val=$(this).attr("data-name");$(this).watermark(val)})}function initClickableBackground(){$(".site-background .x-htmlarea ul li a").length<1||$(".site-container").click(function(e){$(e.target)[0]==$(".site-container")[0]&&(window.location=$(".site-background .x-htmlarea ul li a").attr("href"))})}function initDetailsThumbs(){$(".details-thumbs-carouzel").each(function(){var numOfItems=$(this).find("li").length;numOfItems>3&&($(this).siblings(".details-thumbs-next").addClass("shown"),$(this).siblings(".details-thumbs-prev").addClass("shown"),$(this).jCarouselLite({btnNext:$(this).siblings(".details-thumbs-next"),btnPrev:$(this).siblings(".details-thumbs-prev"),visible:3,start:0,scroll:3,circular:!1,easing:"easeInOutCubic",speed:700,vertical:!0}))})}function UpdateQueryString(key,value,url){var re,separator,hash;return url||(url=window.location.href),re=new RegExp("([?|&])"+key+"=.*?(&|#|$)","gi"),url.match(re)?value?url.replace(re,"$1"+key+"="+value+"$2"):url.replace(re,"$2"):value?(separator=url.indexOf("?")!==-1?"&":"?",hash=url.split("#"),url=hash[0]+separator+key+"="+value,hash[1]&&(url+="#"+hash[1]),url):url}function getQueryStringValueByName(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regexS="[\\?&]"+name+"=([^&#]*)",regex=new RegExp(regexS),results=regex.exec(window.location.search);return results==null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function removeValueFromCommaSeparatedString(list,value,separator){var values,i;for(separator=separator||",",values=list.split(separator),i=0;i57)&&event.preventDefault():(event.keyCode<96||event.keyCode>105)&&event.preventDefault())}function preventSpecialCharacter(e){var shiftPressed=e.shiftKey,keyCode=e.keyCode;shiftPressed?(keyCode==188||keyCode==190||keyCode==51||keyCode==55||keyCode==53||keyCode==219||keyCode==221)&&e.preventDefault():(keyCode==191||keyCode==219||keyCode==221||keyCode==111)&&e.preventDefault()}function phoneGROnly(event){numbersOnly(event);$(event.currentTarget).val().length>9&&(event.keyCode==46||event.keyCode==8||event.keyCode==36||event.keyCode==35||event.keyCode==37||event.keyCode==39||event.keyCode==9||event.preventDefault())}function GetURLParameter(urlParam){for(var sPageURL=window.location.search.substring(1),sURLVariables=sPageURL.split("&"),sParameterName,i=0;i>>0,len===0)||(n=0,arguments.length>0&&(n=Number(arguments[1]),n!==n?n=0:n!==0&&n!==1/0&&n!==-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=len))return-1;for(k=n>=0?n:Math.max(len-Math.abs(n),0);k'+option+"<\/a><\/li>").data({key:key,selected:$(item).is(":selected")}))}function newUlPos(){var containerPosY=$containerDiv.offset().top,docHeight=$(window).height(),scrollTop=$(window).scrollTop();newUlHeight>parseInt(opts.ddMaxHeight)&&(newUlHeight=parseInt(opts.ddMaxHeight));containerPosY=containerPosY-scrollTop;containerPosY+newUlHeight>=docHeight?($newUl.css({height:newUlHeight}),$containerDivWrapper.css({top:"-"+newUlHeight+"px",height:newUlHeight}),$input.onTop=!0):($newUl.css({height:newUlHeight}),$containerDivWrapper.css({top:containerHeight+"px",height:newUlHeight}),$input.onTop=!1)}function positionFix(){$containerDiv.css("position","relative")}function positionHideFix(){$containerDiv.css({position:"static"})}function closeDropDown(fireChange,resetText){fireChange==!0&&(prevIndex=currentIndex,$input.change());resetText==!0&&(currentIndex=prevIndex,navigateList(currentIndex));$containerDivWrapper.hide();positionHideFix()}function navigateList(currentIndex,fireChange){if(currentIndex==-1)$containerDivText.text(opts.defaultText),$newLi.removeClass("hiLite");else{$newLi.removeClass("hiLite").eq(currentIndex).addClass("hiLite");var text=$newLi.eq(currentIndex).text(),val=$newLi.eq(currentIndex).parent().data("key");try{$input.val(val)}catch(ex){$input[0].selectedIndex=currentIndex}if($containerDivText.text(text),fireChange==!0&&(prevIndex=currentIndex,$input.change()),$containerDivWrapper.is(":visible"))try{$newLi.eq(currentIndex).focus()}catch(ex){}}}function keyPress(element){$(element).unbind("keydown.sSelect").bind("keydown.sSelect",function(e){var keycode=e.which,currentKeyIndex;prevented=!0;switch(keycode){case 40:case 39:return incrementList(),!1;case 38:case 37:return decrementList(),!1;case 33:case 36:return gotoFirst(),!1;case 34:case 35:return gotoLast(),!1;case 13:case 27:return closeDropDown(!0),!1;case 9:return closeDropDown(!0),nextFormElement(),!1}return keyPressed=String.fromCharCode(keycode).toLowerCase(),currentKeyIndex=keys.indexOf(keyPressed),typeof currentKeyIndex!="undefined"?(++currentIndex,currentIndex=keys.indexOf(keyPressed,currentIndex),(currentIndex==-1||currentIndex==null||prevKey!=keyPressed)&&(currentIndex=keys.indexOf(keyPressed)),navigateList(currentIndex),prevKey=keyPressed,!1):void 0})}function incrementList(){currentIndex0&&(--currentIndex,navigateList(currentIndex))}function gotoFirst(){currentIndex=0;navigateList(currentIndex)}function gotoLast(){currentIndex=newLiLength-1;navigateList(currentIndex)}function nextFormElement(){var fields=$("body").find("button,input,textarea,select"),index=fields.index($input);return index>-1&&index+1<\/div>'),$containerDiv=$('
<\/div>'),$containerDivWrapper=$('