
$(function(){var pageBodyID=$("body").attr("id");var cookieName=["utm_term","utm_source","utm_campaign","utm_content"];var dateCookie=new Date;dateCookie.setDate(dateCookie.getDate()+30);var paramsURL=window.location.search.replace('?','').split('&').reduce(function(p,e){var a=e.split('=');p[decodeURIComponent(a[0])]=decodeURIComponent(a[1]);return p;},{});for(var i=0;i<cookieName.length;i++){if(paramsURL[cookieName[i]]){document.cookie=cookieName[i]+"="+paramsURL[cookieName[i]]+"; path=/; expires="+dateCookie;}}
LanguageSelectorManager.init();$(document).on("keyup",function(event){if(!$('.blockUI').is(':visible'))
return;if(TeamLabPortal.IsEscPressed(event)){$.unblockUI();if($(".blockUI.blockDialog:visible").children().is("#SwitcherSignUp")){RegisterPortal.ClearDataAndErrors();}}});var isDesktop=$("body").is(".desktop");$("#RecaptchaContainer .CloseCross,"+" #PortalNameExistsContainer .CloseCross").on("click",function(){$.unblockUI();});if((pageBodyID==="signuppage")||(pageBodyID==="bestcloudoffice")){RegisterPortal.Init($("#signuppage .signuppageform .dataForm:first"));RegisterPortal.Init($("#bestcloudoffice .signuppageform .dataForm:first"));RegisterPortal.InitPreDataAndEvents();RegisterPortal.ClearDataAndErrors();function checkEmptyInput(){if($(this).hasClass('error')){var value=$(this).val();if(value!=''){$(this).removeClass('error');$(this).next('div.error:first').hide();}}}
RegisterPortal.oFN.keyup(function(){checkEmptyInput.call(this);});RegisterPortal.oLN.keyup(function(){checkEmptyInput.call(this);});RegisterPortal.oEM.keyup(function(){if(ASC.Mail.Utility.IsValidEmail($.trim(RegisterPortal.oEM.val()))){$(this).removeClass('error');$(this).next('div.error:first').hide();}});var portalNameMinLength=RegisterPortal.oPN.data("minlength");RegisterPortal.oPN.keyup(function(){if($.trim(RegisterPortal.oPN.val()).length>=portalNameMinLength&&$.trim(RegisterPortal.oPN.val()).match(/^[a-z0-9][a-z0-9-]*[a-z0-9]$/gi)){$(this).removeClass('error');$('.txtSignUpPortalName_errorArea').hide();}});RegisterPortal.oPW.keyup(function(){if($.trim(RegisterPortal.oPW.val()).length>5){$(this).removeClass('error');$('.txtSignUpPassword_errorArea').hide();}});}
if(typeof(window.BaseImgPath)=="undefined"){window.BaseImgPath="/";}
function selectBottomMenu(selector,parent){$(selector+" a").each(function(e){var t=window.location.pathname;if(this.href.trim().toLowerCase().indexOf(t)!=-1){var index=$(this).parents(selector).index();$($(this).parents(parent).find(selector).removeClass("menuitem_selected")[index]).addClass("menuitem_selected");$($(this).parents(parent).find(selector).addClass("menuitem_unselected")[index]).removeClass("menuitem_unselected");var containerOuterWidth=$(".oses_blocks").outerWidth();var itemOuterWidth=$(this).outerWidth();var itemOffsetLeft=$(this).offset().left;var containerScrollLeft=$(".oses_blocks").scrollLeft();var positionCetner=(containerOuterWidth/2-itemOuterWidth/2);var scrollLeftUpd=containerScrollLeft+itemOffsetLeft-positionCetner;$(".oses_blocks").animate({scrollLeft:scrollLeftUpd},400);}});}
if(pageBodyID==="officesuitedoceditorpage"||pageBodyID==="officesuitespeditorpage"||pageBodyID==="officesuitepreditorpage"||pageBodyID==="formcreatorpage"||pageBodyID==="pdfreaderpage"||pageBodyID==="ebookpage"){selectBottomMenu(".oses_block",".oses_blocks");}
if(pageBodyID==="collaborationcommunitypage"||pageBodyID==="collaborationmailpage"||pageBodyID==="collaborationcrmpage"||pageBodyID==="collaborationprojectspage"||pageBodyID==="collaborationcalendarpage"||pageBodyID==="collaborationdocmanagepage"){selectBottomMenu(".cms_block",".cms_blocks");}
if(pageBodyID==="collaborationroomspage"||pageBodyID==="publicroomspage"||pageBodyID==="customroomspage"||pageBodyID==="formfillingroomspage"||pageBodyID==="vdroomspage"||pageBodyID==="zoommeetingroomspage"){selectBottomMenu(".oses_block",".oses_blocks");}});