var Ossn=Ossn||{};Ossn.Startups=new Array();Ossn.hooks=new Array();Ossn.events=new Array();Ossn.RegisterStartupFunction=function($func){Ossn.Startups.push($func);};Ossn.Clk=function($elem){$($elem).trigger('click');};Ossn.str_replace=function(search,replace,subject,countObj){var i=0
var j=0
var temp=''
var repl=''
var sl=0
var fl=0
var f=[].concat(search)
var r=[].concat(replace)
var s=subject
var ra=Object.prototype.toString.call(r)==='[object Array]'
var sa=Object.prototype.toString.call(s)==='[object Array]'
s=[].concat(s)
var $global=(typeof window!=='undefined'?window:global)
$global.$locutus=$global.$locutus||{}
var $locutus=$global.$locutus
$locutus.php=$locutus.php||{}
if(typeof(search)==='object'&&typeof(replace)==='string'){temp=replace
replace=[]
for(i=0;i<search.length;i+=1){replace[i]=temp}
temp=''
r=[].concat(replace)
ra=Object.prototype.toString.call(r)==='[object Array]'}
if(typeof countObj!=='undefined'){countObj.value=0}
for(i=0,sl=s.length;i<sl;i++){if(s[i]===''){continue}
for(j=0,fl=f.length;j<fl;j++){temp=s[i]+''
repl=ra?(r[j]!==undefined?r[j]:''):r[0]
s[i]=(temp).split(f[j]).join(repl)
if(typeof countObj!=='undefined'){countObj.value+=((temp.split(f[j])).length-1)}}}
return sa?s:s[0];};Ossn.redirect=function($url){window.location=Ossn.site_url+$url;};Ossn.UrlParams=function(name,url){var results=new RegExp('[\\?&]'+name+'=([^&#]*)').exec(url);if(!results){return 0;}
return results[1]||0;};Ossn.ParseStr=function(string){var params={},result,key,value,re=/([^&=]+)=?([^&]*)/g,re2=/\[\]$/;while(result=re.exec(string)){key=decodeURIComponent(result[1].replace(/\+/g,' '));value=decodeURIComponent(result[2].replace(/\+/g,' '));if(re2.test(key)){key=key.replace(re2,'');if(!params[key]){params[key]=[];}
params[key].push(value);}else{params[key]=value;}}
return params;};Ossn.ParseUrl=function(url,component,expand){expand=expand||false;component=component||false;var re_str='^(?:(?![^:@]+:[^:@/]*@)([^:/?#.]+):)?(?://)?'
+'((?:(([^:@]*)(?::([^:@]*))?)?@)?'
+'([^:/?#]*)(?::(\\d*))?)'
+'(((/(?:[^?#](?![^?#/]*\\.[^?#/.]+(?:[?#]|$)))*/?)?([^?#/]*))'
+'(?:\\?([^#]*))?'
+'(?:#(.*))?)',keys={1:"scheme",4:"user",5:"pass",6:"host",7:"port",9:"path",12:"query",13:"fragment"},results={};if(url.indexOf('mailto:')===0){results['scheme']='mailto';results['path']=url.replace('mailto:','');return results;}
if(url.indexOf('javascript:')===0){results['scheme']='javascript';results['path']=url.replace('javascript:','');return results;}
var re=new RegExp(re_str);var matches=re.exec(url);for(var i in keys){if(matches[i]){results[keys[i]]=matches[i];}}
if(expand&&typeof(results['query'])!='undefined'){results['query']=ParseStr(results['query']);}
if(component){if(typeof(results[component])!='undefined'){return results[component];}else{return false;}}
return results;};Ossn.isset=function($variable){if(typeof $variable!=='undefined'){return true;}
return false;};Ossn.call_user_func_array=function(cb,parameters){var $global=(typeof window!=='undefined'?window:global)
var func
var scope=null
var validJSFunctionNamePattern=/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;if(typeof cb==='string'){if(typeof $global[cb]==='function'){func=$global[cb]}else if(cb.match(validJSFunctionNamePattern)){func=(new Function(null,'return '+cb)())}}else if(Object.prototype.toString.call(cb)==='[object Array]'){if(typeof cb[0]==='string'){if(cb[0].match(validJSFunctionNamePattern)){func=eval(cb[0]+"['"+cb[1]+"']")}}else{func=cb[0][cb[1]]}
if(typeof cb[0]==='string'){if(typeof $global[cb[0]]==='function'){scope=$global[cb[0]]}else if(cb[0].match(validJSFunctionNamePattern)){scope=eval(cb[0])}}else if(typeof cb[0]==='object'){scope=cb[0]}}else if(typeof cb==='function'){func=cb}
if(typeof func!=='function'){throw new Error(func+' is not a valid function')}
return func.apply(scope,parameters)};Ossn.is_callable=function(mixedVar,syntaxOnly,callableName){var $global=(typeof window!=='undefined'?window:global)
var validJSFunctionNamePattern=/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;var name=''
var obj={}
var method=''
var validFunctionName=false
var getFuncName=function(fn){var name=(/\W*function\s+([\w$]+)\s*\(/).exec(fn)
if(!name){return'(Anonymous)'}
return name[1]}
if(/(^class|\(this\,)/.test(mixedVar.toString())){return false}
if(typeof mixedVar==='string'){obj=$global
method=mixedVar
name=mixedVar
validFunctionName=!!name.match(validJSFunctionNamePattern)}else if(typeof mixedVar==='function'){return true}else if(Object.prototype.toString.call(mixedVar)==='[object Array]'&&mixedVar.length===2&&typeof mixedVar[0]==='object'&&typeof mixedVar[1]==='string'){obj=mixedVar[0]
method=mixedVar[1]
name=(obj.constructor&&getFuncName(obj.constructor))+'::'+method}
if(syntaxOnly||typeof obj[method]==='function'){if(callableName){$global[callableName]=name}
return true}
if(validFunctionName&&typeof eval(method)==='function'){if(callableName){$global[callableName]=name}
return true}
return false}
Ossn.is_hook=function($hook,$type){if(Ossn.hooks[$hook]&&Ossn.hooks[$hook][$type]){return true;}
return false;}
Ossn.unset_hook=function($hook,$type,$callback){if($hook==''||$type==''||$callback==''){return false;}
if(Ossn.is_hook($hook,$type)){for(i=0;i<=Ossn.hooks[$hook][$type].length;i++){if(Ossn.isset(Ossn.hooks[$hook][$type][i])){if(Ossn.isset(Ossn.hooks[$hook][$type][i].hook)){if(Ossn.hooks[$hook][$type][i].hook==$callback){Ossn.hooks[$hook][$type].splice(i,1);break;}}}}}};Ossn.add_hook=function($hook,$type,$callback,$priority=200){if($hook==''||$type==''){return false;}
if(!Ossn.isset(Ossn.hooks)){Ossn.hooks=new Array();}
if(!Ossn.isset(Ossn.hooks[$hook])){Ossn.hooks[$hook]=new Array();}
if(!Ossn.isset(Ossn.hooks[$hook][$type])){Ossn.hooks[$hook][$type]=new Array();}
if(!Ossn.is_callable($callback,true)){return false;}
$priority=Math.max(parseInt($priority),0);Ossn.hooks[$hook][$type].push({'hook':$callback,'priority':$priority,});return true;};Ossn.call_hook=function($hook,$type,$params=null,$returnvalue=null){$hooks=new Array();hookspush=Array.prototype.push
if(Ossn.isset(Ossn.hooks[$hook])&&Ossn.isset(Ossn.hooks[$hook][$type])){hookspush.apply($hooks,Ossn.hooks[$hook][$type]);}
$hooks.sort(function(a,b){if(a.priority<b.priority){return-1;}
if(a.priority>b.priority){return 1;}
return(a.index<b.index)?-1:1;});$.each($hooks,function(index,$item){$value=Ossn.call_user_func_array($item.hook,[$hook,$type,$returnvalue,$params]);if(Ossn.isset($value)){$returnvalue=$value;}});return $returnvalue;};Ossn.is_callback=function($event,$type){if(Ossn.isset(Ossn.events[$event][$type])){return true;}
return false;}
Ossn.register_callback=function($event,$type,$callback,$priority=200){if($event==''||$type==''){return false;}
if(!Ossn.isset(Ossn.events)){Ossn.events=new Array();}
if(!Ossn.isset(Ossn.events[$event])){Ossn.events[$event]=new Array();}
if(!Ossn.isset(Ossn.events[$event][$type])){Ossn.events[$event][$type]=new Array();}
if(!Ossn.is_callable($callback,true)){return false;}
$priority=Math.max(parseInt($priority),0);Ossn.events[$event][$type].push({'callback':$callback,'priority':$priority,});return true;};Ossn.unset_callback=function($event,$type,$callback){if($event==''||$type==''||$callback==''){return false;}
if(Ossn.is_callback($event,$type)){for(i=0;i<=Ossn.events[$event][$type].length;i++){if(Ossn.isset(Ossn.events[$event][$type][i])){if(Ossn.isset(Ossn.events[$event][$type][i].callback)){if(Ossn.events[$event][$type][i].callback==$callback){Ossn.events[$event][$type].splice(i,1);break;}}}}}};Ossn.trigger_callback=function($event,$type,$params=null){$events=new Array();eventspush=Array.prototype.push
if(Ossn.isset(Ossn.events[$event])&&Ossn.isset(Ossn.events[$event][$type])){eventspush.apply($events,Ossn.events[$event][$type]);}else{return false;}
$events.sort(function(a,b){if(a.priority<b.priority){return-1;}
if(a.priority>b.priority){return 1;}
return(a.index<b.index)?-1:1;});$tempvalue=null;$.each($events,function(index,$item){if(Ossn.is_callable($item.callback)&&(Ossn.call_user_func_array($item.callback,[$event,$type,$params])==false)){return false;}});return true;};Ossn.setrawcookie=function(name,value,expires,path,domain,secure){if(typeof expires==='string'&&(/^\d+$/).test(expires)){expires=parseInt(expires,10)}
if(expires instanceof Date){expires=expires.toUTCString()}else if(typeof expires==='number'){expires=(new Date(expires*1e3)).toUTCString()}
var r=[name+'='+value],s={},i=''
s={expires:expires,path:path,domain:domain}
for(i in s){if(s.hasOwnProperty(i)){s[i]&&r.push(i+'='+s[i])}}
return secure&&r.push('secure'),window.document.cookie=r.join(';'),true};Ossn.setCookie=function(name,value,expires,path,domain,secure){return Ossn.setrawcookie(name,encodeURIComponent(value),expires,path,domain,secure)};Ossn.getCookie=function(name){var i=0,c='',nameEQ=name+'=',ca=document.cookie.split(';'),cal=ca.length;for(i=0;i<cal;i++){c=ca[i].replace(/^ */,'');if(c.indexOf(nameEQ)===0){return decodeURIComponent(c.slice(nameEQ.length).replace(/\+/g,'%20'));}}
return null;};Ossn.ajaxRequest=function($datap){$(function(){var $form_name=$datap['form'];$('body').on("submit",$form_name,function(event){var $data=Ossn.call_hook('ajax','request:settings',null,$datap);var url=$data['url'];var callback=$data['callback'];var error=$data['error'];var befsend=$data['beforeSend'];var action=$data['action'];var containMedia=$data['containMedia'];var $xhr=$data['xhr'];if(url==true){url=$($form_name).attr('action');}
event.preventDefault();event.stopImmediatePropagation();if(!callback){return false;}
if(!befsend){befsend=function(){}}
if(!action){action=false;}
if(action==true){url=Ossn.AddTokenToUrl(url);}
if(!error){error=function(xhr,status,error){if(error=='Internal Server Error'||error!==''){Ossn.MessageBox('syserror/unknown');}};}
if(!$xhr){$xhr=function(){var xhr=new window.XMLHttpRequest();return xhr;};}
var $form=$(this);if(containMedia==true){$requestData=new FormData($form[0]);$removeNullFile=function(formData){if(formData.keys){for(var key of formData.keys()){var fileName=null||formData.get(key)['name'];var fileSize=null||formData.get(key)['size'];if(fileName!=null&&fileSize!=null&&fileName==''&&fileSize==0){formData.delete(key);}}}};$removeNullFile($requestData);$vars={xhr:$xhr,async:true,cache:false,contentType:false,type:'post',beforeSend:befsend,url:url,error:error,data:$requestData,processData:false,success:callback,};}else{$vars={xhr:$xhr,async:true,type:'post',beforeSend:befsend,url:url,error:error,data:$form.serialize(),success:callback,};}
return $.ajax($vars);});});};Ossn.PostRequest=function($datap){var $data=Ossn.call_hook('ajax:post','request:settings',null,$datap);var url=$data['url'];var callback=$data['callback'];var error=$data['error'];var befsend=$data['beforeSend'];var $fdata=$data['params'];var async=$data['async'];var action=$data['action'];var $xhr=$data['xhr'];if(!callback){return false;}
if(!befsend){befsend=function(){}}
if(typeof async==='undefined'){async=true;}
if(!action){action=true;}
if(action==true){url=Ossn.AddTokenToUrl(url);}
if(!error){error=function(){};}
if(!$xhr){$xhr=function(){var xhr=new window.XMLHttpRequest();return xhr;};}
return $.ajax({xhr:$xhr,async:async,type:'post',beforeSend:befsend,url:url,error:error,data:$fdata,success:callback,});};Ossn.AddTokenToUrl=function(data){if(typeof data==='string'){var parts=Ossn.ParseUrl(data),args={},base='';if(parts['host']===undefined){if(data.indexOf('?')===0){base='?';args=Ossn.ParseStr(parts['query']);}}else{if(parts['query']!==undefined){args=Ossn.ParseStr(parts['query']);}
var split=data.split('?');base=split[0]+'?';}
args["ossn_ts"]=Ossn.Config.token.ossn_ts;args["ossn_token"]=Ossn.Config.token.ossn_token;return base+jQuery.param(args);}};var sprintf=(function(){function get_type(variable){return Object.prototype.toString.call(variable).slice(8,-1).toLowerCase();}
function str_repeat(input,multiplier){for(var output=[];multiplier>0;output[--multiplier]=input){}
return output.join('');}
var str_format=function(){if(!str_format.cache.hasOwnProperty(arguments[0])){str_format.cache[arguments[0]]=str_format.parse(arguments[0]);}
return str_format.format.call(null,str_format.cache[arguments[0]],arguments);};str_format.format=function(parse_tree,argv){var cursor=1,tree_length=parse_tree.length,node_type='',arg,output=[],i,k,match,pad,pad_character,pad_length;for(i=0;i<tree_length;i++){node_type=get_type(parse_tree[i]);if(node_type==='string'){output.push(parse_tree[i]);}else if(node_type==='array'){match=parse_tree[i];if(match[2]){arg=argv[cursor];for(k=0;k<match[2].length;k++){if(!arg.hasOwnProperty(match[2][k])){throw(sprintf('[sprintf] property "%s" does not exist',match[2][k]));}
arg=arg[match[2][k]];}}else if(match[1]){arg=argv[match[1]];}else{arg=argv[cursor++];}
if(/[^s]/.test(match[8])&&(get_type(arg)!='number')){throw(sprintf('[sprintf] expecting number but found %s',get_type(arg)));}
switch(match[8]){case'b':arg=arg.toString(2);break;case'c':arg=String.fromCharCode(arg);break;case'd':arg=parseInt(arg,10);break;case'e':arg=match[7]?arg.toExponential(match[7]):arg.toExponential();break;case'f':arg=match[7]?parseFloat(arg).toFixed(match[7]):parseFloat(arg);break;case'o':arg=arg.toString(8);break;case's':arg=((arg=String(arg))&&match[7]?arg.substring(0,match[7]):arg);break;case'u':arg=Math.abs(arg);break;case'x':arg=arg.toString(16);break;case'X':arg=arg.toString(16).toUpperCase();break;}
arg=(/[def]/.test(match[8])&&match[3]&&arg>=0?'+'+arg:arg);pad_character=match[4]?match[4]=='0'?'0':match[4].charAt(1):' ';pad_length=match[6]-String(arg).length;pad=match[6]?str_repeat(pad_character,pad_length):'';output.push(match[5]?arg+pad:pad+arg);}}
return output.join('');};str_format.cache={};str_format.parse=function(fmt){var _fmt=fmt,match=[],parse_tree=[],arg_names=0;while(_fmt){if((match=/^[^\x25]+/.exec(_fmt))!==null){parse_tree.push(match[0]);}else if((match=/^\x25{2}/.exec(_fmt))!==null){parse_tree.push('%');}else if((match=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt))!==null){if(match[2]){arg_names|=1;var field_list=[],replacement_field=match[2],field_match=[];if((field_match=/^([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1]);while((replacement_field=replacement_field.substring(field_match[0].length))!==''){if((field_match=/^\.([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1]);}else if((field_match=/^\[(\d+)\]/.exec(replacement_field))!==null){field_list.push(field_match[1]);}else{throw('[sprintf] huh?');}}}else{throw('[sprintf] huh?');}
match[2]=field_list;}else{arg_names|=2;}
if(arg_names===3){throw('[sprintf] mixing positional and named placeholders is not (yet) supported');}
parse_tree.push(match);}else{throw('[sprintf] huh?');}
_fmt=_fmt.substring(match[0].length);}
return parse_tree;};return str_format;})();var vsprintf=function(fmt,argv){argv.unshift(fmt);return sprintf.apply(null,argv);};Ossn.Print=function(str,args){if(OssnLocale[str]){if(!args){return OssnLocale[str];}else{return vsprintf(OssnLocale[str],args);}}
return str;};Ossn.isLangString=function(str,args){if(OssnLocale[str]){return true;}
return false;};Ossn.MessageBoxClose=function(){$('.ossn-message-box').hide();$('.ossn-halt').removeClass('ossn-light').hide();$('.ossn-halt').attr('style','');};Ossn.MessageBox=function($url){Ossn.PostRequest({url:Ossn.site_url+$url,beforeSend:function(){$('.ossn-halt').addClass('ossn-light');$('.ossn-halt').attr('style','height:'+$(document).height()+'px;');$('.ossn-halt').show();$('.ossn-message-box').html('<div class="ossn-loading ossn-box-loading"></div>');$('.ossn-message-box').fadeIn('slow');},callback:function(callback){$('.ossn-message-box').html(callback).fadeIn();},});};Ossn.Viewer=function($url){Ossn.PostRequest({url:Ossn.site_url+$url,beforeSend:function(){$('.ossn-halt').removeClass('ossn-light');$('.ossn-halt').show();$('.ossn-viewer').html('<table class="ossn-container"><tr><td class="image-block" style="text-align: center;width:100%;"><div class="ossn-viewer-loding">Loading...</div></td></tr></table>');$('.ossn-viewer').show();},callback:function(callback){$('.ossn-viewer').html(callback).show();},});};Ossn.ViewerClose=function($url){$('.ossn-halt').addClass('ossn-light');$('.ossn-halt').hide();$('.ossn-viewer').html('');$('.ossn-viewer').hide();};Ossn.trigger_message=function($message,$type){$type=$type||'success';if($type=='error'){$type='danger';}
if($message==''){return false;}
$html="<div class='alert alert-dismissible alert-"+$type+"'><button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button>"+$message+"</div>";$('.ossn-system-messages').find('.ossn-system-messages-inner').append($html);if($('.ossn-system-messages').find('.ossn-system-messages-inner').is(":not(:visible)")){$('.ossn-system-messages').find('.ossn-system-messages-inner').slideDown('slow');}
setTimeout(function(){$('.ossn-system-messages').find('.ossn-system-messages-inner').empty().hide()},10000);};Ossn.Drag=function(){const default_cover_width=1040;const default_cover_height=200;var image_width=document.querySelector("#draggable").naturalWidth;var image_height=document.querySelector("#draggable").naturalHeight;var cover_width=$("#container").width();var cover_height=$("#container").height();var drag_width=0;var drag_height=0;if(image_width>cover_width&&image_width+cover_width>default_cover_width*2){drag_width=image_width-default_cover_width;}
if(image_height>cover_height&&image_height+cover_height>default_cover_height*2){drag_height=image_height-default_cover_height;}
$.globalVars={originalTop:0,originalLeft:0,maxHeight:drag_height,maxWidth:drag_width};$("#draggable").draggable({start:function(event,ui){if(ui.position!=undefined){$.globalVars.originalTop=ui.position.top;$.globalVars.originalLeft=ui.position.left;}},drag:function(event,ui){var newTop=ui.position.top;var newLeft=ui.position.left;if(ui.position.top<0&&ui.position.top*-1>$.globalVars.maxHeight){newTop=$.globalVars.maxHeight*-1;}
if(ui.position.top>0){newTop=0;}
if(ui.position.left<0&&ui.position.left*-1>$.globalVars.maxWidth){newLeft=$.globalVars.maxWidth*-1;}
if(ui.position.left>0){newLeft=0;}
ui.position.top=newTop;ui.position.left=newLeft;}});};Ossn.MessageDone=function($message){return"<div class='ossn-message-done'>"+$message+"</div>";};Ossn.register_callback('ossn','init','ossn_startup_functions_compatibility');Ossn.register_callback('ossn','init','ossn_image_url_cache');Ossn.register_callback('ossn','init','ossn_administrator_update_widget');Ossn.register_callback('ossn','init','ossn_makesure_confirmation');Ossn.register_callback('ossn','init','ossn_system_messages');Ossn.register_callback('ossn','init','ossn_user_signup_form');Ossn.register_callback('ossn','init','ossn_topbar_dropdown');function ossn_user_signup_form(){Ossn.ajaxRequest({url:Ossn.site_url+"action/user/register",form:'#ossn-home-signup',beforeSend:function(request){var failedValidate=false;$('#ossn-submit-button').show();$('#ossn-home-signup .ossn-loading').addClass("ossn-hidden");$('#ossn-home-signup').find('#ossn-signup-errors').hide();$('#ossn-home-signup input').filter(function(){$(this).closest('span').removeClass('ossn-required');if(this.type=='radio'&&!$(this).hasClass('ossn-field-not-required')){if(!$("input[name='gender']:checked").val()){$(this).closest('span').addClass('ossn-required');failedValidate=true;}}
if(this.value==""&&!$(this).hasClass('ossn-field-not-required')){$(this).addClass('ossn-red-borders');failedValidate=true;request.abort();return false;}});if(failedValidate==false){$('#ossn-submit-button').hide();$('#ossn-home-signup .ossn-loading').removeClass("ossn-hidden");}},callback:function(callback){if(callback['dataerr']){$('#ossn-home-signup').find('#ossn-signup-errors').html(callback['dataerr']).fadeIn();$('#ossn-submit-button').show();$('#ossn-home-signup .ossn-loading').addClass("ossn-hidden");}else if(callback['success']==1){$('#ossn-home-signup').html(Ossn.MessageDone(callback['datasuccess']));}else{$('#ossn-home-signup .ossn-loading').addClass("ossn-hidden");$('#ossn-submit-button').attr('type','submit')
$('#ossn-submit-button').attr('style','opacity:1;');}}});}
function ossn_system_messages(){$(document).ready(function(){if($('.ossn-system-messages').find('button').length){$('.ossn-system-messages').find('.ossn-system-messages-inner').show();setTimeout(function(){$('.ossn-system-messages').find('.ossn-system-messages-inner').hide().empty();},10000);}
$('body').on('click','.ossn-system-messages .close',function(){$('.ossn-system-messages').find('.ossn-system-messages-inner').hide().empty();});});}
function ossn_topbar_dropdown(){$(document).ready(function(){$('.ossn-topbar-dropdown-menu-button').on('click',function(){if($('.ossn-topbar-dropdown-menu-content').is(":not(:visible)")){$('.ossn-topbar-dropdown-menu-content').show();}else{$('.ossn-topbar-dropdown-menu-content').hide();}});});}
function ossn_makesure_confirmation(){$(document).ready(function(){$('.ossn-make-sure').on('click',function(e){e.preventDefault();var msg='ossn:exception:make:sure';if(typeof $(this).data('ossn-msg')!=="undefined"){msg=$(this).data('ossn-msg');}
var del=confirm(Ossn.Print(msg));if(del==true){var actionurl=$(this).attr('href');window.location=actionurl;}});});}
function ossn_administrator_update_widget(){$(document).ready(function(){if($('.avaiable-updates').length){Ossn.PostRequest({url:Ossn.site_url+"administrator/version",action:false,callback:function(callback){if(callback['version']){$('.avaiable-updates').html(callback['version']);}}});}});}
function ossn_image_url_cache($callback,$type,$params){$(document).ready(function(){if(Ossn.Config.cache.ossn_cache==1){$('img').each(function(){var data=$(this).attr('src');$site_url=Ossn.ParseUrl(Ossn.site_url);var parts=Ossn.ParseUrl(data),args={},base='';if(parts['host']==$site_url['host']){if(parts['host']===undefined){if(data.indexOf('?')===0){base='?';args=Ossn.ParseStr(parts['query']);}}else{if(parts['query']!==undefined){args=Ossn.ParseStr(parts['query']);}
var split=data.split('?');base=split[0]+'?';}
if(!args['ossn_cache']){args["ossn_cache"]=Ossn.Config.cache.last_cache;$(this).attr('src',base+jQuery.param(args));}}});}});}
function ossn_startup_functions_compatibility($callback,$type,$params){for(var i=0;i<=Ossn.Startups.length;i++){if(typeof Ossn.Startups[i]!=="undefined"){Ossn.Startups[i]();}}}
Ossn.Init=function(){Ossn.trigger_callback('ossn','init');};(function(name,context,definition){"use strict";if(typeof define==="function"&&define.amd){define(definition);}
else if(typeof module!=="undefined"&&module.exports){module.exports=definition();}
else if(context.exports){context.exports=definition();}
else{context[name]=definition();}})("Fingerprint2",this,function(){"use strict";if(!Array.prototype.indexOf){Array.prototype.indexOf=function(searchElement,fromIndex){var k;if(this==null){throw new TypeError("'this' is null or undefined");}
var O=Object(this);var len=O.length>>>0;if(len===0){return-1;}
var n=+fromIndex||0;if(Math.abs(n)===Infinity){n=0;}
if(n>=len){return-1;}
k=Math.max(n>=0?n:len-Math.abs(n),0);while(k<len){if(k in O&&O[k]===searchElement){return k;}
k++;}
return-1;};}
var Fingerprint2=function(options){if(!(this instanceof Fingerprint2)){return new Fingerprint2(options);}
var defaultOptions={swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:true,sortPluginsFor:[/palemoon/i],userDefinedFonts:[]};this.options=this.extend(options,defaultOptions);this.nativeForEach=Array.prototype.forEach;this.nativeMap=Array.prototype.map;};Fingerprint2.prototype={extend:function(source,target){if(source==null){return target;}
for(var k in source){if(source[k]!=null&&target[k]!==source[k]){target[k]=source[k];}}
return target;},log:function(msg){if(window.console){console.log(msg);}},get:function(done){var keys=[];keys=this.userAgentKey(keys);keys=this.languageKey(keys);keys=this.colorDepthKey(keys);keys=this.timezoneOffsetKey(keys);keys=this.sessionStorageKey(keys);keys=this.localStorageKey(keys);keys=this.indexedDbKey(keys);keys=this.addBehaviorKey(keys);keys=this.openDatabaseKey(keys);keys=this.cpuClassKey(keys);keys=this.platformKey(keys);keys=this.doNotTrackKey(keys);keys=this.pluginsKey(keys);keys=this.canvasKey(keys);keys=this.webglKey(keys);keys=this.adBlockKey(keys);keys=this.hasLiedLanguagesKey(keys);keys=this.hasLiedResolutionKey(keys);keys=this.hasLiedOsKey(keys);keys=this.hasLiedBrowserKey(keys);keys=this.touchSupportKey(keys);var that=this;this.fontsKey(keys,function(newKeys){var values=[];that.each(newKeys,function(pair){var value=pair.value;if(typeof pair.value.join!=="undefined"){value=pair.value.join(";");}
values.push(value);});var murmur=that.x64hash128(values.join("~~~"),31);return done(murmur,newKeys);});},userAgentKey:function(keys){if(!this.options.excludeUserAgent){keys.push({key:"user_agent",value:this.getUserAgent()});}
return keys;},getUserAgent:function(){return navigator.userAgent;},languageKey:function(keys){if(!this.options.excludeLanguage){keys.push({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""});}
return keys;},colorDepthKey:function(keys){if(!this.options.excludeColorDepth){keys.push({key:"color_depth",value:screen.colorDepth||-1});}
return keys;},pixelRatioKey:function(keys){if(!this.options.excludePixelRatio){keys.push({key:"pixel_ratio",value:this.getPixelRatio()});}
return keys;},getPixelRatio:function(){return window.devicePixelRatio||"";},screenResolutionKey:function(keys){if(!this.options.excludeScreenResolution){return this.getScreenResolution(keys);}
return keys;},getScreenResolution:function(keys){var resolution;if(this.options.detectScreenOrientation){resolution=(screen.height>screen.width)?[screen.height,screen.width]:[screen.width,screen.height];}else{resolution=[screen.width,screen.height];}
if(typeof resolution!=="undefined"){keys.push({key:"resolution",value:resolution});}
return keys;},availableScreenResolutionKey:function(keys){if(!this.options.excludeAvailableScreenResolution){return this.getAvailableScreenResolution(keys);}
return keys;},getAvailableScreenResolution:function(keys){var available;if(screen.availWidth&&screen.availHeight){if(this.options.detectScreenOrientation){available=(screen.availHeight>screen.availWidth)?[screen.availHeight,screen.availWidth]:[screen.availWidth,screen.availHeight];}else{available=[screen.availHeight,screen.availWidth];}}
if(typeof available!=="undefined"){keys.push({key:"available_resolution",value:available});}
return keys;},timezoneOffsetKey:function(keys){if(!this.options.excludeTimezoneOffset){keys.push({key:"timezone_offset",value:new Date().getTimezoneOffset()});}
return keys;},sessionStorageKey:function(keys){if(!this.options.excludeSessionStorage&&this.hasSessionStorage()){keys.push({key:"session_storage",value:1});}
return keys;},localStorageKey:function(keys){if(!this.options.excludeSessionStorage&&this.hasLocalStorage()){keys.push({key:"local_storage",value:1});}
return keys;},indexedDbKey:function(keys){if(!this.options.excludeIndexedDB&&this.hasIndexedDB()){keys.push({key:"indexed_db",value:1});}
return keys;},addBehaviorKey:function(keys){if(document.body&&!this.options.excludeAddBehavior&&document.body.addBehavior){keys.push({key:"add_behavior",value:1});}
return keys;},openDatabaseKey:function(keys){if(!this.options.excludeOpenDatabase&&window.openDatabase){keys.push({key:"open_database",value:1});}
return keys;},cpuClassKey:function(keys){if(!this.options.excludeCpuClass){keys.push({key:"cpu_class",value:this.getNavigatorCpuClass()});}
return keys;},platformKey:function(keys){if(!this.options.excludePlatform){keys.push({key:"navigator_platform",value:this.getNavigatorPlatform()});}
return keys;},doNotTrackKey:function(keys){if(!this.options.excludeDoNotTrack){keys.push({key:"do_not_track",value:this.getDoNotTrack()});}
return keys;},canvasKey:function(keys){if(!this.options.excludeCanvas&&this.isCanvasSupported()){keys.push({key:"canvas",value:this.getCanvasFp()});}
return keys;},webglKey:function(keys){if(this.options.excludeWebGL){if(typeof NODEBUG==="undefined"){this.log("Skipping WebGL fingerprinting per excludeWebGL configuration option");}
return keys;}
if(!this.isWebGlSupported()){if(typeof NODEBUG==="undefined"){this.log("Skipping WebGL fingerprinting because it is not supported in this browser");}
return keys;}
keys.push({key:"webgl",value:this.getWebglFp()});return keys;},adBlockKey:function(keys){if(!this.options.excludeAdBlock){keys.push({key:"adblock",value:this.getAdBlock()});}
return keys;},hasLiedLanguagesKey:function(keys){if(!this.options.excludeHasLiedLanguages){keys.push({key:"has_lied_languages",value:this.getHasLiedLanguages()});}
return keys;},hasLiedResolutionKey:function(keys){if(!this.options.excludeHasLiedResolution){keys.push({key:"has_lied_resolution",value:this.getHasLiedResolution()});}
return keys;},hasLiedOsKey:function(keys){if(!this.options.excludeHasLiedOs){keys.push({key:"has_lied_os",value:this.getHasLiedOs()});}
return keys;},hasLiedBrowserKey:function(keys){if(!this.options.excludeHasLiedBrowser){keys.push({key:"has_lied_browser",value:this.getHasLiedBrowser()});}
return keys;},fontsKey:function(keys,done){if(this.options.excludeJsFonts){return this.flashFontsKey(keys,done);}
return this.jsFontsKey(keys,done);},flashFontsKey:function(keys,done){if(this.options.excludeFlashFonts){if(typeof NODEBUG==="undefined"){this.log("Skipping flash fonts detection per excludeFlashFonts configuration option");}
return done(keys);}
if(!this.hasSwfObjectLoaded()){if(typeof NODEBUG==="undefined"){this.log("Swfobject is not detected, Flash fonts enumeration is skipped");}
return done(keys);}
if(!this.hasMinFlashInstalled()){if(typeof NODEBUG==="undefined"){this.log("Flash is not installed, skipping Flash fonts enumeration");}
return done(keys);}
if(typeof this.options.swfPath==="undefined"){if(typeof NODEBUG==="undefined"){this.log("To use Flash fonts detection, you must pass a valid swfPath option, skipping Flash fonts enumeration");}
return done(keys);}
this.loadSwfAndDetectFonts(function(fonts){keys.push({key:"swf_fonts",value:fonts.join(";")});done(keys);});},jsFontsKey:function(keys,done){var that=this;return setTimeout(function(){var baseFonts=["monospace","sans-serif","serif"];var fontList=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Garamond","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];var extendedFontList=["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"];if(that.options.extendedJsFonts){fontList=fontList.concat(extendedFontList);}
fontList=fontList.concat(that.options.userDefinedFonts);var testString="mmmmmmmmmmlli";var testSize="72px";var h=document.getElementsByTagName("body")[0];var baseFontsDiv=document.createElement("div");var fontsDiv=document.createElement("div");var defaultWidth={};var defaultHeight={};var createSpan=function(){var s=document.createElement("span");s.style.position="absolute";s.style.left="-9999px";s.style.fontSize=testSize;s.style.lineHeight="normal";s.innerHTML=testString;return s;};var createSpanWithFonts=function(fontToDetect,baseFont){var s=createSpan();s.style.fontFamily="'"+fontToDetect+"',"+baseFont;return s;};var initializeBaseFontsSpans=function(){var spans=[];for(var index=0,length=baseFonts.length;index<length;index++){var s=createSpan();s.style.fontFamily=baseFonts[index];baseFontsDiv.appendChild(s);spans.push(s);}
return spans;};var initializeFontsSpans=function(){var spans={};for(var i=0,l=fontList.length;i<l;i++){var fontSpans=[];for(var j=0,numDefaultFonts=baseFonts.length;j<numDefaultFonts;j++){var s=createSpanWithFonts(fontList[i],baseFonts[j]);fontsDiv.appendChild(s);fontSpans.push(s);}
spans[fontList[i]]=fontSpans;}
return spans;};var isFontAvailable=function(fontSpans){var detected=false;for(var i=0;i<baseFonts.length;i++){detected=(fontSpans[i].offsetWidth!==defaultWidth[baseFonts[i]]||fontSpans[i].offsetHeight!==defaultHeight[baseFonts[i]]);if(detected){return detected;}}
return detected;};var baseFontsSpans=initializeBaseFontsSpans();h.appendChild(baseFontsDiv);for(var index=0,length=baseFonts.length;index<length;index++){defaultWidth[baseFonts[index]]=baseFontsSpans[index].offsetWidth;defaultHeight[baseFonts[index]]=baseFontsSpans[index].offsetHeight;}
var fontsSpans=initializeFontsSpans();h.appendChild(fontsDiv);var available=[];for(var i=0,l=fontList.length;i<l;i++){if(isFontAvailable(fontsSpans[fontList[i]])){available.push(fontList[i]);}}
h.removeChild(fontsDiv);h.removeChild(baseFontsDiv);keys.push({key:"js_fonts",value:available});done(keys);},1);},pluginsKey:function(keys){if(!this.options.excludePlugins){if(this.isIE()){if(!this.options.excludeIEPlugins){keys.push({key:"ie_plugins",value:this.getIEPlugins()});}}else{keys.push({key:"regular_plugins",value:this.getRegularPlugins()});}}
return keys;},getRegularPlugins:function(){var plugins=[];for(var i=0,l=navigator.plugins.length;i<l;i++){plugins.push(navigator.plugins[i]);}
if(this.pluginsShouldBeSorted()){plugins=plugins.sort(function(a,b){if(a.name>b.name){return 1;}
if(a.name<b.name){return-1;}
return 0;});}
return this.map(plugins,function(p){var mimeTypes=this.map(p,function(mt){return[mt.type,mt.suffixes].join("~");}).join(",");return[p.name,p.description,mimeTypes].join("::");},this);},getIEPlugins:function(){var result=[];if((Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject"))||("ActiveXObject"in window)){var names=["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"];result=this.map(names,function(name){try{new ActiveXObject(name);return name;}catch(e){return null;}});}
if(navigator.plugins){result=result.concat(this.getRegularPlugins());}
return result;},pluginsShouldBeSorted:function(){var should=false;for(var i=0,l=this.options.sortPluginsFor.length;i<l;i++){var re=this.options.sortPluginsFor[i];if(navigator.userAgent.match(re)){should=true;break;}}
return should;},touchSupportKey:function(keys){if(!this.options.excludeTouchSupport){keys.push({key:"touch_support",value:this.getTouchSupport()});}
return keys;},hasSessionStorage:function(){try{return!!window.sessionStorage;}catch(e){return true;}},hasLocalStorage:function(){try{return!!window.localStorage;}catch(e){return true;}},hasIndexedDB:function(){try{return!!window.indexedDB;}catch(e){return true;}},getNavigatorCpuClass:function(){if(navigator.cpuClass){return navigator.cpuClass;}else{return"unknown";}},getNavigatorPlatform:function(){if(navigator.platform){return navigator.platform;}else{return"unknown";}},getDoNotTrack:function(){if(navigator.doNotTrack){return navigator.doNotTrack;}else if(navigator.msDoNotTrack){return navigator.msDoNotTrack;}else if(window.doNotTrack){return window.doNotTrack;}else{return"unknown";}},getTouchSupport:function(){var maxTouchPoints=0;var touchEvent=false;if(typeof navigator.maxTouchPoints!=="undefined"){maxTouchPoints=navigator.maxTouchPoints;}else if(typeof navigator.msMaxTouchPoints!=="undefined"){maxTouchPoints=navigator.msMaxTouchPoints;}
try{document.createEvent("TouchEvent");touchEvent=true;}catch(_){}
var touchStart="ontouchstart"in window;return[maxTouchPoints,touchEvent,touchStart];},getCanvasFp:function(){var result=[];var canvas=document.createElement("canvas");canvas.width=2000;canvas.height=200;canvas.style.display="inline";var ctx=canvas.getContext("2d");ctx.rect(0,0,10,10);ctx.rect(2,2,6,6);result.push("canvas winding:"+((ctx.isPointInPath(5,5,"evenodd")===false)?"yes":"no"));ctx.textBaseline="alphabetic";ctx.fillStyle="#f60";ctx.fillRect(125,1,62,20);ctx.fillStyle="#069";if(this.options.dontUseFakeFontInCanvas){ctx.font="11pt Arial";}else{ctx.font="11pt no-real-font-123";}
ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03",2,15);ctx.fillStyle="rgba(102, 204, 0, 0.2)";ctx.font="18pt Arial";ctx.fillText("Cwm fjordbank glyphs vext quiz, \ud83d\ude03",4,45);ctx.globalCompositeOperation="multiply";ctx.fillStyle="rgb(255,0,255)";ctx.beginPath();ctx.arc(50,50,50,0,Math.PI*2,true);ctx.closePath();ctx.fill();ctx.fillStyle="rgb(0,255,255)";ctx.beginPath();ctx.arc(100,50,50,0,Math.PI*2,true);ctx.closePath();ctx.fill();ctx.fillStyle="rgb(255,255,0)";ctx.beginPath();ctx.arc(75,100,50,0,Math.PI*2,true);ctx.closePath();ctx.fill();ctx.fillStyle="rgb(255,0,255)";ctx.arc(75,75,75,0,Math.PI*2,true);ctx.arc(75,75,25,0,Math.PI*2,true);ctx.fill("evenodd");result.push("canvas fp:"+canvas.toDataURL());return result.join("~");},getWebglFp:function(){var gl;var fa2s=function(fa){gl.clearColor(0.0,0.0,0.0,1.0);gl.enable(gl.DEPTH_TEST);gl.depthFunc(gl.LEQUAL);gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);return"["+fa[0]+", "+fa[1]+"]";};var maxAnisotropy=function(gl){var anisotropy,ext=gl.getExtension("EXT_texture_filter_anisotropic")||gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||gl.getExtension("MOZ_EXT_texture_filter_anisotropic");return ext?(anisotropy=gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT),0===anisotropy&&(anisotropy=2),anisotropy):null;};gl=this.getWebglCanvas();if(!gl){return null;}
var result=[];var vShaderTemplate="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}";var fShaderTemplate="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}";var vertexPosBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,vertexPosBuffer);var vertices=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);vertexPosBuffer.itemSize=3;vertexPosBuffer.numItems=3;var program=gl.createProgram(),vshader=gl.createShader(gl.VERTEX_SHADER);gl.shaderSource(vshader,vShaderTemplate);gl.compileShader(vshader);var fshader=gl.createShader(gl.FRAGMENT_SHADER);gl.shaderSource(fshader,fShaderTemplate);gl.compileShader(fshader);gl.attachShader(program,vshader);gl.attachShader(program,fshader);gl.linkProgram(program);gl.useProgram(program);program.vertexPosAttrib=gl.getAttribLocation(program,"attrVertex");program.offsetUniform=gl.getUniformLocation(program,"uniformOffset");gl.enableVertexAttribArray(program.vertexPosArray);gl.vertexAttribPointer(program.vertexPosAttrib,vertexPosBuffer.itemSize,gl.FLOAT,!1,0,0);gl.uniform2f(program.offsetUniform,1,1);gl.drawArrays(gl.TRIANGLE_STRIP,0,vertexPosBuffer.numItems);if(gl.canvas!=null){result.push(gl.canvas.toDataURL());}
result.push("extensions:"+gl.getSupportedExtensions().join(";"));result.push("webgl aliased line width range:"+fa2s(gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)));result.push("webgl aliased point size range:"+fa2s(gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)));result.push("webgl alpha bits:"+gl.getParameter(gl.ALPHA_BITS));result.push("webgl antialiasing:"+(gl.getContextAttributes().antialias?"yes":"no"));result.push("webgl blue bits:"+gl.getParameter(gl.BLUE_BITS));result.push("webgl depth bits:"+gl.getParameter(gl.DEPTH_BITS));result.push("webgl green bits:"+gl.getParameter(gl.GREEN_BITS));result.push("webgl max anisotropy:"+maxAnisotropy(gl));result.push("webgl max combined texture image units:"+gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS));result.push("webgl max cube map texture size:"+gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE));result.push("webgl max fragment uniform vectors:"+gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS));result.push("webgl max render buffer size:"+gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));result.push("webgl max texture image units:"+gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS));result.push("webgl max texture size:"+gl.getParameter(gl.MAX_TEXTURE_SIZE));result.push("webgl max varying vectors:"+gl.getParameter(gl.MAX_VARYING_VECTORS));result.push("webgl max vertex attribs:"+gl.getParameter(gl.MAX_VERTEX_ATTRIBS));result.push("webgl max vertex texture image units:"+gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS));result.push("webgl max vertex uniform vectors:"+gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS));result.push("webgl max viewport dims:"+fa2s(gl.getParameter(gl.MAX_VIEWPORT_DIMS)));result.push("webgl red bits:"+gl.getParameter(gl.RED_BITS));result.push("webgl renderer:"+gl.getParameter(gl.RENDERER));result.push("webgl shading language version:"+gl.getParameter(gl.SHADING_LANGUAGE_VERSION));result.push("webgl stencil bits:"+gl.getParameter(gl.STENCIL_BITS));result.push("webgl vendor:"+gl.getParameter(gl.VENDOR));result.push("webgl version:"+gl.getParameter(gl.VERSION));if(!gl.getShaderPrecisionFormat){if(typeof NODEBUG==="undefined"){this.log("WebGL fingerprinting is incomplete, because your browser does not support getShaderPrecisionFormat");}
return result.join("~");}
result.push("webgl vertex shader high float precision:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.HIGH_FLOAT).precision);result.push("webgl vertex shader high float precision rangeMin:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.HIGH_FLOAT).rangeMin);result.push("webgl vertex shader high float precision rangeMax:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.HIGH_FLOAT).rangeMax);result.push("webgl vertex shader medium float precision:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_FLOAT).precision);result.push("webgl vertex shader medium float precision rangeMin:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_FLOAT).rangeMin);result.push("webgl vertex shader medium float precision rangeMax:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_FLOAT).rangeMax);result.push("webgl vertex shader low float precision:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.LOW_FLOAT).precision);result.push("webgl vertex shader low float precision rangeMin:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.LOW_FLOAT).rangeMin);result.push("webgl vertex shader low float precision rangeMax:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.LOW_FLOAT).rangeMax);result.push("webgl fragment shader high float precision:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_FLOAT).precision);result.push("webgl fragment shader high float precision rangeMin:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_FLOAT).rangeMin);result.push("webgl fragment shader high float precision rangeMax:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_FLOAT).rangeMax);result.push("webgl fragment shader medium float precision:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_FLOAT).precision);result.push("webgl fragment shader medium float precision rangeMin:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_FLOAT).rangeMin);result.push("webgl fragment shader medium float precision rangeMax:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_FLOAT).rangeMax);result.push("webgl fragment shader low float precision:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.LOW_FLOAT).precision);result.push("webgl fragment shader low float precision rangeMin:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.LOW_FLOAT).rangeMin);result.push("webgl fragment shader low float precision rangeMax:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.LOW_FLOAT).rangeMax);result.push("webgl vertex shader high int precision:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.HIGH_INT).precision);result.push("webgl vertex shader high int precision rangeMin:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.HIGH_INT).rangeMin);result.push("webgl vertex shader high int precision rangeMax:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.HIGH_INT).rangeMax);result.push("webgl vertex shader medium int precision:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_INT).precision);result.push("webgl vertex shader medium int precision rangeMin:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_INT).rangeMin);result.push("webgl vertex shader medium int precision rangeMax:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_INT).rangeMax);result.push("webgl vertex shader low int precision:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.LOW_INT).precision);result.push("webgl vertex shader low int precision rangeMin:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.LOW_INT).rangeMin);result.push("webgl vertex shader low int precision rangeMax:"+gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.LOW_INT).rangeMax);result.push("webgl fragment shader high int precision:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_INT).precision);result.push("webgl fragment shader high int precision rangeMin:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_INT).rangeMin);result.push("webgl fragment shader high int precision rangeMax:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_INT).rangeMax);result.push("webgl fragment shader medium int precision:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_INT).precision);result.push("webgl fragment shader medium int precision rangeMin:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_INT).rangeMin);result.push("webgl fragment shader medium int precision rangeMax:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_INT).rangeMax);result.push("webgl fragment shader low int precision:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.LOW_INT).precision);result.push("webgl fragment shader low int precision rangeMin:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.LOW_INT).rangeMin);result.push("webgl fragment shader low int precision rangeMax:"+gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.LOW_INT).rangeMax);return result.join("~");},getAdBlock:function(){var ads=document.createElement("div");ads.innerHTML="&nbsp;";ads.className="adsbox";var result=false;try{document.body.appendChild(ads);result=document.getElementsByClassName("adsbox")[0].offsetHeight===0;document.body.removeChild(ads);}catch(e){result=false;}
return result;},getHasLiedLanguages:function(){if(typeof navigator.languages!=="undefined"){try{var firstLanguages=navigator.languages[0].substr(0,2);if(firstLanguages!==navigator.language.substr(0,2)){return true;}}catch(err){return true;}}
return false;},getHasLiedResolution:function(){if(screen.width<screen.availWidth){return true;}
if(screen.height<screen.availHeight){return true;}
return false;},getHasLiedOs:function(){var userAgent=navigator.userAgent.toLowerCase();var oscpu=navigator.oscpu;var platform=navigator.platform.toLowerCase();var os;if(userAgent.indexOf("windows phone")>=0){os="Windows Phone";}else if(userAgent.indexOf("win")>=0){os="Windows";}else if(userAgent.indexOf("android")>=0){os="Android";}else if(userAgent.indexOf("linux")>=0){os="Linux";}else if(userAgent.indexOf("iphone")>=0||userAgent.indexOf("ipad")>=0){os="iOS";}else if(userAgent.indexOf("mac")>=0){os="Mac";}else{os="Other";}
var mobileDevice;if(("ontouchstart"in window)||(navigator.maxTouchPoints>0)||(navigator.msMaxTouchPoints>0)){mobileDevice=true;}else{mobileDevice=false;}
if(mobileDevice&&os!=="Windows Phone"&&os!=="Android"&&os!=="iOS"&&os!=="Other"){return true;}
if(typeof oscpu!=="undefined"){oscpu=oscpu.toLowerCase();if(oscpu.indexOf("win")>=0&&os!=="Windows"&&os!=="Windows Phone"){return true;}else if(oscpu.indexOf("linux")>=0&&os!=="Linux"&&os!=="Android"){return true;}else if(oscpu.indexOf("mac")>=0&&os!=="Mac"&&os!=="iOS"){return true;}else if(oscpu.indexOf("win")===0&&oscpu.indexOf("linux")===0&&oscpu.indexOf("mac")>=0&&os!=="other"){return true;}}
if(platform.indexOf("win")>=0&&os!=="Windows"&&os!=="Windows Phone"){return true;}else if((platform.indexOf("linux")>=0||platform.indexOf("android")>=0||platform.indexOf("pike")>=0)&&os!=="Linux"&&os!=="Android"){return true;}else if((platform.indexOf("mac")>=0||platform.indexOf("ipad")>=0||platform.indexOf("ipod")>=0||platform.indexOf("iphone")>=0)&&os!=="Mac"&&os!=="iOS"){return true;}else if(platform.indexOf("win")===0&&platform.indexOf("linux")===0&&platform.indexOf("mac")>=0&&os!=="other"){return true;}
if(typeof navigator.plugins==="undefined"&&os!=="Windows"&&os!=="Windows Phone"){return true;}
return false;},getHasLiedBrowser:function(){var userAgent=navigator.userAgent.toLowerCase();var productSub=navigator.productSub;var browser;if(userAgent.indexOf("firefox")>=0){browser="Firefox";}else if(userAgent.indexOf("opera")>=0||userAgent.indexOf("opr")>=0){browser="Opera";}else if(userAgent.indexOf("chrome")>=0){browser="Chrome";}else if(userAgent.indexOf("safari")>=0){browser="Safari";}else if(userAgent.indexOf("trident")>=0){browser="Internet Explorer";}else{browser="Other";}
if((browser==="Chrome"||browser==="Safari"||browser==="Opera")&&productSub!=="20030107"){return true;}
var tempRes=eval.toString().length;if(tempRes===37&&browser!=="Safari"&&browser!=="Firefox"&&browser!=="Other"){return true;}else if(tempRes===39&&browser!=="Internet Explorer"&&browser!=="Other"){return true;}else if(tempRes===33&&browser!=="Chrome"&&browser!=="Opera"&&browser!=="Other"){return true;}
var errFirefox;try{throw"a";}catch(err){try{err.toSource();errFirefox=true;}catch(errOfErr){errFirefox=false;}}
if(errFirefox&&browser!=="Firefox"&&browser!=="Other"){return true;}
return false;},isCanvasSupported:function(){var elem=document.createElement("canvas");return!!(elem.getContext&&elem.getContext("2d"));},isWebGlSupported:function(){if(!this.isCanvasSupported()){return false;}
var canvas=document.createElement("canvas"),glContext;try{glContext=canvas.getContext&&(canvas.getContext("webgl")||canvas.getContext("experimental-webgl"));}catch(e){glContext=false;}
return!!window.WebGLRenderingContext&&!!glContext;},isIE:function(){if(navigator.appName==="Microsoft Internet Explorer"){return true;}else if(navigator.appName==="Netscape"&&/Trident/.test(navigator.userAgent)){return true;}
return false;},hasSwfObjectLoaded:function(){return typeof window.swfobject!=="undefined";},hasMinFlashInstalled:function(){return swfobject.hasFlashPlayerVersion("9.0.0");},addFlashDivNode:function(){var node=document.createElement("div");node.setAttribute("id",this.options.swfContainerId);document.body.appendChild(node);},loadSwfAndDetectFonts:function(done){var hiddenCallback="___fp_swf_loaded";window[hiddenCallback]=function(fonts){done(fonts);};var id=this.options.swfContainerId;this.addFlashDivNode();var flashvars={onReady:hiddenCallback};var flashparams={allowScriptAccess:"always",menu:"false"};swfobject.embedSWF(this.options.swfPath,id,"1","1","9.0.0",false,flashvars,flashparams,{});},getWebglCanvas:function(){var canvas=document.createElement("canvas");var gl=null;try{gl=canvas.getContext("webgl")||canvas.getContext("experimental-webgl");}catch(e){}
if(!gl){gl=null;}
return gl;},each:function(obj,iterator,context){if(obj===null){return;}
if(this.nativeForEach&&obj.forEach===this.nativeForEach){obj.forEach(iterator,context);}else if(obj.length===+obj.length){for(var i=0,l=obj.length;i<l;i++){if(iterator.call(context,obj[i],i,obj)==={}){return;}}}else{for(var key in obj){if(obj.hasOwnProperty(key)){if(iterator.call(context,obj[key],key,obj)==={}){return;}}}}},map:function(obj,iterator,context){var results=[];if(obj==null){return results;}
if(this.nativeMap&&obj.map===this.nativeMap){return obj.map(iterator,context);}
this.each(obj,function(value,index,list){results[results.length]=iterator.call(context,value,index,list);});return results;},x64Add:function(m,n){m=[m[0]>>>16,m[0]&0xffff,m[1]>>>16,m[1]&0xffff];n=[n[0]>>>16,n[0]&0xffff,n[1]>>>16,n[1]&0xffff];var o=[0,0,0,0];o[3]+=m[3]+n[3];o[2]+=o[3]>>>16;o[3]&=0xffff;o[2]+=m[2]+n[2];o[1]+=o[2]>>>16;o[2]&=0xffff;o[1]+=m[1]+n[1];o[0]+=o[1]>>>16;o[1]&=0xffff;o[0]+=m[0]+n[0];o[0]&=0xffff;return[(o[0]<<16)|o[1],(o[2]<<16)|o[3]];},x64Multiply:function(m,n){m=[m[0]>>>16,m[0]&0xffff,m[1]>>>16,m[1]&0xffff];n=[n[0]>>>16,n[0]&0xffff,n[1]>>>16,n[1]&0xffff];var o=[0,0,0,0];o[3]+=m[3]*n[3];o[2]+=o[3]>>>16;o[3]&=0xffff;o[2]+=m[2]*n[3];o[1]+=o[2]>>>16;o[2]&=0xffff;o[2]+=m[3]*n[2];o[1]+=o[2]>>>16;o[2]&=0xffff;o[1]+=m[1]*n[3];o[0]+=o[1]>>>16;o[1]&=0xffff;o[1]+=m[2]*n[2];o[0]+=o[1]>>>16;o[1]&=0xffff;o[1]+=m[3]*n[1];o[0]+=o[1]>>>16;o[1]&=0xffff;o[0]+=(m[0]*n[3])+(m[1]*n[2])+(m[2]*n[1])+(m[3]*n[0]);o[0]&=0xffff;return[(o[0]<<16)|o[1],(o[2]<<16)|o[3]];},x64Rotl:function(m,n){n%=64;if(n===32){return[m[1],m[0]];}
else if(n<32){return[(m[0]<<n)|(m[1]>>>(32-n)),(m[1]<<n)|(m[0]>>>(32-n))];}
else{n-=32;return[(m[1]<<n)|(m[0]>>>(32-n)),(m[0]<<n)|(m[1]>>>(32-n))];}},x64LeftShift:function(m,n){n%=64;if(n===0){return m;}
else if(n<32){return[(m[0]<<n)|(m[1]>>>(32-n)),m[1]<<n];}
else{return[m[1]<<(n-32),0];}},x64Xor:function(m,n){return[m[0]^n[0],m[1]^n[1]];},x64Fmix:function(h){h=this.x64Xor(h,[0,h[0]>>>1]);h=this.x64Multiply(h,[0xff51afd7,0xed558ccd]);h=this.x64Xor(h,[0,h[0]>>>1]);h=this.x64Multiply(h,[0xc4ceb9fe,0x1a85ec53]);h=this.x64Xor(h,[0,h[0]>>>1]);return h;},x64hash128:function(key,seed){key=key||"";seed=seed||0;var remainder=key.length%16;var bytes=key.length-remainder;var h1=[0,seed];var h2=[0,seed];var k1=[0,0];var k2=[0,0];var c1=[0x87c37b91,0x114253d5];var c2=[0x4cf5ad43,0x2745937f];for(var i=0;i<bytes;i=i+16){k1=[((key.charCodeAt(i+4)&0xff))|((key.charCodeAt(i+5)&0xff)<<8)|((key.charCodeAt(i+6)&0xff)<<16)|((key.charCodeAt(i+7)&0xff)<<24),((key.charCodeAt(i)&0xff))|((key.charCodeAt(i+1)&0xff)<<8)|((key.charCodeAt(i+2)&0xff)<<16)|((key.charCodeAt(i+3)&0xff)<<24)];k2=[((key.charCodeAt(i+12)&0xff))|((key.charCodeAt(i+13)&0xff)<<8)|((key.charCodeAt(i+14)&0xff)<<16)|((key.charCodeAt(i+15)&0xff)<<24),((key.charCodeAt(i+8)&0xff))|((key.charCodeAt(i+9)&0xff)<<8)|((key.charCodeAt(i+10)&0xff)<<16)|((key.charCodeAt(i+11)&0xff)<<24)];k1=this.x64Multiply(k1,c1);k1=this.x64Rotl(k1,31);k1=this.x64Multiply(k1,c2);h1=this.x64Xor(h1,k1);h1=this.x64Rotl(h1,27);h1=this.x64Add(h1,h2);h1=this.x64Add(this.x64Multiply(h1,[0,5]),[0,0x52dce729]);k2=this.x64Multiply(k2,c2);k2=this.x64Rotl(k2,33);k2=this.x64Multiply(k2,c1);h2=this.x64Xor(h2,k2);h2=this.x64Rotl(h2,31);h2=this.x64Add(h2,h1);h2=this.x64Add(this.x64Multiply(h2,[0,5]),[0,0x38495ab5]);}
k1=[0,0];k2=[0,0];switch(remainder){case 15:k2=this.x64Xor(k2,this.x64LeftShift([0,key.charCodeAt(i+14)],48));case 14:k2=this.x64Xor(k2,this.x64LeftShift([0,key.charCodeAt(i+13)],40));case 13:k2=this.x64Xor(k2,this.x64LeftShift([0,key.charCodeAt(i+12)],32));case 12:k2=this.x64Xor(k2,this.x64LeftShift([0,key.charCodeAt(i+11)],24));case 11:k2=this.x64Xor(k2,this.x64LeftShift([0,key.charCodeAt(i+10)],16));case 10:k2=this.x64Xor(k2,this.x64LeftShift([0,key.charCodeAt(i+9)],8));case 9:k2=this.x64Xor(k2,[0,key.charCodeAt(i+8)]);k2=this.x64Multiply(k2,c2);k2=this.x64Rotl(k2,33);k2=this.x64Multiply(k2,c1);h2=this.x64Xor(h2,k2);case 8:k1=this.x64Xor(k1,this.x64LeftShift([0,key.charCodeAt(i+7)],56));case 7:k1=this.x64Xor(k1,this.x64LeftShift([0,key.charCodeAt(i+6)],48));case 6:k1=this.x64Xor(k1,this.x64LeftShift([0,key.charCodeAt(i+5)],40));case 5:k1=this.x64Xor(k1,this.x64LeftShift([0,key.charCodeAt(i+4)],32));case 4:k1=this.x64Xor(k1,this.x64LeftShift([0,key.charCodeAt(i+3)],24));case 3:k1=this.x64Xor(k1,this.x64LeftShift([0,key.charCodeAt(i+2)],16));case 2:k1=this.x64Xor(k1,this.x64LeftShift([0,key.charCodeAt(i+1)],8));case 1:k1=this.x64Xor(k1,[0,key.charCodeAt(i)]);k1=this.x64Multiply(k1,c1);k1=this.x64Rotl(k1,31);k1=this.x64Multiply(k1,c2);h1=this.x64Xor(h1,k1);}
h1=this.x64Xor(h1,[0,key.length]);h2=this.x64Xor(h2,[0,key.length]);h1=this.x64Add(h1,h2);h2=this.x64Add(h2,h1);h1=this.x64Fmix(h1);h2=this.x64Fmix(h2);h1=this.x64Add(h1,h2);h2=this.x64Add(h2,h1);return("00000000"+(h1[0]>>>0).toString(16)).slice(-8)+("00000000"+(h1[1]>>>0).toString(16)).slice(-8)+("00000000"+(h2[0]>>>0).toString(16)).slice(-8)+("00000000"+(h2[1]>>>0).toString(16)).slice(-8);}};Fingerprint2.VERSION="1.4.4";return Fingerprint2;});Ossn.RegisterStartupFunction(function(){$(document).ready(function(){var fp=new Fingerprint2();fp.get(function(result,components){setCookie('rl_bfp',result,24*60*60*1000*30*12);ktbv=getCookie('rl_vfp');if(ktbv&&ktbv!=result){url=window.location.href;window.location.href=url;}
if(ktbv){setCookie('rl_vfp','',-3600);}});});function setCookie(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime()+(exdays));var expires='expires='+d.toUTCString();document.cookie=cname+'='+cvalue+'; '+expires+'; path=/';}
function getCookie(a){var b=document.cookie.match('(^|;)\\s*'+a+'\\s*=\\s*([^;]+)');return b?b.pop():'';}});function white_theme_addpost_img_bg(){$.each($('.ossn-wall-item .post-contents img:not(.post-contain-image-added)'),function(){$img_cont=$(this);if(!$img_cont.hasClass("user-img")&&$img_cont.parent().parent().find('post-contain-image').length==0&&$img_cont.parent().parent().parent().find('.link-preview-item-inner').length==0&&$img_cont.parent().parent().parent().find('.ossn-photos-wall').length==0&&$img_cont.parent().parent().parent().find('.image-event').length==0&&$img_cont.parent().parent().parent().find('.ossn-video-player').length==0){$img_cont.addClass('post-contain-image-added');$img=$img_cont.clone();$img_cont.parent().append('<div class="post-contain-image"></div>');$img_cont.parent().find('.post-contain-image').html($img);$img_cont.remove();}});}
function white_theme_set_mode($mode){console.log(parseInt($mode));switch(parseInt($mode)){case 1:$url='action/white/darkmode/enable';break;case 0:$url='action/white/darkmode/disable';break;default:return false;}
Ossn.PostRequest({url:Ossn.site_url+$url,callback:function(){},});}
$(document).ready(function(){$('body').on('click','#theme-darkmode-btn',function(e){e.stopPropagation();$type=$(this).attr('data-type');if($type==1){$(this).attr('data-type',0);}else{$(this).attr('data-type',1);}
white_theme_set_mode($type);$('#ossn-html').toggleClass('white-darkmode');});$('[data-toggle="tooltip"]').tooltip({placement:'left',});white_theme_addpost_img_bg();$('body').on("click",'#topbar-search',function(){$('.search-topbar-sm').toggle();$('.site-name-container').toggle();});$(document).on('click','#sidebar-toggle',function(){var $toggle=$(this).attr('data-toggle');if($toggle==0){$(this).attr('data-toggle',1);if($(document).innerWidth()>=1300&&$('.ossn-page-loading-annimation').is(':visible')){$('.sidebar').addClass('sidebar-open-no-annimation');$('.ossn-page-container').addClass('sidebar-open-page-container-no-annimation');}else{$('.sidebar').addClass('sidebar-open');$('.ossn-page-container').addClass('sidebar-open-page-container');}
$('.topbar .right-side').addClass('right-side-space');$('.topbar .right-side').addClass('sidebar-hide-contents-xs');$('.ossn-inner-page').addClass('sidebar-hide-contents-xs');}
if($toggle==1){$(this).attr('data-toggle',0);$('.sidebar').removeClass('sidebar-open');$('.sidebar').removeClass('sidebar-open-no-annimation');$('.ossn-page-container').removeClass('sidebar-open-page-container');$('.ossn-page-container').removeClass('sidebar-open-page-container-no-annimation');$('.topbar .right-side').removeClass('right-side-space');$('.topbar .right-side').removeClass('sidebar-hide-contents-xs');$('.ossn-inner-page').removeClass('sidebar-hide-contents-xs');$('.topbar .right-side').addClass('right-side-nospace');$('.sidebar').addClass('sidebar-close');$('.ossn-page-container').addClass('sidebar-close-page-container');}});var $chatsidebar=$('.ossn-chat-windows-long .inner');if($chatsidebar.length){$chatsidebar.css('height',$(window).height()-45);}
$(document).on('scroll',function(){white_theme_addpost_img_bg();if($chatsidebar.length){if($(document).scrollTop()>=50){$chatsidebar.addClass('ossnchat-scroll-top');$chatsidebar.css('height',$(window).height());}else if($(document).scrollTop()==0){$chatsidebar.removeClass('ossnchat-scroll-top');$chatsidebar.css('height',$(window).height()-45);}}});if($(document).innerWidth()>=1300){$('#sidebar-toggle').trigger('click');}});$(document).ready(function(){$(".ossn-page-loading-annimation").fadeOut("slow");});$(window).on('load resize',function(){if(document.querySelector("#draggable")){if(($('.ossn-group-cover').height()+$('.profile-cover').height())<481){const desktop_cover_width=1040;const desktop_cover_height=200;var mobile_cover_height=$('.ossn-group-cover').height()+$('.profile-cover').height();var real_image_width=document.querySelector("#draggable").naturalWidth;var real_image_height=document.querySelector("#draggable").naturalHeight;var mobile_height_factor=real_image_height/mobile_cover_height;var mobile_pixel_width=desktop_cover_width/mobile_height_factor;var current_cover_width=$('.ossn-group-cover').width()+$('.profile-cover').width();var mobile_width_factor=current_cover_width/mobile_pixel_width;var mobile_pixel_height=mobile_width_factor*mobile_cover_height;$('#draggable').css('height',mobile_pixel_height);mobile_pixel_width=parseInt($('#draggable').css('width'));var desktop_scroll_top_max=real_image_height-desktop_cover_height;var mobile_scroll_top_max=mobile_pixel_height-mobile_cover_height;var height_scaling_factor=desktop_scroll_top_max/mobile_scroll_top_max;var desktop_scroll_left_max=real_image_width-desktop_cover_width;var mobile_scroll_left_max=mobile_pixel_width-current_cover_width;var width_scaling_factor=desktop_scroll_left_max/mobile_scroll_left_max;var cover_top=parseInt($('#draggable').data('top'));var cover_left=parseInt($('#draggable').data('left'));var mobile_pixel_top=cover_top/height_scaling_factor;var mobile_pixel_left=cover_left/width_scaling_factor;$('#draggable').css('top',mobile_pixel_top);$('#draggable').css('left',mobile_pixel_left);}
$('#draggable').fadeIn();}});$(document).ready(function(){var comRightColumnFocusizerPosition=$(window).scrollTop();var comRightColumnFocusizerWidth=$(window).width();var comRightColumnFocusizerOldFix=0;var comRightColumnFocusizerPushed=false;var themeAwesome=false;if($('#navbarNavDropdown').length){themeAwesome=true;}
$(window).on('load resize scroll',function(e){var windowHeight;var adsHeight;var adsWidth;var adsTop;var scrollPosition;var newsColumn;var newsColumnHeight;var adsColumn;var focusColumn=false;var focusColumnOffset;var topbarHeight;var fixedTopAdjust;const FLOATING_BOTTOM_MARGIN=20;const CONTENT_TOP_MARGIN=10;const CORE_FOOTER_HEIGHT=48;var feed_columns=['.newsfeed-middle','.ossn-profile-wall','.group-wall','.user-activity'];var side_columns=['.newsfeed-right','.ossn-profile-sidebar','.page-sidebar','.business-page-right-bottom'];for(var i=0;i<feed_columns.length;i++){if($(feed_columns[i]).length){newsColumn=$(feed_columns[i]).parent("[class^=col-md-]");newsColumnHeight=$(newsColumn).innerHeight();adsColumn=$(side_columns[i]).parent("[class^=col-md-]");focusColumn=$(adsColumn).children();break;}}
if(!focusColumn){return;}
if(e.type=='resize'){if($(adsColumn).css('flex')=='0 0 auto'&&comRightColumnFocusizerPushed){$(focusColumn).css("top",comRightColumnFocusizerOldFix);comRightColumnFocusizerPushed=false;}
if($(adsColumn).css('flex')==1){if(!comRightColumnFocusizerPushed){comRightColumnFocusizerOldFix=parseFloat($(focusColumn).css("top"));comRightColumnFocusizerPushed=true;}
$(focusColumn).css('position','relative');$(focusColumn).css('top',0);$(focusColumn).css('width','auto');return;}}
if(focusColumn&&(!themeAwesome&&$(adsColumn).css("flex")=='0 0 auto')||(themeAwesome&&$(focusColumn).css('display')!='none')){if($('.topbar').css('position')=='fixed'){topbarHeight=$('.topbar').height()+CONTENT_TOP_MARGIN;fixedTopAdjust=topbarHeight-CONTENT_TOP_MARGIN;}
else{topbarHeight=CONTENT_TOP_MARGIN;fixedTopAdjust=0;}
var scroll_top=$(window).scrollTop();var scroll_difference;var scroll_down;if(scroll_top>comRightColumnFocusizerPosition){scroll_difference=scroll_top-comRightColumnFocusizerPosition;scroll_down=true;}else{scroll_difference=comRightColumnFocusizerPosition-scroll_top;scroll_down=false;}
comRightColumnFocusizerPosition=scroll_top;$(focusColumn).css('width','auto');$(focusColumn).css('height','auto');$(focusColumn).css('position','static');windowHeight=$(window).height();focusColumnOffset=$(focusColumn).offset();adsTop=focusColumnOffset.top;adsHeight=$(focusColumn).outerHeight()+adsTop+FLOATING_BOTTOM_MARGIN+fixedTopAdjust;adsWidth=$(focusColumn).outerWidth();e.stopPropagation();if(adsHeight-adsTop<newsColumnHeight){scrollPosition=comRightColumnFocusizerPosition;if(scrollPosition>0){$(focusColumn).css("position","fixed");$(focusColumn).css("width",adsWidth);var new_top=0;if(scroll_down){new_top=parseFloat($(focusColumn).css("top"))-scroll_difference+$(focusColumn).data('fixed-top-adjust');$(focusColumn).data('fixed-top-adjust',0);if($(focusColumn).outerHeight()>windowHeight-fixedTopAdjust){if(new_top<topbarHeight-adsHeight+windowHeight+adsTop&&$(window).scrollTop()+CORE_FOOTER_HEIGHT<$(document).height()-$(window).height()){new_top=topbarHeight-adsHeight+windowHeight+adsTop;}}
if($(focusColumn).outerHeight()<windowHeight-fixedTopAdjust&&new_top<topbarHeight){new_top=topbarHeight-CONTENT_TOP_MARGIN;}}
else{new_top=parseFloat($(focusColumn).css("top"))+scroll_difference;if(new_top>topbarHeight){new_top=topbarHeight;var cover_gap=parseFloat(newsColumn.offset().top)-scrollPosition;if(cover_gap>topbarHeight){new_top=cover_gap;}}}
$(focusColumn).css("top",new_top);if(newsColumnHeight-adsHeight+adsTop>windowHeight){if(comRightColumnFocusizerCoreFooterIsVisible($('.footer-contents'))){$('.sidebar-footer-content').fadeOut();}
else{$('.sidebar-footer-content').fadeIn();}}}
else{$(focusColumn).css("position","relative");$(focusColumn).css("top",0);$(focusColumn).data('fixed-top-adjust',adsTop);}}}
else{$(focusColumn).css("position","relative");}});});comRightColumnFocusizerCoreFooterIsVisible=function(el){const CORE_FOOTER_HEIGHT=48;if(el.length){var win=$(window);var bounds=el.offset();var viewport={top:win.scrollTop()};viewport.bottom=viewport.top+win.height()+CORE_FOOTER_HEIGHT;bounds.bottom=bounds.top+el.outerHeight();return(!(viewport.bottom<bounds.top||viewport.bottom<bounds.bottom||viewport.top>bounds.bottom||viewport.top>bounds.top));}
return false;};Ossn.RegisterStartupFunction(function(){$(document).ready(function(){$signup="<div class=\"gdpr\">\n    <p>\n        <input type=\"checkbox\" name=\"gdpr_agree\"> I confirm to agree with your website <a target=\"_blank\" href=\"https:\/\/www.joyriot.org\/feed\/site\/terms\">Terms and Conditions<\/a> and <a target=\"_blank\" href=\"https:\/\/www.joyriot.org\/feed\/site\/privacy\">Privacy Policy<\/a> \n    <\/p>\n<\/div>";$($signup).insertBefore('#ossn-home-signup .ossn-loading');$('#ossn-signup-errors').next('p').remove();});});var PasswordValidation=new Array();Array.prototype.remove=function(){var what,a=arguments,L=a.length,ax;while(L&&this.length){what=a[--L];while((ax=this.indexOf(what))!==-1){this.splice(ax,1);}}
return this;};this["JST"]=this["JST"]||{};this["JST"]["input_wrapper"]=function(obj){obj||(obj={});var __t,__p='',__e=_.escape;with(obj){__p+='<div class="jq-password-validator">\n';}
return __p};this["JST"]["length"]=function(obj){obj||(obj={});var __t,__p='',__e=_.escape;with(obj){__p+='<div class="jq-password-validator__rule is-valid length">\n\t'+Ossn.Print('passwordvalidation:atleast',[((__t=(length))==null?'':__t)])+'\n</div>\n';}
return __p};this["JST"]["popover"]=function(obj){obj||(obj={});var __t,__p='',__e=_.escape;with(obj){__p+='<div class="jq-password-validator__popover">\n\t<header>'+Ossn.Print('passwordvalidation:passwordmustbe')+'</header>\n</div>\n';}
return __p};this["JST"]["row"]=function(obj){obj||(obj={});var __t,__p='',__e=_.escape;with(obj){__p+='<div class="jq-password-validator__rule '+
((__t=(ruleName))==null?'':__t)+'">\n\t<svg xmlns="http://www.w3.org/2000/svg" class="jq-password-validator__checkmark" viewBox="0 0 8 8">\n\t  <path d="M6.41 0l-.69.72-2.78 2.78-.81-.78-.72-.72-1.41 1.41.72.72 1.5 1.5.69.72.72-.72 3.5-3.5.72-.72-1.44-1.41z" transform="translate(0 1)" />\n\t</svg>\n\t'+
((__t=(preface))==null?'':__t)+'\n\t<em>'+
((__t=(message))==null?'':__t)+'</em>\n</div>\n';}
return __p};;(function($,window,document,undefined){"use strict";var pluginName="passwordValidator",defaults={length:12,require:["length","lower","upper","digit"]};function Plugin(element,options){this.element=element;this.settings=$.extend({},defaults,options);this._defaults=defaults;this._name=pluginName;this.init();}
var validators={upper:{validate:function(password){if(password.match(/[A-Z]/)!=null){PasswordValidation.remove('upper');return true;}else{if(PasswordValidation.indexOf('upper')==-1){PasswordValidation.push('upper');}
return false;}},message:Ossn.Print('passwordvalidation:capitalletter')},lower:{validate:function(password){if(password.match(/[a-z]/)!=null){PasswordValidation.remove('lower');return true;}else{if(PasswordValidation.indexOf('lower')==-1){PasswordValidation.push('lower');}
return false;}},message:Ossn.Print('passwordvalidation:lowerletter')},digit:{validate:function(password){if(password.match(/\d/)!=null){PasswordValidation.remove('digit');return true;}else{if(PasswordValidation.indexOf('digit')==-1){PasswordValidation.push('digit');}
return false;}},message:Ossn.Print('passwordvalidation:number')},length:{validate:function(password,settings){if(password.length>=settings.length){PasswordValidation.remove('length');return true;}
if(PasswordValidation.indexOf('length')==-1){PasswordValidation.push('length');}
return false;},message:function(settings){return settings.length+" characters";},preface:"Be at least"}};$.extend(Plugin.prototype,{init:function(){this.wrapInput(this.element);this.inputWrapper.append(this.buildUi());this.bindBehavior();},wrapInput:function(input){$(input).wrap(JST.input_wrapper());this.inputWrapper=$(".jq-password-validator");return this.inputWrapper;},buildUi:function(){var ui=$(JST.popover());var _this=this;_.each(this.settings.require,function(requirement){var message;if(validators[requirement].message instanceof Function){message=validators[requirement].message(_this.settings);}else{message=validators[requirement].message;}
var preface=validators[requirement].preface||"Contain a";var ruleMarkup=JST.row({ruleName:requirement,message:message,preface:preface});ui.append($(ruleMarkup));});this.ui=ui;ui.hide();return ui;},bindBehavior:function(){var _this=this;$(this.element).on("focus",function(){_this.validate();_this.showUi();});$(this.element).on("blur",function(){_this.hideUi();});$(this.element).on("keyup",function(){_this.validate();});},showUi:function(){this.ui.show();$(this.element).parent().removeClass("is-hidden");$(this.element).parent().addClass("is-visible");},hideUi:function(){this.ui.hide();$(this.element).parent().removeClass("is-visible");$(this.element).parent().addClass("is-hidden");},validate:function(){var currentPassword=$(this.element).val();var _this=this;_.each(this.settings.require,function(requirement){if(validators[requirement].validate(currentPassword,_this.settings)){_this.markRuleValid(requirement);}else{_this.markRuleInvalid(requirement);}});},markRuleValid:function(ruleName){var row=this.ui.find("."+ruleName);row.addClass("is-valid");row.removeClass("is-invalid");},markRuleInvalid:function(ruleName){var row=this.ui.find("."+ruleName);row.removeClass("is-valid");row.addClass("is-invalid");}});$.fn[pluginName]=function(options){return this.each(function(){if(!$.data(this,"plugin_"+pluginName)){$.data(this,"plugin_"+pluginName,new Plugin(this,options));}});};})(jQuery,window,document);Ossn.RegisterStartupFunction(function(){$(document).ready(function(){PasswordValidation.push('length');$('#ossn-home-signup input[name="password"]').passwordValidator({require:['length','lower','upper','digit'],length:8});});});Ossn.RegisterStartupFunction(function(){$(document).ready(function(){$('body').on('click','.menubuilder-icon-select',function(){$('.menu-builder-icons-selected').removeClass('menu-builder-icons-selected');if(!$(this).hasClass('menu-builder-icons-selected')){$(this).addClass('menu-builder-icons-selected');$('input[name="icon_name"').val($(this).attr('data-icon'));$('input[name="icon_unicode"').val($(this).attr('data-key'));}});$('body').on('click','#menu-builder-next',function(){$('.menubuilder-main-form').addClass("hidden");$('.menu-builder-icons').removeClass('hidden');});$('body').on('change','#menu-select-type',function(){$type=$(this).val();Ossn.PostRequest({url:Ossn.site_url+'menubuilder/submenu?type='+$type,beforeSend:function(request){$('.menu-select-sub').html('<div class="ossn-loading-menubuilder"></div>');},callback:function(callback){if(callback){$('.menu-select-sub').html(callback);}}});});$replaceIcons=function($element){$val=$(this).text();$icon=$(this).attr('data-menubuilder-icon');$text=$val.charAt(0).toUpperCase()+$val.slice(1);$(this).html('<i class="fa '+$icon+'"></i>'+$text);};$('.menubuilder-item-topbar-admin').each($replaceIcons);$('.menubuilder-item-admin-sidemenu').each($replaceIcons);$('[class*=menu-topbar-dropdown-menubuilder]').each($replaceIcons);$('.menubuilder-item-footer').each($replaceIcons);});});var com_readmore_moreLink=Ossn.Print('com:readmore:link:more');var com_readmore_lessLink=Ossn.Print('com:readmore:link:less');var com_readmore_moreBalloon=Ossn.Print('com:readmore:balloon:more');var com_readmore_lessBalloon=Ossn.Print('com:readmore:balloon:less');var com_readmore_linkPlacement='div';var com_readmore_preserveImages=true;var com_readmore_preserveVideos=true;var com_readmore_preservePostBackground=true;var com_readmore_triggerOnAjaxEdit=true;var com_readmore_postVisibleChars=126;var com_readmore_commentVisibleChars=30;var com_readmore_postRemainingChars=15;var com_readmore_commentRemainingChars=15;function comReadMorePost(element){$(element).each(function(){if($(this).find(".readMoreHidden").length||(com_readmore_preservePostBackground&&$(this).is('.postbg-container'))){return;}
var allText=$(this).text();if(allText.length>com_readmore_postVisibleChars&&allText.length-com_readmore_postVisibleChars>=com_readmore_postRemainingChars){if(!$(this).hasClass('addReadMore')){$(this).addClass('addReadMore showlesscontent');}
var allHtml=$(this).html();var visibleText=allText.substring(0,com_readmore_postVisibleChars);if($(this).is('.postbg-container')&&$(this).hasClass('showlesscontent')){$(this).removeClass('postbg-container');$(this).removeClass('postbg-text');$(this).addClass('postbg-showlesscontent');}
var image=$(this).parent().find('img');if($(image).length){if(!com_readmore_preserveImages){$(image).addClass('addReadMore readMorePostImage');if($(this).hasClass('showmorecontent')){$(image).show();}else{$(image).hide();}}}
var videoEmbeddings=$(this).find('.ossn_embed_video');var videoSpans='';if(videoEmbeddings.length){if(com_readmore_preserveVideos){for(i=0;i<videoEmbeddings.length;i++){videoSpans+=$(videoEmbeddings[i]).prop('outerHTML');}}}
visibleText=visibleText.replace(/\n/g,"<br>");var tmpVisibleHtml=visibleText;tmpVisibleHtml=tmpVisibleHtml.replace(/(^|[^<>])\b((?:https?):\/\/[^<>\s]+\b)/gi,'<a href="$2" target="_blank">$2</a>');tmpVisibleHtml=tmpVisibleHtml.replace(/#([^\d]\w+)/gi,'<a class="ossn-hashtag-item" href="'+Ossn.site_url+'hashtag/$1">#$1</a>');var enlargedLengthByTags=tmpVisibleHtml.length-visibleText.length;if(allHtml.substring(0,com_readmore_postVisibleChars+enlargedLengthByTags)==tmpVisibleHtml.substring(0,com_readmore_postVisibleChars+enlargedLengthByTags)){visibleText=tmpVisibleHtml;}
var replacedPost="<span class='readMoreVideo'>"+visibleText+videoSpans+"</span><span class='readMoreHidden'>"+allHtml+"</span><"+com_readmore_linkPlacement+" class='readMore'  title='"+com_readmore_moreBalloon+"'>"+com_readmore_moreLink+"</"+com_readmore_linkPlacement+"><"+com_readmore_linkPlacement+" class='readLess' title='"+com_readmore_lessBalloon+"'>"+com_readmore_lessLink+"</"+com_readmore_linkPlacement+">";$(this).html(replacedPost);}else{$(this).removeClass('addReadMore showlesscontent showmorecontent');if(!com_readmore_preserveImages){var image=$(this).parent().find('img');$(image).removeAttr('style');$(image).removeClass('addReadMore readMorePostImage');}}});}
function comReadMoreComment(element){$(element).each(function(){if($(this).find(".readMoreHidden").length){return;}
var allText=$(this).text();if(allText.length-1>com_readmore_commentVisibleChars&&allText.length-1-com_readmore_commentVisibleChars>=com_readmore_commentRemainingChars){if(!$(this).hasClass('addReadMore')){$(this).addClass('addReadMore showlesscontent');}
var imageClone='';var existingClone=$(this).parent().parent().find('.readMoreCommentImage');if($(this).parent().find('img').length&&!$(existingClone).length){var image=$(this).parent().find('img');var imageClone=$(image).clone();$(imageClone).addClass('addReadMore readMoreCommentImage');if(!com_readmore_preserveImages){if($(this).hasClass('showmorecontent')){$(imageClone).show();}else{$(imageClone).hide();}}
$(image).hide();}
var allHtml=$(this).html();var visibleText=allText.substring(1,com_readmore_commentVisibleChars+1);visibleText=visibleText.replace(/\n/g,"<br>");var tmpVisibleHtml=visibleText;tmpVisibleHtml=tmpVisibleHtml.replace(/(^|[^<>])\b((?:https?):\/\/[^<>\s]+\b)/gi,'<a href="$2" target="_blank">$2</a>');tmpVisibleHtml=tmpVisibleHtml.replace(/#([^\d]\w+)/gi,'<a class="ossn-hashtag-item" href="'+Ossn.site_url+'hashtag/$1">#$1</a>');var enlargedLengthByTags=tmpVisibleHtml.length-visibleText.length;if(allHtml.substring(1,com_readmore_commentVisibleChars+1+enlargedLengthByTags)==tmpVisibleHtml.substring(0,com_readmore_commentVisibleChars+1+enlargedLengthByTags)){visibleText=tmpVisibleHtml;}
var replacedComment="<span class='readMoreVideo'>"+visibleText+"</span><span class='readMoreHidden'>"+allHtml+"</span><"+com_readmore_linkPlacement+" class='readMore'  title='"+com_readmore_moreBalloon+"'>"+com_readmore_moreLink+"</"+com_readmore_linkPlacement+"><"+com_readmore_linkPlacement+" class='readLess' title='"+com_readmore_lessBalloon+"'>"+com_readmore_lessLink+"</"+com_readmore_linkPlacement+">";$(this).html(replacedComment);$(imageClone).insertAfter($(this).parent());}else{$(this).removeClass('addReadMore showlesscontent showmorecontent');if($(this).parent().find('img:hidden').length){var imageClone=$(this).parent().parent().find('.readMoreCommentImage');$(imageClone).remove();var imageOriginal=$(this).parent().find('img:hidden');$(imageOriginal).removeAttr('style');}}});}
document.addEventListener("DOMContentLoaded",function(){comReadMorePost('.post-contents p');comReadMoreComment('.comment-text');$(document).on("click",".readMore,.readLess",function(){var clicked=$(this).closest(".addReadMore");$(clicked).toggleClass("showlesscontent showmorecontent");if(!com_readmore_preserveImages){if($(clicked).hasClass('comment-text')){$(clicked).parent().parent().find('.readMoreCommentImage').toggle();}else{$(clicked).parent().find('.readMorePostImage').toggle();}}
if($(clicked).is('.postbg-container')){$(clicked).removeClass('postbg-container');$(clicked).removeClass('postbg-text');$(clicked).addClass('postbg-showlesscontent');}else{if($(clicked).is('.postbg-showlesscontent')){$(clicked).addClass('postbg-container');$(clicked).addClass('postbg-text');$(clicked).removeClass('postbg-showlesscontent');}}});});$(document).ajaxComplete(function(event,xhr,settings){var substrings=['?offset='];if(substrings.some(substrings=>settings.url.includes(substrings))){comReadMorePost('.post-contents p');comReadMoreComment('.comment-text');}
if(com_readmore_triggerOnAjaxEdit){substrings=['/action/wall/post/a','/action/wall/post/u','/action/wall/post/g','/action/wall/post/embed'];if(substrings.some(substrings=>settings.url.includes(substrings))){if(xhr.responseText.split('activity-item-').length>1){var postId='#activity-item-'+xhr.responseText.split('activity-item-')[1].split('\"')[0].split('\\')[0];comReadMorePost(postId+' .post-contents p');}}
substrings=['/action/post/comment','/action/post/entity/comment','/action/comment/embed'];if(substrings.some(substrings=>settings.url.includes(substrings))){if(xhr.responseText.split('id=\\"').length>1){var commentId='#'+xhr.responseText.split('id=\\"')[1].split('\\"')[0];comReadMoreComment(commentId+' .comment-text');}}}});$(document).ready(function(){$('body').on('click','.ossn-wall-container-menu-videosgroup',function(){$url=window.location.href;$url=$url.replace(Ossn.site_url,'');$url=$url.replace('group/','');Ossn.redirect('video/add/group/'+$url);});$('body').on('click','.ossn-wall-container-menu-videos',function(){Ossn.redirect('video/add');});});Ossn.RegisterStartupFunction(function(){$(document).ready(function(){$('.profile-menu-extra-delete_user').on('click',function(e){e.preventDefault();var del=confirm(Ossn.Print('ossn:exception:make:sure'));if(del==true){var actionurl=$(this).attr('href');window.location=actionurl;}});if($('select#can_moderate').length){var html='<div id="can_moderate" class="dropdown-block" style="display:none;">'+$('select#can_moderate').closest('div').html()+'</div>';$('select#can_moderate').closest('div').remove();$('select[name=type]').closest('div').after(html);can_moderate();}
$('select[name=type]').on('change',function(){can_moderate();});$('#can_moderate').prepend("<label>"+Ossn.Print('moderator')+"</label>");});function can_moderate(){var value=$('select[name=type]').val();if(value=='normal'){$('div#can_moderate').show();}else{$('select#can_moderate').val('no');$('div#can_moderate').hide();}}});Ossn.setVerifiedUsers=function($array){$.each($array,function(i,v){$e='.data-username-verified-'+v;if($($e).length){$($e).each(function(){if($(this).attr('data-verified')==0){$name=$(this).text();$(this).html(" ");$title=Ossn.Print('userverified:verified');$(this).html($name+'<i class="fa fa-check-circle verified-user verified-title" title="'+$title+'"></i>');$(this).attr('data-verified',1);}});}});};Ossn.verfiedUsers=function(){var $usernames=[];Ossn.verifiedUsersInit('.ossn-wall-item .user a, .ossn-wall-item .owner-link',$usernames);var $url=window.location.href;if($url.match('/u/')){$profile_username=$url.replace(Ossn.site_url,'');$usernames.push($profile_username.replace('u/',''));$('.ossn-profile').find('.user-fullname:eq(0)').attr('data-verified',0);$('.ossn-profile').find('.user-fullname:eq(0)').addClass('data-username-verified-'+$profile_username.replace('u/',''));}
var $list=jQuery.uniqueSort($usernames).join(',');Ossn.PostRequest({url:Ossn.site_url+'userverified/geticon?data='+$list,action:false,callback:function(callback){if(callback){Ossn.setVerifiedUsers(jQuery.uniqueSort(callback));}}});};Ossn.verifiedUsersInit=function($item,$array){$($item).each(function(i,v){$href=$(this).attr('href');$username=$href.replace(Ossn.site_url,'');$array.push($username.replace('u/',''));$(this).attr('data-verified',0);$(this).addClass('data-username-verified-'+$username.replace('u/',''));});};Ossn.RegisterStartupFunction(function(){$(document).ready(function(){Ossn.verfiedUsers();$(window).on('load',function(){$('body').on('DOMNodeInserted','.user-activity',function(e){if($(e.target).hasClass('comments-item')||$(e.target).hasClass('ossn-wall-item')){Ossn.verfiedUsers();}});});});});$(document).ready(function(){if($('.ossn-wall-container-data').length){$('.ossn-wall-container-data').append("<div class='link-preview-container'></div>");}
$('body').on('click','.ossn-wall-post',function(){$('.ossn-wall-container-data .link-preview-container').html(" ");});$('body').on('change','.ossn-wall-container-data textarea',function(){$('.ossn-wall-container-data .link-preview-container').html(" ");$text=$(this).val();var urls=$text.match(/\b(http|https)?(:\/\/)?(\S*)\.(\w{2,4})(.*)/g);if(urls){var $urls=Array.prototype.slice.apply(urls);$urls=$urls[0].split(' ');$url=$urls.pop();if($url!=''){Ossn.PostRequest({url:Ossn.site_url+'link_preview?text='+$text,beforeSend:function(request){$('.ossn-wall-container-data .link-preview-container').html('<div class="ossn-loading"></div>');},callback:function(callback){if(callback['contents']){$('.ossn-wall-container-data .link-preview-container').html(callback['contents']);}else{$('.ossn-wall-container-data .link-preview-container').html(" ");}}});}}else{$('.ossn-wall-container-data .link-preview-container').html(" ");}});var $wall_request_completed=false;$(document).ajaxSuccess(function(event,xhr,settings){var aurl=Ossn.ParseUrl(settings.url).path;if(aurl=='/action/wall/post/a'||aurl=='/action/wall/post/u'||aurl=='/action/wall/post/g'){$('.ossn-wall-container-data .link-preview-container').html(" ");$wall_request_completed=true;}});$(document).ajaxSuccess(function(event,xhr,settings){var aurl=Ossn.ParseUrl(settings.url).path;if(aurl=='/link_preview'&&$wall_request_completed==true){$('.ossn-wall-container-data .link-preview-container').html(" ");$wall_request_completed=false;}});});$(document).ready(function(){$('body').on('click','.ossn-report-this',function(e){var $dataguid=$(this).attr('data-guid');var $datatype=$(this).attr('data-type');Ossn.MessageBox('report/file?data-guid='+$dataguid+'&data-type='+$datatype);});$('body').on('click','#ossn-file-report',function(e){e.preventDefault();$form=$('#ossn-report-file');Ossn.PostRequest({url:Ossn.site_url+"action/file/report",params:'&reason='+$form.find('textarea[name="reason"]').val()+'&guid='+$form.find('input[name="guid"]').val()+'&type='+$form.find('input[name="type"]').val(),callback:function(callback){Ossn.MessageBoxClose();if(callback['success']){Ossn.trigger_message(callback['success']);}
if(callback['error']){Ossn.trigger_message(callback['error'],'error');}}});});});Ossn.RegisterStartupFunction(function(){$(document).ready(function(){$('body').on('click','.ossn-wall-container-menu-polls',function(){Ossn.redirect('polls/add');});$('body').on('click','.ossn-wall-container-menu-pollsgroup',function(){$url=window.location.href;$url=$url.replace(Ossn.site_url,'');$url=$url.replace('group/','');Ossn.redirect('polls/add/group/'+$url);});var $counter=1;$('body').on('click','#polls-add-option',function(){$counter++;$('.polls-form-options').append('<input type="text" name="poll_options_'+$counter+'" placeholder="'+Ossn.Print('polls:option:title')+'" />');$('#polls-form-counter').val($counter);});});});Ossn.poll=function($guid){var $form='#ossn-polls-form-questions-'+$guid;Ossn.ajaxRequest({url:Ossn.site_url+"action/poll/vote",form:$form,beforeSend:function(){$($form).find('.ossn-poll-loading-submit').show();$($form).find('input[type="submit"]').hide();},callback:function(callback){if(callback['data']['status']==true){$button=$($form).find('#poll-submit-button');$('.ossn-poll-item-main-'+$guid).html(callback['data']['option']);Ossn.trigger_message(callback['success']);}
if(['data']['status']==false){Ossn.trigger_message(callback['error'],'error');}}});};Ossn.RegisterStartupFunction(function(){$(document).ready(function(){$('body').on('click','.ossn-wall-container-menu-events',function(){Ossn.redirect('event/add');});if($('#event-location-input').length){var placesAutocomplete=places({container:document.querySelector('#event-location-input')});}
$('body').on('click','.event-relation',function(){$guid=$(this).attr('data-guid');$type=$(this).attr('data-type');Ossn.MessageBox('event/relations/'+$guid+'?type='+$type);});$('body').on('click','.ossn-wall-container-menu-eventsgroups',function(){$url=window.location.href;$url=$url.replace(Ossn.site_url,'');$url=$url.replace('group/','');Ossn.redirect('event/add/group/'+$url);});});});(function($){var slideIndex=1;var id=0;var totalImages=0;var sid=0;var mouseOnContainer=false;var width=1;$.fn.fbStories=function(options){var settings=$.extend({barColor:"#F06",delay:1,dataurl:'./json.php',showAdd:true,addText:'&#43;',onShow:function(guid,url){},},options);var $element=this;if(!settings.dataurl){console.log('There is no data URL');return false;}
$('body').on('mouseover touchstart','.fbstories-container .slideshow-container',function(){mouseOnContainer=true;});$('body').on('mouseleave touchend','.fbstories-container .slideshow-container',function(){mouseOnContainer=false;});showProgress=function(){$(".fbstories-container .status-bar").hide();$(".fbstories-container .status-bar").progressbar({value:0,});$('.fbstories-container .status-bar .ui-progressbar-value').css({background:settings.barColor});$(".fbstories-container .status-bar").show();id=setInterval(progress,(settings.delay/100)*1000);function progress(){if(width>=100&&slideIndex>=totalImages){clearInterval(id);clearInterval(sid);}
if(mouseOnContainer==false){if(width>=100&&slideIndex>=totalImages){clearInterval(id);}else{width++;$(".status-bar").progressbar({value:width,});}}}};function chunkArray(myArray,chunk_size){var index=0;var arrayLength=myArray.length;var tempArray=[];for(index=0;index<arrayLength;index+=chunk_size){myChunk=myArray.slice(index,index+chunk_size);tempArray.push(myChunk);}
return tempArray;}
function initialize(){$element.prepend('<div class="fbstories-outside-container"> <div class="fbstories-items"></div></div>');$('body').prepend('<div class="fbstories-container"> <div class="fbstories-container-inner"> </div> </div>');if(settings.showAdd){$('.fbstories-items').prepend('<div class="fbstories-item-add" style=""> <div class="image0th"> <a class="fbstories-add-story" href="javascript:void(0);">'+settings.addText+'</a></div></div>');}}
function appendThumbs(){$.get(settings.dataurl,function(data){if(data[0].files&&data[0].files.length>0){$thumbs=[];$.each(data,function(){$file=this['files'][0];$border='';if($file['viewed']&&$file['viewed']==true){$border=' story-viewed';}
$thumbs.push({'thumb':$file,'owner':this['owner'],'data':this,'border':$border,});});if($thumbs.length>0){$count=1;$thumbnails='';$($thumbs).each(function(){$item='';$item+='<div class="fbstories-item'+this['border']+'" data-items=\''+JSON.stringify(this['data'])+'\'> <div class="user-image"> <img src="'+this['owner']['icon']+'" width="32" height="32" /> </div> <div class="image0th"> <img src="'+this['thumb']['url']+'" style="max-width:100%"> </div> <div class="user-name">'+this['owner']['fullname']+'</div> </div>';$thumbnails+=$item;$count++;});$('.fbstories-items').append($thumbnails);touchSlide();}}});}
function touchSlide(){const slider=document.querySelector(".fbstories-items");if(slider!==null){let isDown=false;let startX;let scrollLeft;slider.addEventListener("mousedown",e=>{isDown=true;slider.classList.add("active");startX=e.pageX-slider.offsetLeft;scrollLeft=slider.scrollLeft;});slider.addEventListener("mouseleave",()=>{isDown=false;slider.classList.remove("active");});slider.addEventListener("mouseup",()=>{isDown=false;slider.classList.remove("active");});slider.addEventListener("mousemove",e=>{if(!isDown)return;e.preventDefault();const x=e.pageX-slider.offsetLeft;const walk=x-startX;slider.scrollLeft=scrollLeft-walk;});}}
function plusSlides(n){clearInterval(id);width=0;showSlides(slideIndex+=n);}
function currentSlide(n){showSlides(slideIndex=n);}
function showSlides(n){var i;var slides=document.getElementsByClassName("fbstories-slides");if(n>slides.length){slideIndex=slides.length;}
if(n<1){slideIndex=1}
for(i=0;i<slides.length;i++){slides[i].style.display="none";}
$('.slideshow-container .total-images .current').text(slideIndex);slides[slideIndex-1].style.display="block";settings.onShow(slides[slideIndex-1].getAttribute('data-guid'),slides[slideIndex-1].getAttribute('data-url'),slides[slideIndex-1].getAttribute('data-owner'),slides[slideIndex-1]);$time=slides[slideIndex-1].getAttribute('data-time');$('.fbstories-container .user-name-time .time').html($time);$('.fbstories-container .fbstorie-item-delete').attr('data-guid',slides[slideIndex-1].getAttribute('data-guid'));$('.fbstories-container .fbstorie-item-delete').attr('data-owner',slides[slideIndex-1].getAttribute('data-owner'));if(slideIndex<=totalImages){showProgress();}}
initialize();appendThumbs();$('body').on('click','.slideshow-container .close',function(){width=0;slideIndex=1;mouseOnContainer=false;clearInterval(id);clearInterval(sid);$('.fbstories-container').hide();$('.fbstories-container-inner').html("");});$('body').on('click','.slideshow-container .slide-button',function(){clearInterval(sid);var $index=parseInt($(this).attr('data-index'));plusSlides($index);sid=setInterval(function(){if(mouseOnContainer==false&&width>=100){plusSlides(1);if(slideIndex==totalImages){clearInterval(sid);}}},100);});$('body').on('click','.fbstories-item',function(){slideIndex=1;width=0;id=0;sid=0;$json=JSON.parse($(this).attr('data-items'));if($json['owner']['fullname']){$container='<div class="slideshow-container"> <div class="status-bar" style="display:none;"></div> <div class="close">&#10799;</div><div class="fbstorie-item-delete"><i class="fa fa-trash-o"></i></div> <div class="users-information"> <div class="users-information-inner"> <div class="user-image"> <img src="'+$json['owner']['icon']+'" width="32" height="32" /> </div> <div class="user-name-time"> <span class="name">'+$json['owner']['fullname']+'</span> <span class="time"></span> </div> <div class="total-images"> <span class="current">1</span> <span>/</span> <span class="total">3</span> </div> </div> </div>';totalImages=$json['files'].length;$.each($json['files'],function(){$container+='<div class="fbstories-slides fadefbstories" data-owner="'+$json['owner']['guid']+'" data-time="'+this['time']+'" data-url="'+this['url']+'" data-guid="'+this['guid']+'"> <img src="'+this['url']+'" style="max-width:100%"> <div class="text">'+this['title']+'</div> </div>';});$container+='<a class="prev slide-button"  data-index="-1">&#10094;</a> <a class="next slide-button" data-index="1">&#10095;</a> </div>';$('.fbstories-container-inner').html($container);$('.fbstories-container-inner .total-images .total').html($json['files'].length);$('.fbstories-container').show();showSlides(slideIndex);}});sid=setInterval(function(){if(mouseOnContainer==false&&width>=100){if(slideIndex==totalImages){clearInterval(sid);}else{plusSlides(1);}}},100);return this;};}(jQuery));Ossn.RegisterStartupFunction(function(){$(document).ready(function(){$('.profile-photo').off('mouseenter mouseleave');$('.upload-photo').show();});});