function setLoading(divId){$(divId).html('

');$(divId).show();}
function setLoadingsmalla(divId){$(divId).html('
');$(divId).show();}
function setLoadingbyclass(divId){$(divId).html('
');$(divId).show();}
function stopLoading(divId){$(divId).hide();}
function setLoadingSmallbyid(divId){$(divId).html('
');$(divId).show();}
function setLoadingSmallbyidwithoutdiv(divId){$(divId).html('
');$(divId).show();}
function localtionHash(divId){document.location.hash=divId;}
function setLoadingBackground(divId){$(divId).append('
');}
function setWait(divId){$(divId).html('
');$(divId).show();}
function handleExpandBoxClick(element,id){if($('#'+id).is(':visible')){$('#'+id).hide();$('#expandBox_menuLeft_'+id).hide();$('#expandBox_menuRight_'+id).hide();}else{$('#'+id).show();$('#expandBox_menuLeft_'+id).show();$('#expandBox_menuRight_'+id).show();}
$(element).toggleClass('ico1');$(element).parent('.grayBox').toggleClass('grayBox1');return false;}
function handleExpandBoxClickedtest(element){$('#'+element).slideToggle()
return false;}
function handleExpandBoxClicked(element){$(element).parents('.info-block').toggleClass('block-collapsed');$(element).parents('.info-block').toggleClass('block-expanded');return false;}
function getData(id,data){var tempAJAX=$.ajax;$.ajax=function(s){s.cache=true;tempAJAX(s);}
$(id).html(data);$(id).show();$.ajax=tempAJAX;}
function updateContent(selector,content){$(selector).html(content);$(selector).show();}
function replaceContent(selector,content){$(selector).replaceWith(content);$(selector).show();}
function updateWholeInfoBlock(selector,content){$(selector).parents('.info-block').replaceWith(content);}
function updatePageContent(content){$('#pagewrapper').html(content);$('#pagewrapper').show();}
function getContent(url,containerId){jQuery.ajax({'type':'GET','url':url,'cache':false,'data':'','success':function(html){jQuery('#'+containerId).html(html);}});}
function getContentByCss(url,containerId){jQuery.ajax({'type':'GET','url':url,'cache':false,'data':'','success':function(html){jQuery('.'+containerId).html(html);}});}
function getContentVal(url,containerId){jQuery.ajax({'type':'GET','url':url,'cache':false,'data':'','success':function(html){jQuery('#'+containerId).val(html);}});}
function destroyAllDialogs(){$('.ui-dialog').empty();$('.ui-dialog').remove();}
function destroyDialogs(aDialogContainerIds){for(var i=0;i\{\}\[\]\\\/]/gi;var isSplChar=re.test(valText);if(isSplChar)
{var no_spl_char=valText.replace(/[`~!@#$%^&*()_|+\-=?;:'".<>\{\}\[\]\\\/]/gi,'');$(obj).val(no_spl_char);}else{$(obj).val(valText);}}
function checkEmailformat(email)
{var error=0;if(email!=''){var mailformat=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(!email.match(mailformat))
{error=1;}}
return error;}
function searchUsr(fname,surname)
{if(surname==0){var txtSearch=fname;}else{var txtSearch=fname+' '+surname;}
$('#finduser-clicks').trigger('click');$('#search_users_new').val(txtSearch);jQuery("#search_users_new").trigger('keyup');}
function showGCModal(title,content)
{if(title!=""){jQuery("#GcModalTitle").html(title);}
if(content!=""){jQuery("#GcModalBody").html(content);jQuery('#GcModal').modal('show');}}
function notifyMe(titlte,imgl,description,row,redirectUrl)
{Notification.requestPermission().then(function(result){if(result==='denied'){console.log('Permission wasn\'t granted. Allow a retry.');return;}
if(result==='granted'){var imgl='/images/logo-mid-pic.png';var row=new Notification(titlte,{icon:imgl,body:description,});row.onclick=function(){window.open(redirectUrl);};setTimeout(row.close.bind(row),10000);}
if(result==='default'){console.log('The permission request was dismissed.');return;}});}
function tooltippop(divId){$("#"+divId).tooltip({show:{effect:"slideDown",delay:250},position:{my:"left top",at:"left bottom"},});}
function myNotificaiton()
{jQuery('#tstDiv').load('/central/user/deskTopNotify/desktopnoti/1');}
if(jQuery.type(GC_LOGGED_USER)==="undefined"){}else{if(GC_LOGGED_USER==703){setInterval(myNotificaiton,45000);}}
$(document).ready(function(){const itemsToReplace=["onload","join","body","eval","this","document","style","opacity"];$('input[type="text"]').not('#LoginForm_username, #LoginForm_password, #forgotemail').on('input',function(){let input=$(this).val();const charactersToReplace=["[","]","(",")","$","&","%","#"];charactersToReplace.forEach(function(char){let regex=new RegExp('\\'+char,'g');input=input.replace(regex,'');});itemsToReplace.forEach(function(item){let regex=new RegExp('\\b'+item+'\\b','gi');input=input.replace(regex,'');});$(this).val(input);});const ids=['search_servicenew','kbsearch','qs'];ids.forEach(function(id){$(`input#${id}`).on('input',function(){let value=$(this).val();let regex=/(https?:\/\/|www\.)[^\s]+/gi;let newValue=value.replace(regex,'');$(this).val(newValue);});});});