// This script is compressed for speed. If you would like to see the 
// uncompressed code to create Hive7 add-ins, please visit 
// http://www.hive7.com/hive7/blacksun
// (C) 2005 Hive7.com Inc. All rights reserved. 
// 
// The following 3rd party components are embedded into Hive7 JS stream:
//  prototype.js http://prototype.conio.net/. 
// 		Special thanks to Sam Stephenson & Daniel Brockman!
//
// 	sha1.js http://pajhome.org.uk/crypt/ 
//
// 	shCore.js http://www.dreamprojections.com/syntaxhighlighter/   
var Prototype={Version:"1.3.1",emptyFunction:function(){
},bindCache:{elements:{},handlers:{}},bindAsEventListenerCache:{elements:{},handlers:{}}};
var Class={create:function(){
return function(){
this.initialize.apply(this,arguments);
};
}};
var Abstract=new Object();
Object.extend=function(_1,_2){
for(property in _2){
_1[property]=_2[property];
}
return _1;
};
Object.prototype.extend=function(_3){
return Object.extend.apply(this,[this,_3]);
};
var $A=Array.from=function(_4){
if(!_4){
return [];
}
if(_4.toArray){
return _4.toArray();
}else{
var _5=[];
for(var i=0,length=_4.length;i<length;i++){
_5.push(_4[i]);
}
return _5;
}
};
Function.prototype.bind=function(){
var _7=this,args=$A(arguments),object=args.shift(),$A_=$A;
var _8=function(){
return _7.apply(object,args.concat($A_(arguments)));
};
_8.owner=object;
return _8;
};
Function.prototype.bindAsEventListener=function(_9){
var _a=this,args=$A(arguments),_9=args.shift(),$A_=$A;
var _b=function(_c){
return _a.apply(_9,[(_c||window.event)].concat(args).concat($A_(arguments)));
};
_b.owner=_9;
return _b;
};
Number.prototype.toColorPart=function(){
var _d=this.toString(16);
if(this<16){
return "0"+_d;
}
return _d;
};
var Try={these:function(){
var _e;
for(var i=0;i<arguments.length;i++){
var _10=arguments[i];
try{
_e=_10();
break;
}
catch(e){
}
}
return _e;
}};
var PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(_11,_12){
this.callback=_11;
this.frequency=_12;
this.currentlyExecuting=false;
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
if(!this.currentlyExecuting){
try{
this.currentlyExecuting=true;
this.callback();
}
finally{
this.currentlyExecuting=false;
}
}
}};
function $(){
if(arguments.length==1){
var o=document.getElementById(arguments[0]);
if(o==null){
if((typeof arguments[0])!="string"){
return arguments[0];
}
}
return o;
}
var _14=new Array();
for(var i=0;i<arguments.length;i++){
var _16=arguments[i];
if(typeof _16=="string"){
_16=document.getElementById(_16);
}
if(arguments.length==1){
return _16;
}
_14.push(_16);
}
return _14;
}
if(!Array.prototype.push){
Array.prototype.push=function(){
var _17=this.length;
for(var i=0;i<arguments.length;i++){
this[_17+i]=arguments[i];
}
return this.length;
};
}
if(!Function.prototype.apply){
Function.prototype.apply=function(_19,_1a){
var _1b=new Array();
if(!_19){
_19=window;
}
if(!_1a){
_1a=new Array();
}
for(var i=0;i<_1a.length;i++){
_1b[i]="parameters["+i+"]";
}
_19.__apply__=this;
var _1d=eval("object.__apply__("+_1b.join(", ")+")");
_19.__apply__=null;
return _1d;
};
}
Object.extend(String.prototype,{stripTags:function(){
return this.replace(/<\/?[^>]+>/gi,"");
},escapeHTML:function(){
var div=document.createElement("div");
var _1f=document.createTextNode(this);
div.appendChild(_1f);
return div.innerHTML;
},unescapeHTML:function(){
if(this!=""){
var div=document.createElement("div");
div.innerHTML=this.stripTags();
return div.childNodes[0].nodeValue;
}
return "";
}});
var Ajax={getTransport:function(){
return Try.these(function(){
return new XMLHttpRequest();
},function(){
return new ActiveXObject("Msxml2.XMLHTTP");
},function(){
return new ActiveXObject("Microsoft.XMLHTTP");
})||false;
}};
Ajax.Base=function(){
};
Ajax.Base.prototype={setOptions:function(_21){
this.options=Object.extend({method:"post",asynchronous:true,parameters:""},_21||{});
},responseIsSuccess:function(){
return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);
},responseIsFailure:function(){
return !this.responseIsSuccess();
}};
Ajax.Request=Class.create();
Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Request.prototype=Object.extend((new Ajax.Base()),{initialize:function(url,_23){
this.transport=Ajax.getTransport();
this.setOptions(_23);
this.request(url);
},request:function(url){
var _25=this.options.parameters||"";
if(_25.length>0){
_25+="&_=";
}
try{
if(this.options.method=="get"){
url+="?"+_25;
}
this.transport.open(this.options.method,url,this.options.asynchronous);
if(this.options.asynchronous){
this.transport.onreadystatechange=this.onStateChange.bind(this);
setTimeout((function(){
this.respondToReadyState(1);
}).bind(this),10);
}
this.setRequestHeaders();
var _26=this.options.postBody?this.options.postBody:_25;
this.transport.send(this.options.method=="post"?_26:null);
}
catch(e){
}
},setRequestHeaders:function(){
var _27=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version];
if(this.options.method=="post"){
_27.push("Content-type","application/x-www-form-urlencoded");
}
if(this.options.requestHeaders){
_27.push.apply(_27,this.options.requestHeaders);
}
for(var i=0;i<_27.length;i+=2){
this.transport.setRequestHeader(_27[i],_27[i+1]);
}
},onStateChange:function(){
var _29=this.transport.readyState;
if(_29!=1){
this.respondToReadyState(this.transport.readyState);
}
},respondToReadyState:function(_2a){
var _2b=Ajax.Request.Events[_2a];
if(_2b=="Complete"){
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(this.transport);
}
(this.options["on"+_2b]||Prototype.emptyFunction)(this.transport);
if(_2b=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
}});
Ajax.Updater=Class.create();
Ajax.Updater.ScriptFragment="(?:<script.*?>)((\n|.)*?)(?:</script>)";
Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(_2c,url,_2e){
this.containers={success:_2c.success?$(_2c.success):$(_2c),failure:_2c.failure?$(_2c.failure):(_2c.success?null:$(_2c))};
this.transport=Ajax.getTransport();
this.setOptions(_2e);
var _2f=this.options.onComplete||Prototype.emptyFunction;
this.options.onComplete=(function(){
this.updateContent();
_2f(this.transport);
}).bind(this);
this.request(url);
},updateContent:function(){
var _30=this.responseIsSuccess()?this.containers.success:this.containers.failure;
var _31=new RegExp(Ajax.Updater.ScriptFragment,"img");
var _32=this.transport.responseText.replace(_31,"");
var _33=this.transport.responseText.match(_31);
if(_30){
if(this.options.insertion){
new this.options.insertion(_30,_32);
}else{
_30.innerHTML=_32;
}
}
if(this.responseIsSuccess()){
if(this.onComplete){
setTimeout((function(){
this.onComplete(this.transport);
}).bind(this),10);
}
}
if(this.options.evalScripts&&_33){
_31=new RegExp(Ajax.Updater.ScriptFragment,"im");
setTimeout((function(){
for(var i=0;i<_33.length;i++){
eval(_33[i].match(_31)[1]);
}
}).bind(this),10);
}
}});
Ajax.PeriodicalUpdater=Class.create();
Ajax.PeriodicalUpdater.prototype=Object.extend((new Ajax.Base()),{initialize:function(_35,url,_37){
this.setOptions(_37);
this.onComplete=this.options.onComplete;
this.frequency=(this.options.frequency||2);
this.decay=1;
this.updater={};
this.container=_35;
this.url=url;
this.start();
},start:function(){
this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent();
},stop:function(){
this.updater.onComplete=undefined;
clearTimeout(this.timer);
(this.onComplete||Ajax.emptyFunction).apply(this,arguments);
},updateComplete:function(_38){
if(this.options.decay){
this.decay=(_38.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=_38.responseText;
}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);
},onTimerEvent:function(){
this.updater=new Ajax.Updater(this.container,this.url,this.options);
}});
document.getElementsByClassName=function(_39){
var _3a=document.getElementsByTagName("*")||document.all;
var _3b=new Array();
for(var i=0;i<_3a.length;i++){
var _3d=_3a[i];
var _3e=_3d.className.split(" ");
for(var j=0;j<_3e.length;j++){
if(_3e[j]==_39){
_3b.push(_3d);
break;
}
}
}
return _3b;
};
if(!window.Element){
var Element=new Object();
}
Object.extend(Element,{toggle:function(){
for(var i=0;i<arguments.length;i++){
var _41=$(arguments[i]);
_41.style.display=(_41.style.display=="none"?"":"none");
}
},hide:function(){
for(var i=0;i<arguments.length;i++){
var _43=$(arguments[i]);
_43.style.display="none";
}
},show:function(){
for(var i=0;i<arguments.length;i++){
var _45=$(arguments[i]);
_45.style.display="";
}
},remove:function(_46){
_46=$(_46);
_46.parentNode.removeChild(_46);
},getHeight:function(_47){
_47=$(_47);
return _47.offsetHeight;
},hasClassName:function(_48,_49){
_48=$(_48);
if(!_48){
return;
}
var a=_48.className.split(" ");
for(var i=0;i<a.length;i++){
if(a[i]==_49){
return true;
}
}
return false;
},addClassName:function(_4c,_4d){
_4c=$(_4c);
Element.removeClassName(_4c,_4d);
_4c.className+=" "+_4d;
},removeClassName:function(_4e,_4f){
_4e=$(_4e);
if(!_4e){
return;
}
var _50="";
var a=_4e.className.split(" ");
for(var i=0;i<a.length;i++){
if(a[i]!=_4f){
if(i>0){
_50+=" ";
}
_50+=a[i];
}
}
_4e.className=_50;
},cleanWhitespace:function(_53){
var _53=$(_53);
for(var i=0;i<_53.childNodes.length;i++){
var _55=_53.childNodes[i];
if(_55.nodeType==3&&!/\S/.test(_55.nodeValue)){
Element.remove(_55);
}
}
}});
var Toggle=new Object();
Toggle.display=Element.toggle;
Abstract.Insertion=function(_56){
this.adjacency=_56;
};
Abstract.Insertion.prototype={initialize:function(_57,_58){
this.element=$(_57);
this.content=_58;
if(this.adjacency&&this.element.insertAdjacentHTML){
this.element.insertAdjacentHTML(this.adjacency,this.content);
}else{
this.range=this.element.ownerDocument.createRange();
if(this.initializeRange){
this.initializeRange();
}
this.fragment=this.range.createContextualFragment(this.content);
this.insertContent();
}
}};
var Insertion=new Object();
Insertion.Before=Class.create();
Insertion.Before.prototype=Object.extend((new Abstract.Insertion("beforeBegin")),{initializeRange:function(){
this.range.setStartBefore(this.element);
},insertContent:function(){
this.element.parentNode.insertBefore(this.fragment,this.element);
}});
Insertion.Top=Class.create();
Insertion.Top.prototype=Object.extend((new Abstract.Insertion("afterBegin")),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},insertContent:function(){
this.element.insertBefore(this.fragment,this.element.firstChild);
}});
Insertion.Bottom=Class.create();
Insertion.Bottom.prototype=Object.extend((new Abstract.Insertion("beforeEnd")),{initializeRange:function(){
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},insertContent:function(){
this.element.appendChild(this.fragment);
}});
Insertion.After=Class.create();
Insertion.After.prototype=Object.extend((new Abstract.Insertion("afterEnd")),{initializeRange:function(){
this.range.setStartAfter(this.element);
},insertContent:function(){
this.element.parentNode.insertBefore(this.fragment,this.element.nextSibling);
}});
var Field={clear:function(){
for(var i=0;i<arguments.length;i++){
$(arguments[i]).value="";
}
},focus:function(_5a){
$(_5a).focus();
},present:function(){
for(var i=0;i<arguments.length;i++){
if($(arguments[i]).value==""){
return false;
}
}
return true;
},select:function(_5c){
$(_5c).select();
},activate:function(_5d){
$(_5d).focus();
$(_5d).select();
}};
var Form={serialize:function(_5e){
var _5f=Form.getElements($(_5e));
var _60=new Array();
for(var i=0;i<_5f.length;i++){
var _62=Form.Element.serialize(_5f[i]);
if(_62){
_60.push(_62);
}
}
return _60.join("&");
},getElements:function(_63){
var _63=$(_63);
var _64=new Array();
for(tagName in Form.Element.Serializers){
var _65=_63.getElementsByTagName(tagName);
for(var j=0;j<_65.length;j++){
_64.push(_65[j]);
}
}
return _64;
},getInputs:function(_67,_68,_69){
var _67=$(_67);
var _6a=_67.getElementsByTagName("input");
if(!_68&&!_69){
return _6a;
}
var _6b=new Array();
for(var i=0;i<_6a.length;i++){
var _6d=_6a[i];
if((_68&&_6d.type!=_68)||(_69&&_6d.name!=_69)){
continue;
}
_6b.push(_6d);
}
return _6b;
},disable:function(_6e){
var _6f=Form.getElements(_6e);
for(var i=0;i<_6f.length;i++){
var _71=_6f[i];
_71.blur();
_71.disabled="true";
}
},enable:function(_72){
var _73=Form.getElements(_72);
for(var i=0;i<_73.length;i++){
var _75=_73[i];
_75.disabled="";
}
},focusFirstElement:function(_76){
var _76=$(_76);
var _77=Form.getElements(_76);
for(var i=0;i<_77.length;i++){
var _79=_77[i];
if(_79.type!="hidden"&&!_79.disabled){
Field.activate(_79);
break;
}
}
},reset:function(_7a){
$(_7a).reset();
}};
Form.Element={serialize:function(_7b){
var _7b=$(_7b);
var _7c=_7b.tagName.toLowerCase();
var _7d=Form.Element.Serializers[_7c](_7b);
if(_7d){
return encodeURIComponent(_7d[0])+"="+encodeURIComponent(_7d[1]);
}
},getValue:function(_7e){
var _7e=$(_7e);
var _7f=_7e.tagName.toLowerCase();
var _80=Form.Element.Serializers[_7f](_7e);
if(_80){
return _80[1];
}
}};
Form.Element.Serializers={input:function(_81){
switch(_81.type.toLowerCase()){
case "submit":
case "hidden":
case "password":
case "text":
return Form.Element.Serializers.textarea(_81);
case "checkbox":
case "radio":
return Form.Element.Serializers.inputSelector(_81);
}
return false;
},inputSelector:function(_82){
if(_82.checked){
return [_82.name,_82.value];
}
},textarea:function(_83){
return [_83.name,_83.value];
},select:function(_84){
var _85="";
if(_84.type=="select-one"){
var _86=_84.selectedIndex;
if(_86>=0){
_85=_84.options[_86].value||_84.options[_86].text;
}
}else{
_85=new Array();
for(var i=0;i<_84.length;i++){
var opt=_84.options[i];
if(opt.selected){
_85.push(opt.value||opt.text);
}
}
}
return [_84.name,_85];
}};
var $F=Form.Element.getValue;
Abstract.TimedObserver=function(){
};
Abstract.TimedObserver.prototype={initialize:function(_89,_8a,_8b){
this.frequency=_8a;
this.element=$(_89);
this.callback=_8b;
this.lastValue=this.getValue();
this.registerCallback();
},registerCallback:function(){
setInterval(this.onTimerEvent.bind(this),this.frequency*1000);
},onTimerEvent:function(){
var _8c=this.getValue();
if(this.lastValue!=_8c){
this.callback(this.element,_8c);
this.lastValue=_8c;
}
}};
Form.Element.Observer=Class.create();
Form.Element.Observer.prototype=Object.extend((new Abstract.TimedObserver()),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.Observer=Class.create();
Form.Observer.prototype=Object.extend((new Abstract.TimedObserver()),{getValue:function(){
return Form.serialize(this.element);
}});
Abstract.EventObserver=function(){
};
Abstract.EventObserver.prototype={initialize:function(_8d,_8e){
this.element=$(_8d);
this.callback=_8e;
this.lastValue=this.getValue();
if(this.element.tagName.toLowerCase()=="form"){
this.registerFormCallbacks();
}else{
this.registerCallback(this.element);
}
},onElementEvent:function(){
var _8f=this.getValue();
if(this.lastValue!=_8f){
this.callback(this.element,_8f);
this.lastValue=_8f;
}
},registerFormCallbacks:function(){
var _90=Form.getElements(this.element);
for(var i=0;i<_90.length;i++){
this.registerCallback(_90[i]);
}
},registerCallback:function(_92){
if(_92.type){
switch(_92.type.toLowerCase()){
case "checkbox":
case "radio":
_92.target=this;
_92.prev_onclick=_92.onclick||Prototype.emptyFunction;
_92.onclick=function(){
this.prev_onclick();
this.target.onElementEvent();
};
break;
case "password":
case "text":
case "textarea":
case "select-one":
case "select-multiple":
_92.target=this;
_92.prev_onchange=_92.onchange||Prototype.emptyFunction;
_92.onchange=function(){
this.prev_onchange();
this.target.onElementEvent();
};
break;
}
}
}};
Form.Element.EventObserver=Class.create();
Form.Element.EventObserver.prototype=Object.extend((new Abstract.EventObserver()),{getValue:function(){
return Form.Element.getValue(this.element);
}});
Form.EventObserver=Class.create();
Form.EventObserver.prototype=Object.extend((new Abstract.EventObserver()),{getValue:function(){
return Form.serialize(this.element);
}});
if(!window.Event){
var Event=new Object();
}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_93){
return _93.target||_93.srcElement;
},isLeftClick:function(_94){
return (((_94.which)&&(_94.which==1))||((_94.button)&&(_94.button==1)));
},pointerX:function(_95){
return _95.pageX||(_95.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_96){
return _96.pageY||(_96.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},stop:function(_97){
if(_97.preventDefault){
_97.preventDefault();
_97.stopPropagation();
}else{
_97.returnValue=false;
_97.cancelBubble=true;
}
},findElement:function(_98,_99){
var _9a=Event.element(_98);
while(_9a.parentNode&&(!_9a.tagName||(_9a.tagName.toUpperCase()!=_99.toUpperCase()))){
_9a=_9a.parentNode;
}
return _9a;
},observers:false,_observeAndCache:function(_9b,_9c,_9d,_9e){
if(!this.observers){
this.observers=[];
}
if(_9b.addEventListener){
this.observers.push([_9b,_9c,_9d,_9e]);
_9b.addEventListener(_9c,_9d,_9e);
}else{
if(_9b.attachEvent){
this.observers.push([_9b,_9c,_9d,_9e]);
_9b.attachEvent("on"+_9c,_9d);
}
}
},unloadCache:function(){
if(!Event.observers){
return;
}
for(var i=0;i<Event.observers.length;i++){
Event.stopObserving.apply(this,Event.observers[i]);
Event.observers[i][0]=null;
}
Event.observers=false;
},observe:function(_a0,_a1,_a2,_a3){
var _a0=$(_a0);
_a3=_a3||false;
if(_a1=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_a0.attachEvent)){
_a1="keydown";
}
this._observeAndCache(_a0,_a1,_a2,_a3);
_a0=null;
},stopObserving:function(_a4,_a5,_a6,_a7){
var _a4=$(_a4);
_a7=_a7||false;
if(_a5=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_a4.detachEvent)){
_a5="keydown";
}
if(_a4.removeEventListener){
_a4.removeEventListener(_a5,_a6,_a7);
}else{
if(_a4.detachEvent){
_a4.detachEvent("on"+_a5,_a6);
}
}
_a4=null;
}});
Event.observe(window,"unload",Event.unloadCache,false);
var Position={includeScrollOffsets:false,prepare:function(){
this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;
},realOffset:function(_a8){
var _a9=0,valueL=0;
do{
_a9+=_a8.scrollTop||0;
valueL+=_a8.scrollLeft||0;
_a8=_a8.parentNode;
}while(_a8);
return [valueL,_a9];
},cumulativeOffset:function(_aa){
var _ab=0,valueL=0;
do{
_ab+=_aa.offsetTop||0;
valueL+=_aa.offsetLeft||0;
_aa=_aa.offsetParent;
}while(_aa);
return [valueL,_ab];
},within:function(_ac,x,y){
if(this.includeScrollOffsets){
return this.withinIncludingScrolloffsets(_ac,x,y);
}
this.xcomp=x;
this.ycomp=y;
this.offset=this.cumulativeOffset(_ac);
return (y>=this.offset[1]&&y<this.offset[1]+_ac.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_ac.offsetWidth);
},withinIncludingScrolloffsets:function(_af,x,y){
var _b2=this.realOffset(_af);
this.xcomp=x+_b2[0]-this.deltaX;
this.ycomp=y+_b2[1]-this.deltaY;
this.offset=this.cumulativeOffset(_af);
return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_af.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_af.offsetWidth);
},overlap:function(_b3,_b4){
if(!_b3){
return 0;
}
if(_b3=="vertical"){
return ((this.offset[1]+_b4.offsetHeight)-this.ycomp)/_b4.offsetHeight;
}
if(_b3=="horizontal"){
return ((this.offset[0]+_b4.offsetWidth)-this.xcomp)/_b4.offsetWidth;
}
},clone:function(_b5,_b6){
_b5=$(_b5);
_b6=$(_b6);
_b6.style.position="absolute";
var _b7=this.cumulativeOffset(_b5);
_b6.style.top=_b7[1]+"px";
_b6.style.left=_b7[0]+"px";
_b6.style.width=_b5.offsetWidth+"px";
_b6.style.height=_b5.offsetHeight+"px";
}};
var HiveSettings={consts:[],value:function(_b8,_b9){
if(_b9!=null){
this.consts[_b8]=_b9;
}
return this.consts[_b8];
}};
HiveSettings.value("INC_ZINDEX",10000);
HiveSettings.value("DELAY_BEFORE_DRAG_START",10);
HiveSettings.value("DRAGGED_OPACITY",1);
HiveSettings.value("MIN_WINDOW_WIDTH",100);
HiveSettings.value("MIN_WINDOW_HEIGHT",50);
HiveSettings.value("TRACE_DATETIME_FORMAT","%Y-%M-%D %H:%I:%S");
HiveSettings.value("IS_DEBUG",true);
HiveSettings.value("MAX_DEBUG_MSG_COUNT",1000);
HiveSettings.value("SYSMENU_ZINDEX",100000);
HiveSettings.value("SYSMENU_IGNORE_LOCK",["SM_ITEMHARDUNLOCK","SM_ADDNEWITEM","SM_ADDITEMTOBAG","SM_ITEMPROP","SM_TRANSCOMMAND","SM_UNEQUIP","SM_ROOM_MODE_EDITOR","UM_GOTO"]);
HiveSettings.value("ACTIVE_ELEMENT_ZINDEX",99999);
HiveSettings.value("IGNORE_CONTEXT_MENU"," input textarea select button a embed object");
HiveSettings.value("CHAT_BUBBLE_TIMEOUT",20000);
HiveSettings.value("CHAT_BUBBLE_MAX_WIDTH",300);
HiveSettings.value("CHAT_BUBBLE_MAX_HEIGHT",200);
HiveSettings.value("CHAT_BUBBLE_SCROLL_STEP",5);
HiveSettings.value("CHAT_BUBBLE_SCROLL_TIMEOUT",250);
HiveSettings.value("CHAT_INCOMING_FOCUS",false);
HiveSettings.value("CHAT_PREPROCESS_METHOD","escape");
HiveSettings.value("CHAT_MAX_MESSAGE_LENGTH",2048);
HiveSettings.value("AWAY_TIMEOUT",15*60*1000);
HiveSettings.value("EDIT_TAB","    ");
HiveSettings.value("PRELOAD_THREADS_COUNT",4);
HiveSettings.value("PRELOAD_TIMEOUT",5*1000);
HiveSettings.value("IS_GARBAGE",false);
HiveSettings.value("IS_PROFILER",false);
HiveSettings.value("PROTOCOL_TIMEOUT",30000);
HiveSettings.value("BUBBLE_LOCKEDBY_TIMEOUT",5000);
HiveSettings.value("SHOW_UNTRUSTED_FEATURES",false);
try{
if(HiveRoomConfigSettings){
for(property in HiveRoomConfigSettings){
if(typeof HiveRoomConfigSettings[property]!="function"){
HiveSettings.value(property,HiveRoomConfigSettings[property]);
}
}
}
}
catch(e){
}
var Hive7={version:"1.2",namespace:function(){
var a=arguments;
for(i=0;i<a.length;++i){
Hive7.declare(a[i],true);
}
},declare:function(_bb,_bc,_bd){
var o=null,i,j,d,_bd;
d=_bb.split(".");
o=(_bc==true)?Hive7:window;
for(j=(d[0]=="Hive7")?1:0;j<d.length;++j){
o[d[j]]=o[d[j]]||_bd||{};
o=o[d[j]];
}
return o;
}};
var HiveLib={CLIENT_LOAD_SCRIPT_PRIORITY_LOWEST:0,CLIENT_LOAD_SCRIPT_PRIORITY_LOW:1,CLIENT_LOAD_SCRIPT_PRIORITY_NORMAL:2,CLIENT_LOAD_SCRIPT_PRIORITY_HIGH:3,CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST:4,hivePageLoadStack:{0:[],1:[],2:[],3:[],4:[]},hivePageUnloadStach:[],hiveJITScriptStack:{0:[],1:[],2:[],3:[],4:[]},cloneTemplate:function(_bf,_c0,_c1,_c2){
if(typeof _c0!="object"){
var _c0=$(_c0);
}
if(_c0==null){
HiveLib.Debugger.trace("Error","template "+_c0+" not found",true);
return new hiveContainer();
}
if(_c1==true){
var _c3=_c0.cloneNode(true);
}else{
var _c3=_c0;
}
if(_c3!=null&&_bf!=null){
for(property in _bf){
_c3[property]=_bf[property];
}
if(typeof _c3.onClone=="function"){
_c3.onClone();
}
}
if(_c3!=null&&_c1==true){
_c2=HiveLib.getParentForClone(_c3,_c2);
_c2.appendChild(_c3);
}
return _c3;
},getParentForClone:function(_c4,_c5){
if(_c5!=null){
return $(_c5)||document.body;
}else{
if(["hiveImage","hiveAvatar","hiveBubble"].indexOf(_c4.hiveType)>=0){
return Hive7.Viewport.getViewportNode();
}else{
return document.body;
}
}
},unescapeObject:function(obj){
if(!obj||typeof obj!="object"){
return obj;
}
for(var _c7 in obj){
var val=obj[_c7];
var _c9=typeof val;
if(val==null){
continue;
}else{
if(_c9=="string"){
obj[_c7]=unescape(val);
}else{
if(_c9=="object"){
if(val instanceof Array){
for(var i=0;i<val.length;i++){
val[i]=this.unescapeObject(val[i]);
}
}else{
obj[_c7]=this.unescapeObject(val);
}
}
}
}
}
return obj;
},browserCheck:function(){
var ua=navigator.userAgent;
this.isOpera=!!window.opera;
this.isKonqueror=(ua.indexOf("Konqueror")>=0);
this.isSafari=(ua.indexOf("Safari")>=0);
this.isFirefox=(ua.indexOf("Firefox")>=0);
this.isMozilla=(!this.isKonqueror&&!this.isSafari&&!this.isFirefox)&&(ua.indexOf("Gecko")>=0);
this.isIE=(ua.toLowerCase().indexOf("msie")>=0)&&(this.isOpera==false);
this.isGecko=(ua.indexOf("Gecko")>=0);
this.Other=!this.isOpera&&!this.isKonqueror&&!this.isSafari&&!this.isFirefox&&!this.isMozilla&&!this.isIE;
this.Browser={version:0};
if(this.isGecko){
if(ua.match(/rv:([\d\.]+)/gi)){
this.Browser.revision=RegExp.$1;
}
if(this.isFirefox){
if(ua.match(/Firefox\/([\d\.]+)/gi)){
this.Browser.version=RegExp.$1;
}
}
if(this.isSafari){
if(ua.match(/Safari\/([\d\.]+)/gi)){
this.Browser.version=RegExp.$1;
}
}
if(this.isKonqueror){
if(ua.match(/Konqueror\/([\d\.]+)/gi)){
this.Browser.version=RegExp.$1;
}
}
if(this.isMozilla){
this.Browser.version=this.Browser.revision;
}
}
if(this.isIE){
if(ua.match(/MSIE (\d+)\.(\d+)/i)){
this.Browser.version=RegExp.$1;
this.Browser.subversion=RegExp.$2;
}
}
HiveSettings.value("UI_FOLLOW_BLANK",false);
},required:[],require:function(url){
if(HiveLib.required.indexOf(url)==-1){
HiveLib.required.push(url);
}
},addStartup:function(){
var _cd=this.CLIENT_LOAD_SCRIPT_PRIORITY_NORMAL;
if(arguments.length<1){
return;
}
if(arguments.length==2){
_cd=arguments[1];
}
if(_cd>this.CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST){
alert("Value of a priority exceeds as much as possible admissible.");
}else{
var _ce=arguments[0];
if(typeof _ce=="function"){
this.hivePageLoadStack[_cd].push(_ce);
}
}
},runStartup:function(_cf){
Hive7.Core.loadScriptsByList(HiveLib.required,function(){
if(HiveLib.startupDone!=true){
for(var i=HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST;i>=HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_LOWEST;i--){
for(var j=0;j<HiveLib.hivePageLoadStack[i].length;j++){
try{
HiveLib.hivePageLoadStack[i][j]();
}
catch(e){
HiveLib.Debugger.traceException("HiveLib.runStartup",e);
}
}
}
HiveLib.startupDone=true;
if(HiveLib.Env.isInRoom()){
HiveScripting.runFullEvent(HiveRoom,"Complete");
}
}
});
},addFinalize:function(_d2){
if(typeof _d2=="function"){
HiveLib.hivePageUnloadStach.push(_d2);
}
},runFinalize:function(){
for(var i=0;i<HiveLib.hivePageUnloadStach.length;i++){
try{
HiveLib.hivePageUnloadStach[i]();
}
catch(e){
}
}
},addJITScript:function(){
var _d4=this.CLIENT_LOAD_SCRIPT_PRIORITY_NORMAL;
if(arguments.length<1){
return;
}
if(arguments.length==2){
_d4=arguments[1];
}
if(_d4>this.CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST){
alert("Value of a priority exceeds as much as possible admissible.");
}else{
var _d5=arguments[0];
if(typeof _d5=="function"){
this.hiveJITScriptStack[_d4].push(_d5);
}
}
},runJITScript:function(){
for(var i=this.CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST;i>this.CLIENT_LOAD_SCRIPT_PRIORITY_LOWEST;i--){
for(var j=0;j<this.hiveJITScriptStack[i].length;j++){
try{
this.hiveJITScriptStack[i][j]();
}
catch(e){
HiveLib.Debugger.traceException("HiveLib.runJITScript",e);
}
}
this.hiveJITScriptStack[i]=new Array();
}
},parseId:function(id){
var s=id;
if(s.lastIndexOf("_")!=-1){
s=s.substring(s.lastIndexOf("_")+1);
}
return s;
},getClientSpeed:function(_da){
if(typeof (HiveSettings)!="undefined"){
var _db=new Date();
_da=_da||10000;
sum=0;
for(var i=0;i<_da;i++){
sum+=Math.sin(i);
}
_db=new Date()-_db;
HiveSettings.value("CLIENT_SPEED",_db);
HiveLib.Debugger.trace("speed:"+_db);
}
},insert:function(_dd,_de){
var _df=false;
if(!_df&&document.selection){
var sel=document.selection;
var rng=sel.createRange();
rng.colapse;
if((sel.type=="Text"||sel.type=="None")&&rng!=null){
rng.text=_de;
_df=true;
}
}
if(!_df&&_dd.selectionStart){
var ss=_dd.selectionStart;
var st=_dd.scrollTop;
var es=_dd.selectionEnd;
var _e5=(_dd.value).substring(0,ss);
var end=(_dd.value).substring(ss,_dd.textLength);
_dd.value=_e5+_de+end;
var _e7=ss+(_de.length);
_dd.selectionStart=_e7;
_dd.selectionEnd=_e7;
_dd.scrollTop=st;
_df=true;
}
if(!_df){
_dd.value+=_de;
}
},delay:function(_e8){
for(var i=0,pause=0;i<_e8;i++){
pause++;
}
},emptyEventHandler:function(_ea){
Event.stop(_ea);
return false;
},mapPath:function(_eb){
return HiveSettings.value("SITE_PREFIX")+_eb;
},findRes:function(_ec){
if(_ec==null||_ec=="null"){
HiveLib.Debugger.trace("Path is null","call by "+HiveLib.Debugger.callBy(HiveLib.findRes.caller),true);
}
if(_ec.indexOf("http:")==0){
return _ec;
}
if(HiveLib.resPath==null){
HiveLib.resPath=HiveSettings.value("RES_PATH");
}
if(_ec.indexOf("/res/")==0){
return HiveLib.resPath+_ec.substr("/res/".length);
}
return HiveLib.resPath+_ec;
},random:function(){
return Math.round(Math.random()*1000000);
},isNum:function(num){
return !isNaN(parseInt(num));
},reflect:function(o){
var s="{\n";
var _f0={extend:true,clone:true};
var cnt=0;
for(var i in o){
if(_f0[i]==true){
continue;
}
if(cnt++>0){
s+=",\n";
}
if(typeof o[i]=="function"){
s+=i+": "+o[i];
}else{
s+=i+": "+Hive7.JSON.serialize(o[i]);
}
}
s+="\n}";
return s;
},getCookie:function(key){
var _f4=document.cookie;
var _f5=_f4.indexOf(key+"=");
if(_f5!=-1){
var _f6=_f5+key.length+1;
var end=_f4.indexOf(";",_f6);
if(end==-1){
end=_f4.length;
}
return unescape(_f4.substring(_f6,end));
}
return "";
},setCookie:function(key,_f9,_fa){
var _fb=key+"="+escape(_f9)+"; ";
if(!_fa){
_fa=new Date();
_fa.setFullYear(_fa.getFullYear()+1);
}
_fb+="expires="+_fa.toGMTString()+"; ";
_fb+="path=/;";
var _fc=HiveSettings.value("COOKIE_DOMAIN");
if(_fc.length>0){
_fb+="domain="+_fc+"; ";
}
document.cookie=_fb;
},clearRoom:function(){
},follow:function(url){
if(HiveSettings.value("UI_FOLLOW_BLANK")==true){
window.open(url);
}else{
HiveLib.Profiler.trace("HiveLib.follow() start");
if(url.indexOf("javascript:")!=0&&url.indexOf("mailto:")!=0){
HiveLib.Profiler.trace("HiveLib.follow(): before screen");
HiveLib.DOM.showScreen("#CCC");
HiveLib.Profiler.trace("HiveLib.follow(): after screen");
HiveLib.GarbageCollector.clearRoom();
HiveLib.Profiler.trace("HiveLib.follow(): after garbage collector");
}
HiveLib.Profiler.trace("HiveLib.follow() finish");
window.location.href=url;
}
},transfer:function(url,_ff){
if(_ff==true){
var _100=window.open(url);
return (_100!=null);
}else{
HiveLib.Profiler.trace("HiveLib.transfer() start");
if(url.indexOf("javascript:")!=0&&url.indexOf("mailto:")!=0){
HiveLib.Profiler.trace("HiveLib.transfer(): before screen");
HiveLib.DOM.showScreen("#CCC");
HiveLib.Profiler.trace("HiveLib.transfer(): after screen");
HiveLib.GarbageCollector.clearRoom();
HiveLib.Profiler.trace("HiveLib.transfer(): after garbage collector");
}
HiveLib.Profiler.trace("HiveLib.transfer() finish");
window.location.href=url;
return true;
}
},isFunction:function(_101){
try{
return (_101&&typeof _101=="function");
}
catch(e){
return false;
}
},ieFollow:function(url){
if(HiveLib.isIE){
window.open(url);
}else{
HiveLib.follow(url);
}
}};
HiveLib.browserCheck();
if(HiveLib.isGecko){
document.addEventListener("DOMContentLoaded",HiveLib.runStartup.bindAsEventListener(HiveLib),false);
}else{
Event.observe(window,"load",HiveLib.runStartup.bindAsEventListener(HiveLib),true);
}
window.onunload=HiveLib.runFinalize.bindAsEventListener(HiveLib);
HiveLib.addFinalize(Event.unloadCache);
HiveLib.DOM={createElement:function(_103,_104,_105,_106){
if(_105&&_105.id&&$(_105.id)!=null){
var _107=$(_105.id);
}else{
var _107=document.createElement(_104);
var _106=_106||document.body;
if(_106.appendChild){
_106.appendChild(_107);
}
}
for(property in _105){
_107[property]=_105[property];
}
if(_103!=null){
for(property in _103){
_107[property]=_103[property];
}
}
return _107;
},createNode:function(_108,_109,_10a,_10b){
if(_109&&_109.id&&$(_109.id)!=null){
var _10c=$(_109.id);
}else{
var _10c=document.createElement(_108);
if(_10b&&_10b.appendChild){
_10b.appendChild(_10c);
}
}
if(_109){
for(property in _109){
_10c[property]=_109[property];
}
}
if(_10a){
for(rule in _10a){
_10c.style[rule]=_10a[rule];
}
}
return _10c;
},removeElement:function(_10d){
if(_10d&&_10d.parentNode&&_10d.parentNode.removeChild){
HiveLib.GarbageCollector.clearFunctions(_10d);
_10d.parentNode.removeChild(_10d);
}
return null;
},removeAllElements:function(){
if(HiveLib.isIE){
var _10e=document.all;
for(var i=0;i<_10e.length;i++){
HiveLib.DOM.removeElement(_10e[i]);
}
}
},findParentByTagName:function(_110,_111){
while(_110!=null){
if(_110.tagName==_111){
return _110;
}
_110=_110.parentNode;
}
return _110;
},findHiveParent:function(_112){
while(_112!=null){
if(_112.hiveType!=null){
return _112;
}
if(_112.jsType!=null){
return _112.jsType;
}
_112=_112.parentNode;
}
return _112;
},findHiveParentOfType:function(_113,_114){
while(_113!=null){
if(_113.hiveType!=null&&_113.hiveType==_114){
return _113;
}
_113=_113.parentNode;
}
return _113;
},getChildById:function(_115,id){
try{
for(var i=0;i<_115.childNodes.length;i++){
var _118=_115.childNodes.item(i);
if(_118.nodeType==1){
if(_118.id&&_118.id==id){
return _118;
}else{
if((childWithId=this.getChildById(_118,id))!=null){
return childWithId;
}
}
}
}
}
catch(e){
}
return null;
},getChildByClassName:function(_119,_11a){
try{
for(var i=0;i<_119.childNodes.length;i++){
var _11c=_119.childNodes.item(i);
if(_11c.nodeType==1){
if(Element.hasClassName(_11c,_11a)){
return _11c;
}else{
if((childWithClassName=this.getChildByClassName(_11c,_11a))!=null){
return childWithClassName;
}
}
}
}
}
catch(e){
}
return null;
},getChildrenByClassName:function(_11d,_11e){
var _11f=new Array();
try{
for(var i=0;i<_11d.childNodes.length;i++){
var _121=_11d.childNodes.item(i);
if(_121.nodeType==1){
if(Element.hasClassName(_121,_11e)){
_11f.push(_121);
}else{
if((childrenWithClassName=this.getChildrenByClassName(_121,_11e)).length>0){
_11f=_11f.concat(childrenWithClassName);
}
}
}
}
}
catch(e){
}
return _11f;
},getWindowDimension:function(_122){
var _123=0;
var _124=0;
if(document.body.clientHeight&&document.body.clientWidth){
_123=document.body.clientWidth;
_124=document.body.clientHeight;
}
if(window.innerWidth&&window.innerHeight){
_123=window.innerWidth;
_124=window.innerHeight;
if(!_122&&document.body.style.overflow!="hidden"){
if(document.body.scrollHeight>_124){
_123-=16;
}
if(document.body.scrollWidth>_123){
_124-=16;
}
}
}
return {"width":_123,"height":_124};
},getPageDimension:function(){
var _125=0;
var _126=0;
if(window.innerHeight&&window.scrollMaxY){
_125=document.body.scrollWidth;
_126=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_125=document.body.scrollWidth;
_126=document.body.scrollHeight;
}else{
_125=document.body.offsetWidth;
_126=document.body.offsetHeight;
}
}
return {"width":_125,"height":_126};
},getWindowOffset:function(){
Position.prepare();
return {"left":Position.deltaX,"top":Position.deltaY};
},getElementsByTagAndClassName:function(_127,_128){
if(_127==null){
_127="*";
}
var _129=document.getElementsByTagName(_127)||document.all;
var _12a=new Array();
if(_128==null){
return _129;
}
for(var i=0;i<_129.length;i++){
var _12c=_129[i];
var _12d=_12c.className.split(" ");
for(var j=0;j<_12d.length;j++){
if(_12d[j]==_128){
_12a.push(_12c);
break;
}
}
}
return _12a;
},registerServerControl:function(id,_130){
if(!id||!_130){
return;
}
if(!HiveLib.DOM.ServerControls){
HiveLib.DOM.ServerControls={};
}
HiveLib.DOM.ServerControls[id]=_130;
},unregisterServerControl:function(id){
HiveLib.DOM.ServerControls[id]=null;
delete HiveLib.DOM.ServerControls[id];
},getServerControl:function(id,_133){
if(_133==null||_133=="undefined"){
_133=true;
}
var res=null;
if(HiveLib.DOM.ServerControls){
res=HiveLib.DOM.ServerControls[id];
}
res=res||$(id);
if(!res&&_133){
res=this.cantFindServerControl(id);
}
return res;
},controlsSearchers:[],addControlsSearcher:function(_135){
this.controlsSearchers.push(_135);
},cantFindServerControl:function(id){
for(var i=0;i<this.controlsSearchers.length;i++){
var res=this.controlsSearchers[i](id);
if(res!=null){
return res;
}
}
return null;
},getMainForm:function(){
var form=$("RoomForm");
if(form==null){
form=$("UpdateDesignForm");
}
if(form==null){
HiveLib.Debugger.trace("ERROR","Can't find main from.",true);
}
return form;
},scrollToEnd:function(_13a){
if(_13a){
_13a.scrollTop=_13a.scrollHeight+_13a.offsetHeight;
}
},scrollToTop:function(_13b){
if(_13b&&_13b.parentNode){
_13b.parentNode.scrollTop=0;
}
},copyClipboard:function(_13c){
if(window.clipboardData){
window.clipboardData.setData("Text",_13c);
return true;
}
if(HiveLib.DOM.copyClipboardProxy(_13c)){
return true;
}
if(HiveLib.isGecko&&HiveLib.DOM.copyClipboardGecko(_13c)){
return true;
}
if(HiveLib.DOM.copyClipboardNetscape(_13c)){
return true;
}
return false;
},copyClipboardProxy:function(_13d){
if(Hive7.Flash&&Hive7.Flash.pluginVersion>=8){
try{
Hive7.Flash.getProxy("ClipboardProxy").setClipboard(_13d);
}
catch(e){
return false;
}
}else{
_13d=encodeURI(_13d);
if(_13d.length>2048){
return false;
}
if(this.clipboardProxyPlaceholder){
this.clipboardProxyPlaceholder.innerHTML="<embed src=\""+HiveLib.findRes("site/ClipboardProxy.swf")+"?buffer="+_13d+"\" width=\"1\" height=\"1\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed>";
return true;
}else{
return false;
}
}
},copyClipboardGecko:function(_13e){
try{
var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
if(!str){
return false;
}
str.data=_13e;
var _140=Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
if(!_140){
return false;
}
_140.addDataFlavor("text/unicode");
_140.setTransferData("text/unicode",str,_13e.length*2);
var _141=Components.interfaces.nsIClipboard;
var clip=Components.classes["@mozilla.org/widget/clipboard;1"].getService(_141);
if(!clip){
return false;
}
clip.setData(_140,null,_141.kGlobalClipboard);
return true;
}
catch(e){
return false;
}
},copyClipboardNetscape:function(text){
var url=["data:text/html;charset=utf-8;base64,PGJvZHk+PC9ib2","R5PjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4KKGZ1","bmN0aW9uKGVuY29kZWQpe3ZhciBzd2ZfZGF0YSA9IFsKICdkYX","RhOmFwcGxpY2F0aW9uL3gtc2hvY2t3YXZlLWZsYXNoO2Jhc2U2","NCxRMWRUQjJ3JywKICdBQUFCNG5EUGdZbGpBd01qSTRNejAlMk","YlMkY5JTJGZTJaZkJnYUdhV3dNRE1uNUthJywKICdrTU10TjRH","ZGdaZ1NJTXdaWEZKYW01UUFFJTJCQm9iaTFCTG5uTXlDcFB6RW","9oU0dJJywKICdQRnAlMkZBeHNEREJRa3BGWkRGUUZGQ2d1eVM4","QXlqSTRBRVVCaXkwVndBJTNEJTNEJwpdLmpvaW4oIiIpOwpkb2","N1bWVudC5ib2R5LmlubmVySFRNTCA9IFsKICc8ZW1iZWQgc3Jj","PSInLHN3Zl9kYXRhLCciICcsCiAnRmxhc2hWYXJzPSJjb2RlPS","csZW5jb2RlZCwnIj4nLAogJzwvZW1iZWQ+JwpdLmpvaW4oIiIp","Owp9KSgi",base64encode(encodeURIComponent(text)+"\")</"+"script>")].join("");
var tmp=document.createElement("div");
tmp.innerHTML=["<iframe src=\"",url,"\""," width=\"0\" height=\"0\">","</iframe>"].join("");
with(tmp.style){
position="absolute";
left="-10px";
top="-10px";
visibility="hidden";
}
document.body.appendChild(tmp);
setTimeout(function(){
document.body.removeChild(tmp);
},5000);
return true;
function base64encode(str){
var _147="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
var c1,c2,c3;
var buf=[];
var len=str.length;
var i=0;
while(i<len){
c1=str.charCodeAt(i)&255;
c2=str.charCodeAt(i+1);
c3=str.charCodeAt(i+2);
buf.push(_147[(c1>>2)]);
if(i+1==len){
buf.push(_147[(c1&3)<<4],"==");
break;
}
buf.push(_147[((c1&3)<<4)|((c2&240)>>4)]);
if(i+2==len){
buf.push(_147[(c2&15)<<2],"=");
break;
}
buf.push(_147[((c2&15)<<2)|((c3&192)>>6)],_147[(c3&63)]);
i+=3;
}
return buf.join("");
}
},toString:function(_14c){
if(_14c&&_14c.tagName){
switch(_14c.tagName){
case "IMG":
return "<img src=\""+_14c.src+"\" alt=\""+_14c.alt+"\" "+"style=\"left:"+_14c.style.left+"; "+"top:"+_14c.style.top+"; "+"position:absolute\" "+"width=\""+_14c.offsetWidth+"\" "+"height=\""+_14c.offsetHeight+"\">";
break;
case "DIV":
var _14d="";
if(_14c.className!=""){
_14d+=" class=\""+_14c.className+"\"";
}
return "<div style=\"left:"+_14c.style.left+"; "+"top:"+_14c.style.top+"; "+"width:"+_14c.offsetWidth+"px; "+"height:"+_14c.offsetHeight+"px; "+"position:absolute\" "+_14d+">"+_14c.innerHTML+"</div>";
break;
default:
return "";
}
}else{
return "";
}
},showScreen:function(_14e){
var size=HiveLib.DOM.getPageDimension();
var div=HiveLib.DOM.createElement(new hiveContainer(),"DIV",{id:"bodyScreen"});
div.setup();
div.opacity(0);
div.zIndex(HiveSettings.value("SYSMENU_ZINDEX")+1);
div.moveTo(0,0);
div.resizeTo(size.width,size.height);
if(_14e!=null){
div.style.backgroundColor=_14e;
div.opacity(0.5);
}else{
div.style.backgroundImage="url("+HiveLib.findRes("site/gradbg.gif")+")";
div.opacity(1);
}
},getTextWidth:function(msg){
var span=HiveLib.DOM.createElement(null,"span",{innerHTML:msg});
var _153=span.offsetWidth;
HiveLib.DOM.removeElement(span);
return _153;
}};
HiveLib.addStartup(function(){
HiveLib.DOM.clipboardProxyPlaceholder=Hive7.Flash.createProxy("HiveLib.DOM.clipboardProxy","ClipboardProxy","site/ClipboardProxy.swf");
},HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_LOW);
HiveLib.Debugger={logger:[],trace:function(_154,_155,_156){
if(HiveSettings.value("IS_DEBUG")){
var text=this._formatTraceMsg(_154,_155,(_156==true));
var _158=false;
if(this.logger.length==HiveSettings.value("MAX_DEBUG_MSG_COUNT")){
this.logger.shift();
_158=true;
}
this.logger.push(this._formatTraceMsg(_154,_155));
if(this.debugWindow&&this.debugWindow.Visible()==true){
if(_158){
this.setContent(this.logger.join(""),true);
}else{
this.setContent(text);
}
}
}
},traceException:function(name,_15a){
this.trace("Exception "+name,_15a.name+": "+(_15a.message||_15a.description),true);
if(typeof _15a.stack=="string"){
var _15b=[];
var _15c=_15a.stack.split("\n");
for(var i=0;i<_15c.length;i++){
if(_15c[i]!=""&&_15c[i]!="@:0"){
_15b.push(_15c[i].replace(/^(.*)\@(.*)$/,"$1<br><small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$2</small>"));
}
}
this.trace("Exception "+name,"&nbsp;&nbsp;&nbsp;"+_15b.join("<br>&nbsp;&nbsp;&nbsp;"));
}
},dump:function(obj){
if(typeof (obj)=="object"){
text="object:<br >";
for(val in obj){
if(obj.hasOwnProperty(val)){
try{
text+=val+": "+obj[val]+";\t";
}
catch(error){
text+=val+": Error: * "+error.message+" *;\t";
}
}
}
HiveLib.Debugger.trace("<-dump",text);
}else{
HiveLib.Debugger.trace("<-dump",obj);
}
},_formatTraceMsg:function(_15f,_160,_161){
var html="<p class=\"debugText\">"+(new Date()).toLocaleTimeString()+"&nbsp;"+"<strong>"+_15f+"</strong><br />";
if(_160!=null){
if(_161){
_160="<span style=\"color:#900\">"+_160+"</span>";
}
html+=_160;
}
html+="</p>";
return html;
},debugWindow:null,showDebugWindow:function(){
if(HiveSettings.value("IS_DEBUG")){
if(this.debugWindow==null){
this.debugWindow=HiveLib.DOM.getServerControl("DebugWindow");
if(this.debugWindow==null){
HiveSettings.value("IS_DEBUG",false);
}else{
this.debugWindow.addHiveEvent("show",this.setCookie.bind(this));
this.debugWindow.addHiveEvent("hide",this.setCookie.bind(this));
this.debugWindow.floatContent=false;
this.debugWindow.resizeTo(350,200);
}
}
if(this.debugWindow){
this.debugWindow.show();
this.setContent(this.logger.join("\n"));
}
}
},setContent:function(str,_164){
if(_164==null){
_164=false;
}
if(this.debugWindow){
this.debugWindow.setContent(str,_164);
HiveLib.DOM.scrollToEnd(this.debugWindow.contentElement);
}
},setCookie:function(_165,_166){
var flag=(_166=="show")?1:0;
HiveLib.setCookie("DebugWindow",flag);
},clearContent:function(){
this.setContent("",true);
},breakpoint:function(){
var _168=false;
for(var i=0;i<arguments.length;i++){
_168=_168||arguments[i];
}
if(_168&&HiveSettings.value("IS_DEBUG")){
eval("debugger;");
}
},callBy:function(_16a){
var str=_16a.toString();
var name="anonymous";
if(str.match(/^function ([^\(]+)\(/i)){
name=RegExp.$1+"()";
}
return name;
}};
HiveLib.Profiler={win:null,time:null,start:null,types:{enter:"arrow_right",exit:"arrow_left",alert:"action_stop",warning:"icon_alert",star:"icon_favourites",question:"icon_info",comment:"comment_yellow"},register:function(){
this.win=window.open("","HiveProfiler","toolbar=0, menubar=0, directories=0, resizable=1, scrollbars=1, location=0, width=650,height=400");
if(this.win&&this.win.document){
if(this.win.inited!=true){
this.win.document.open();
this.win.document.write(["<html>","<head>","<title>Hive7 Javascript Profiler</title>","<style type=\"text/css\">","table {border-collapse: collapse; width:100%;}","table td {border:1px solid #666; color:#000; font-family:Verdana, Arail, sans-serif; font-size:9pt;}","</style>","<scr"+"ipt language=\"JavaScript\" type=\"text/javascript\">","var cells = [","\t{width:21, align:\"center\"},","\t{align:\"left\"},","\t{width:80, align:\"right\"},","\t{width:80, align:\"right\"},","\t{width:80, align:\"right\"}","];","function trace(tableId, data) {","\tif(table = document.getElementById(tableId)) {","\t\tvar newTraceRow = table.insertRow(table.rows.length);","\t\tnewTraceRow.onmouseover\t= over;","\t\tnewTraceRow.onmouseout\t= out;","\t\tfor(var i=0; i<cells.length; i++) {","\t\t\tvar newTraceCell = newTraceRow.insertCell(i);","\t\t\tnewTraceCell.width\t\t= cells[i].width || \"\";","\t\t\tnewTraceCell.align\t\t= cells[i].align || \"\";","\t\t\tnewTraceCell.innerHTML\t= data[i] || \"&nbsp;\";","\t\t}","\t}","}","function over() {","\tthis.style.backgroundColor = \"#EEE\";","}","function out() {","\tthis.style.backgroundColor = \"\";","}","</scr"+"ipt>","</head>","<body>","</body>"].join("\n"));
this.win.document.close();
this.win.inited=true;
}
element=this.win.document.createElement("TABLE");
this.table="TABLE"+HiveLib.random();
element.id=this.table;
this.win.document.body.appendChild(element);
this.time=new Date();
this.start=this.time;
this.trace("<strong>Start Profiler:<strong> <a href=\""+location.href+"\">"+location.href+"</a>","alert");
}
},trace:function(msg,type){
if(this.table!=null&&this.win.trace!=null){
var now=new Date();
if(type!=null&&this.types[type]!=null){
var icon="<img src=\""+HiveLib.findRes("icons/mark.james/mini/"+this.types[type]+".gif")+"\" width=\"16\" height=\"16\" alt=\"\" align=\"absmiddle\" /> ";
}else{
var icon="&nbsp;";
}
var data=[icon,msg,now.date("%H:%I:%S"),(now-this.time),(now-this.start)];
this.win.trace(this.table,data);
this.time=now;
}
}};
HiveLib.addStartup(function(){
if(HiveSettings.value("IS_PROFILER").toString()=="true"){
HiveLib.Profiler.register();
}
},HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST);
HiveLib.UI={HIDDEN_LAYER:-1,DEFAULT_LAYER:0,ITEMS_LAYER:1,AVATARS_LAYER:2,UI_LAYER:3,freezed:[],semaphoresValue:[],freezeElement:function(_172){
var _172=$(_172);
if(HiveLib.isIE){
this._updatePositionHandler=this.updateFreezedPosition.bind(this),this.updateFreezedPosition(_172);
this.freezed.push(_172);
}else{
Position.prepare();
_172.moveBy(-Position.deltaX,-Position.deltaY);
_172.style.position="fixed";
}
_172.freezed=true;
},unfreezeElement:function(_173){
var _173=$(_173);
if(HiveLib.isIE){
this.freezed.removeItem(_173);
}else{
Position.prepare();
_173.moveBy(Position.deltaX,Position.deltaY);
_173.style.position="absolute";
}
},updateFreezedPosition:function(_174){
if(_174.style.position=="absolute"){
Position.prepare();
_174.freezedLeft=_174.Left()-Position.deltaX;
_174.freezedTop=_174.Top()-Position.deltaY;
}
},lastX:null,lastY:null,busy:false,onScroll:function(_175){
Position.prepare();
if(this.busy==false&&Position.deltaX!=this.lastX||Position.deltaY!=this.lastY){
this.lastX=Position.deltaX;
this.lastY=Position.deltaY;
this.busy=true;
for(var i=0;i<this.freezed.length;i++){
if(this.freezed[i].freezedLeft+Position.deltaX<document.body.scrollWidth&&this.freezed[i].freezedTop+Position.deltaY<document.body.scrollHeight){
this.freezed[i].moveTo(this.freezed[i].freezedLeft+Position.deltaX,this.freezed[i].freezedTop+Position.deltaY);
}
}
this.busy=false;
}
},semaphore:function(name,_178){
if(_178!=null){
this.semaphoresValue[name]=_178;
}
if(this.semaphoresValue[name]!=null){
return this.semaphoresValue[name];
}else{
return false;
}
},ITEMS_ZINDEX:1000,AVATARS_ZINDEX:5000,UI_ZINDEX:10000,topZ:function(_179){
switch(_179){
case this.HIDDEN_LAYER:
return -1;
break;
case this.ITEMS_LAYER:
return ++this.ITEMS_ZINDEX;
break;
case this.AVATARS_LAYER:
return ++this.AVATARS_ZINDEX;
break;
case this.UI_LAYER:
return ++this.UI_ZINDEX;
break;
default:
return 1;
}
},maxZ:function(_17a){
switch(_17a){
case this.HIDDEN_LAYER:
return -1;
break;
case this.ITEMS_LAYER:
return 4999;
break;
case this.AVATARS_LAYER:
return 9999;
break;
case this.UI_LAYER:
return HiveSettings.value("ACTIVE_ELEMENT_ZINDEX");
break;
default:
return 999;
}
},minZ:function(_17b){
switch(_17b){
case this.HIDDEN_LAYER:
return -1;
break;
case this.ITEMS_LAYER:
return 1000;
break;
case this.AVATARS_LAYER:
return 5000;
break;
case this.UI_LAYER:
return 10000;
break;
default:
return 999;
}
},inscribe:function(w,h,W,H){
if(W>0&&H>0){
var kW=w/W;
var kH=h/H;
if(kW>=kH){
var w1=W;
var h1=(h*w1)/w;
}else{
var h1=H;
var w1=(w*h1)/h;
}
return [w1,h1];
}else{
return [w,h];
}
},intersect:function(_184,_185){
var x1=Math.max(_184.left,_185.left);
var x2=Math.min(_184.right,_185.right);
var y1=Math.max(_184.top,_185.top);
var y2=Math.min(_184.bottom,_185.bottom);
return (y2>=y1&&x2>=x1);
},resize:function(_18a,_18b,_18c){
if(_18a.height>_18b||_18a.width>_18c){
var _18d=_18b/_18a.height;
var _18e=_18c/_18a.width;
var k=(_18d<_18e)?_18d:_18e;
if(_18a.resizeTo){
_18a.resizeTo(_18a.width*k,_18a.height*k);
}else{
var _190=_18a.width;
_18a.height=_18a.height*k;
if(_18a.width==_190){
_18a.width=_18a.width*k;
}
}
}
},resizeFrom:function(_191,_192,_193,_194,_195){
var _196=_193,newWidth=_192;
if(_193>_195||_192>_194){
var _197=_195/_193;
var _198=_194/_192;
var k=(_197<_198)?_197:_198;
_196=_193*k;
newWidth=_192*k;
}
if(_191.resizeTo){
_191.resizeTo(newWidth,_196);
}else{
var _19a=_191.width;
_191.height=_196;
if(_191.width==_19a){
_191.width=newWidth;
}
}
},fitImage:function(_19b,_19c,_19d,_19e){
if(_19e==null){
_19e=new Image();
_19e.src=_19b.src;
}
if(_19e.complete){
_19b.style.display="";
this.resizeFrom(_19b,_19e.width,_19e.height,_19c,_19d);
}else{
var self=this;
setTimeout(function(){
self.fitImage(_19b,_19c,_19d,_19e);
},100);
}
},getCorrectUrl:function(url){
if(url==null){
url="";
}
url=url.trim();
try{
if(url!=""){
if(url.substring(0,7)!="http://"&&url.substring(0,7)!="http:\\\\"){
if(url.substring(0,1)!="/"&&url.substring(0,1)!="\\"){
url="http://"+url;
}else{
url=HiveSettings.value("THIS_SERVER")+url;
}
}
}
}
catch(e){
}
return url;
},getLimitedString:function(_1a1,_1a2){
_1a1=unescape(_1a1);
if(_1a1.length>_1a2){
_1a1=_1a1.substr(0,_1a2)+"...";
}
return _1a1;
},getWrappedString:function(_1a3,_1a4){
var _1a5=_1a4;
while(_1a5<_1a3.length){
_1a3=_1a3.insert(_1a5,"<wbr>");
_1a5+=_1a4;
}
return _1a3;
},getCreatorLinkHtml:function(_1a6,_1a7,url,_1a9){
_1a6=_1a6||{};
_1a7=_1a7||null;
url=url||null;
if(_1a7==null){
if(_1a6.creatorAlias){
_1a7=_1a6.creatorAlias;
}else{
_1a7="";
}
}
if(url==null){
if(_1a6.creatorUrl){
url=_1a6.creatorUrl;
}else{
url="";
}
}
_1a7=unescape(_1a7).escapeHTML();
url=unescape(url);
if(_1a7==""){
_1a7="Hive7";
}
if(_1a9!=null){
_1a7=HiveLib.UI.getTruncStringByWidth("{0}",_1a7,_1a9);
}else{
_1a7=HiveLib.UI.getLimitedString(_1a7,40);
}
if(url==""){
return _1a7;
}else{
return "<a target='_blank' href='"+url+"' title='"+_1a7+"'>"+_1a7+"</a>";
}
},getUserLinkHtml:function(id){
var _1ab=$(id);
if(_1ab){
return this.getCreatorLinkHtml(_1ab,_1ab.alias,_1ab.profileUrl);
}
return "";
},getCopyrightHtml:function(){
if(HiveSettings.value("SCRIPT_VERSION")=="1.1"){
return "<span style=\"color:blue; font-family:Verdana ; font-size:7px;\">&copy; 2005-06 <a href=\"mai"+"lto"+":feedb"+"ack@"+"hive"+"7."+"com\" style=\"color:blue;text-decoration:none\" onmouseout=\"this.style.textDecoration='none'\" onmouseover=\"this.style.textDecoration='underline'\">Hive7.com, Inc.</a></span>";
}
return "<span style=\"color:#65BCBC; font-family:Verdana ; font-size:7px;\">&copy; 2005-06 <a href=\"mai"+"lto"+":feedb"+"ack@"+"hive"+"7."+"com\" style=\"color:#65BCBC;text-decoration:none\" onmouseout=\"this.style.textDecoration='none'\" onmouseover=\"this.style.textDecoration='underline'\">Hive7.com, Inc.</a></span>";
},getHTMLSize:function(html,_1ad,_1ae){
if(html&&html!=""){
if(!this.tempDiv){
this.tempDiv=document.createElement("div");
document.body.appendChild(this.tempDiv);
this.tempDiv.id="getHTMLSizePlaceholder";
if(HiveLib.isIE){
this.tempDiv.style.styleFloat="left";
}else{
this.tempDiv.style.cssFloat="left";
}
}
this.tempDiv.style.display="";
this.tempDiv.style.width="";
this.tempDiv.style.height="";
this.tempDiv.style.overflow="";
this.tempDiv.innerHTML=html;
if(!isNaN(_1ad)&&this.tempDiv.offsetWidth>_1ad){
this.tempDiv.style.width=_1ad+"px";
this.tempDiv.style.overflow="auto";
}
if(!isNaN(_1ae)&&this.tempDiv.offsetHeight>_1ae){
this.tempDiv.style.height=_1ae+"px";
this.tempDiv.style.overflow="auto";
}
var _1af={width:this.tempDiv.offsetWidth,height:this.tempDiv.offsetHeight};
this.tempDiv.innerHTML="";
this.tempDiv.style.display="none";
return _1af;
}else{
HiveLib.Debugger.trace("Warning","Attempt to calculate size for empty html",true);
return {width:0,height:0};
}
},getElementSize:function(_1b0,_1b1,_1b2){
if(_1b0){
if(!this.tempDiv2){
this.tempDiv2=document.createElement("div");
}
var _1b3=_1b0.cloneNode(true);
_1b3.style.display="";
_1b3.style.position="static";
_1b3.style.width="";
_1b3.style.height="";
var _1b4=_1b3.getElementsByTagName("iframe");
for(var i=0;i<_1b4.length;i++){
_1b4[i].src="about:blank";
}
var _1b4=_1b3.getElementsByTagName("frame");
for(var i=0;i<_1b4.length;i++){
_1b4[i].src="about:blank";
}
this.tempDiv2.appendChild(_1b3);
var _1b6=this.getHTMLSize(this.tempDiv2.innerHTML,_1b1,_1b2);
this.tempDiv2.innerHTML="";
return _1b6;
}else{
HiveLib.Debugger.trace("Warning","Attempt to calculate size for null element",true);
return {width:0,height:0};
}
},getRandomID:function(){
var date=new Date();
var _1b8=Math.random()+1;
_1b8*=parseInt(date.getHours()+1);
_1b8*=parseInt(date.getMinutes()+1);
_1b8*=parseInt(date.getSeconds()+1);
_1b8*=parseInt(date.getMilliseconds()+1);
return _1b8;
},getStringLength:function(_1b9){
var _1ba=0;
for(var i=0;i<_1b9.length;i++){
_1ba+=this.getCharWidth(_1b9.charCodeAt(i));
}
return _1ba;
},getTruncString:function(_1bc,_1bd){
if(_1bc.length==0){
_1bc="<unnamed>";
}
var _1be=0;
for(var i=0;i<_1bc.length;i++){
_1be+=this.getCharWidth(_1bc.charCodeAt(i));
if(_1be>_1bd){
if(i<3){
return _1bd==2?"..":".";
}
var _1c0=this.getCharWidth(_1bc.charCodeAt(i-1))+this.getCharWidth(_1bc.charCodeAt(i-2));
return _1c0==2?_1bc.slice(0,i-3)+"...":_1bc.slice(0,i-2)+"...";
}
}
return _1bc;
},getDisplayName:function(str,_1c2){
if(str.length!=0){
return str;
}
if(_1c2){
return _1c2;
}
return "<unnamed>";
},getTruncStringByWidth:function(_1c3,str,_1c5){
if(str==null||str.length==0){
return "";
}
if(!this.tructDiv){
this.tructDiv=document.createElement("div");
document.body.appendChild(this.tructDiv);
this.tructDiv.id="getTruncStringByWidthPlaceholder";
}
this.tructDiv.style.width=Math.max(_1c5,0)+"px";
var _1c6=str;
this.tructDiv.innerHTML=String.format(_1c3,str);
if(this.tructDiv.scrollWidth>this.tructDiv.offsetWidth){
var _1c7=str.length-1;
do{
_1c6=str.substr(0,_1c7--)+"...";
this.tructDiv.innerHTML=String.format(_1c3,_1c6);
}while(this.tructDiv.scrollWidth>this.tructDiv.offsetWidth&&_1c7>0);
}
return _1c6;
},doubleWidthChars:[109,119,64],getCharWidth:function(_1c8){
return (this.isUpper(_1c8)||this.isContains(_1c8,this.doubleWidthChars))?2:1;
},isUpper:function(_1c9){
return (_1c9>65&&_1c9<90);
},isContains:function(obj,_1cb){
for(var i=0;i<_1cb.length;i++){
if(obj==_1cb[i]){
return true;
}
}
return false;
},shiftElementIntoViewport:function(_1cd,_1ce){
if(_1cd.hiveType){
var left=_1cd.Left();
var top=_1cd.Top();
var _1d1=_1cd.Width();
var _1d2=_1cd.Height();
var _1d3=HiveLib.DOM.getWindowOffset();
var size=HiveLib.DOM.getWindowDimension();
size.width+=_1d3.left;
size.height+=_1d3.top;
if(_1ce&&_1ce.hiveType){
var Left=_1ce.Left();
var Top=_1ce.Top();
var _1d7=_1ce.Width();
var _1d8=_1ce.Height();
if(left+_1d1>size.width){
left=Left-_1d1;
}
if(left<_1d3.left){
left=Left+_1d7;
}
}
if(left+_1d1>size.width){
left=size.width-_1d1;
}
if(top+_1d2>size.height){
top=size.height-_1d2;
}
if(left<_1d3.left){
left=_1d3.left;
}
if(top<_1d3.top){
top=_1d3.top;
}
_1cd.moveTo(left,top);
}
}};
HiveLib.addStartup(function(){
if(HiveLib.isIE){
window.onscroll=HiveLib.UI.onScroll.bindAsEventListener(HiveLib.UI);
}
},HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST);
if(typeof (HiveSettings)!="undefined"){
HiveLib.addStartup(function(){
if(HiveSettings.value("IS_DEBUG")){
var _1d9=HiveLib.DOM.getServerControl("DebugWindow");
if(_1d9&&_1d9._display){
HiveLib.Debugger.showDebugWindow();
}
}
},HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_LOW);
}
HiveLib.Dispatcher={activeHiveObject:null,activeHiveObjectZIndex:0,nextUIZIndex:-1,activate:function(_1da,_1db){
if(_1da.isModal){
return;
}
if(_1db==true&&this.activeHiveObject==_1da){
return;
}
this.deactivate(_1da);
this.activeHiveObject=_1da;
this.activeHiveObjectZIndex=this.activeHiveObject.zIndex();
this.activeHiveObject.zIndex(HiveSettings.value("ACTIVE_ELEMENT_ZINDEX"));
},deactivate:function(_1dc){
if(this.activeHiveObject!=null){
if(this.activeHiveObjectZIndex>HiveLib.UI.minZ(HiveLib.UI.UI_LAYER)){
if(this.activeHiveObject!=_1dc){
if(this.nextUIZIndex==HiveLib.UI.maxZ(HiveLib.UI.UI_LAYER)){
alert("General Z-Index management error");
}
if(this.nextUIZIndex==-1){
this.nextUIZIndex=this.calculateNextUIZIndex();
}
this.activeHiveObject.zIndex(++this.nextUIZIndex);
}
}else{
this.activeHiveObject.zIndex(this.activeHiveObjectZIndex);
}
this.activeHiveObject=null;
}
},calculateNextUIZIndex:function(){
return HiveLib.UI.minZ(HiveLib.UI.UI_LAYER)+2000;
}};
HiveLib.Cookie={DEFAULT_COOKIE_AGE_DAYS:365,set:function(name,_1de,_1df,path,_1e1,_1e2){
var _1e3=name+"="+_1de+((_1df)?"; expires="+_1df.toGMTString():"")+((path)?"; path="+path:"")+((_1e1)?"; domain="+_1e1:"")+((_1e2)?"; secure":"");
document.cookie=_1e3;
},get:function(name){
var _1e5=name+"=";
var _1e6=document.cookie.indexOf(_1e5);
if(_1e6==-1){
return null;
}
var _1e7=document.cookie.indexOf(";",_1e6+_1e5.length);
if(_1e7==-1){
_1e7=document.cookie.length;
}
return document.cookie.substring(_1e6+_1e5.length,_1e7);
},remove:function(name,path,_1ea){
if(HiveLib.Cookie.get(name)){
document.cookie=name+"="+((path)?"; path="+path:"")+((_1ea)?"; domain="+_1ea:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
},getDefaultAge:function(){
var _1eb=new Date();
_1eb.setTime(_1eb.getTime()+HiveLib.Cookie.DEFAULT_COOKIE_AGE_DAYS*24*3600*1000);
return _1eb;
},requestLoginCookies:function(_1ec){
Hive7.IO.load("img",HiveSettings.value("LOGIN_SUBDOMAIN")+HiveLib.mapPath("login?"+HiveLib.UI.getRandomID()),_1ec);
}};
HiveLib.SystemEvents={awayTimer:null,onOnline:function(){
if((typeof HiveAvatar!="undefined")&&HiveAvatar.ownAvatar!=null){
HiveLib.UI.semaphore("IS_AUTOFOCUS_ENABLED",false);
}
},onAway:function(){
if((typeof HiveAvatar!="undefined")&&HiveAvatar.ownAvatar!=null){
HiveLib.Debugger.trace("Away");
HiveLib.UI.semaphore("IS_AUTOFOCUS_ENABLED",true);
}
}};
if(typeof (HiveSettings)!="undefined"){
HiveLib.addStartup(function(){
HiveLib.SystemEvents.onOnline();
},HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_HIGHEST);
}
HiveLib.Validator={isEmail:function(str){
return (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i.test(str));
},isNamespace:function(str){
return true;
},isRoomUrl:function(str,_1f0,_1f1){
var r=new RegExp(/^\/([^:?#%|^<>@!$&'()*+,;="\[\]\\\u0080-\uFFFF]+)$/);
_1f0=_1f0||"Room Address";
var _1f3="";
if(!r.test(str)){
_1f3+="Please enter correct "+_1f0+"."+"<br/>Use ASCII characters, except '<b>#</b>', '<b>\"</b>',"+" '<b>%</b>', '<b>&lt;</b>', '<b>&gt;</b>', '<b>?</b>',"+" '<b>:</b>', '<b>|</b>', '<b>^</b>', '<b>@</b>',"+" '<b>!</b>', '<b>$</b>', '<b>&</b>', '<b>'</b>',"+" '<b>(</b>', '<b>)</b>', '<b>*</b>', '<b>+</b>',"+" '<b>,</b>', '<b>;</b>', '<b>=</b>', '<b>[</b>',"+" '<b>]</b>', national characters.";
if(_1f1){
return {result:false,message:_1f3};
}
}
if(str.length<=HiveSettings.value("MIN_ROOM_TOKEN_LENGTH")){
_1f3+=(_1f3.length!=0)?"<br/>":"";
_1f3+="Your "+_1f0+" '"+str.substring(1)+"' is too short. We prefer longer and more descriptive room titles - please use at least "+HiveSettings.value("MIN_ROOM_TOKEN_LENGTH")+" letters.";
}
return {result:(_1f3.length==0),message:_1f3};
},getCorrectRoomUrl:function(_1f4){
var r=new RegExp(/[\s^:?#%|^<>@!$&'()*+,;="\[\]\\\u0080-\uFFFF]/ig);
return _1f4.replace(r,"");
}};
HiveLib.Audio={embeds:[],play:function(src,loop){
var _1f8=new Hive7.Media.Audio(src);
var _1f9=(this.embeds.push(_1f8)-1);
_1f8.play({loop:(loop!=null?loop:false)});
return _1f9;
},stop:function(_1fa){
if(this.embeds[_1fa]){
this.embeds[_1fa].stop();
}
},destroy:function(){
for(var i=0;i<this.embeds.length;i++){
this.embeds[i].destroy();
}
}};
HiveLib.JSChecker={invalidReason:"",isValid:function(){
return this.invalidReason=="";
},check:function(){
if(!Ajax.getTransport()){
this.invalidReason="ajax";
}
if(!HiveLib.JSChecker.isCookieEnabled()){
this.invalidReason="cookies";
}
if(!(HiveLib.isIE||HiveLib.isFirefox||HiveLib.isMozilla)){
this.invalidReason="browser";
}
if(HiveLib.isIE&&HiveLib.Browser.version<6){
this.invalidReason="version";
}
if(!this.isValid()){
document.location.replace(HiveLib.mapPath("p?nobrowser.aspx?reason="+this.invalidReason));
}
},isCookieEnabled:function(){
if(navigator.cookieEnabled!=null){
return navigator.cookieEnabled;
}else{
var name="isCookie";
var _1fd=HiveLib.random();
var _1fe=new Date();
_1fe.setTime(_1fe.getTime()+60*1000);
HiveLib.Cookie.set(name,_1fd,_1fe,"/");
if(HiveLib.Cookie.get(name)==_1fd){
HiveLib.Cookie.remove(name,"/");
return true;
}else{
return false;
}
}
}};
HiveLib.JSChecker.check();
HiveLib.GarbageCollector={clear:false,clearRoom:function(){
if(HiveLib.GarbageCollector.clear==true){
return;
}
Event.unloadCache();
HiveLib.GarbageCollector.clearBindCache();
if((HiveSettings.value("IS_GARBAGE").toString()=="true")){
try{
HiveLib.Profiler.trace("clearRoom() start");
HiveChatHistory.clearChatLog();
HiveLib.Profiler.trace("clearRoom() after HiveChatHistory.clearChatLog()");
HiveLib.Audio.destroy();
HiveLib.Profiler.trace("clearRoom() after HiveLib.Audio.destroy()");
HiveLib.GarbageCollector.clearEvents();
HiveLib.Profiler.trace("clearRoom() after HiveLib.GarbageCollector.clearEvents()");
HiveLib.Profiler.trace("clearRoom() after Event.unloadCache()");
HiveLib.Profiler.trace("clearRoom() stop");
}
catch(e){
}
}
if(HiveLib.isIE){
CollectGarbage();
}
HiveLib.GarbageCollector.clear=true;
window.onunload=null;
},clearMenus:function(){
var _1ff=HiveLib.DOM.getElementsByTagAndClassName("UL","systemMenu");
for(var i=0;i<_1ff.length;i++){
_1ff[i].destroy();
}
},clearEvents:function(){
if(document.all){
var _201=["data","onmouseover","onmouseout","onmousedown","onmouseup","ondblclick","onclick","onselectstart","oncontextmenu"];
var el;
for(var d=document.all.length;d--;){
el=document.all[d];
for(var c=_201.length;c--;){
el[_201[c]]=null;
}
}
}
},clearBindCache:function(){
},clearItems:function(){
for(var i=0;i<HiveItem.items.length;i++){
HiveItem.items[i]=null;
}
HiveItem.items=false;
},clearServerControls:function(){
if(HiveLib.DOM.ServerControls){
for(i in HiveLib.DOM.ServerControls){
if(typeof HiveLib.DOM.ServerControls[i]!="function"){
HiveLib.DOM.ServerControls[i]=null;
}
}
HiveLib.DOM.ServerControls=false;
}
},clearFunctions:function(_206,_207){
_207=(_207==true);
if(_206&&_206.tagName){
if(_206.attributes){
for(var i=0;i<_206.attributes.length;i++){
if(typeof _206[_206.attributes[i].name]==="function"){
_206[_206.attributes[i].name]=null;
}
}
}
if(_207){
if(children=_206.childNodes){
for(var i=0;i<children.length;i++){
HiveLib.GarbageCollector.clearFunctions(children[i],_207);
}
}
}
}
},cleanupSWFs:function(){
if(window.opera||!document.all){
return;
}
var _209=document.getElementsByTagName("OBJECT");
for(var i=0;i<_209.length;i++){
_209[i].style.display="none";
for(var x in _209[i]){
if(typeof _209[i][x]=="function"){
_209[i][x]=function(){
};
}
}
}
}};
HiveLib.addFinalize(HiveLib.GarbageCollector.clearRoom);
HiveLib.addFinalize(HiveLib.GarbageCollector.cleanupSWFs);
Event.observe(window,"beforeunload",function(){
__flash_unloadHandler=function(){
};
__flash_savedUnloadHandler=function(){
};
});
HiveLib.Layout={getLoadingIndicatorImage:function(_20c,_20d,_20e){
if(!_20c){
_20c=32;
}
if(!_20d){
_20d=32;
}
if(!_20e){
_20e="";
}else{
_20e="class = \""+_20e+"\"";
}
switch(HiveSettings.value("SCRIPT_VERSION")){
case "1.0":
return "<img src=\""+HiveLib.findRes("site/smallloadinganimation.gif")+"\" "+_20e+" border=\"0\" alt=\"\" width=\"25\" height=\"25\" align=\"absmiddle\" style=\"margin-right:5px;\">";
break;
case "1.1":
return "<img src=\""+HiveLib.findRes("site/loading.gif")+"\" "+_20e+" width=\""+_20c+"\" height=\""+_20d+"\" border=\"0\" alt=\"\" align=\"absmiddle\" style=\"margin-right:5px;\">";
break;
default:
return "<img src=\""+HiveLib.findRes("site/spacer.gif")+"\" "+_20e+" border=\"0\" alt=\"\" width=\"1\" height=\"1\">";
}
},getTransparentLoadingImage:function(_20f,_210,_211){
if(!_20f){
_20f=32;
}
if(!_210){
_210=32;
}
if(!_211){
_211="";
}else{
_211="class = \""+_211+"\"";
}
return "<img src=\""+HiveLib.findRes("site/loading1.gif")+"\" "+_211+" width=\""+_20f+"\" height=\""+_210+"\" border=\"0\" alt=\"\" align=\"absmiddle\" style=\"margin-right:5px;\">";
},defaultNoteHtml:"<div class=\"noteElement\">"+"\t<div class=\"noteNW\"></div><div class=\"noteNE\"></div>"+"\t<div class=\"noteHeader\">"+"\t\t<span class=\"noteTitle\">Note title</span>"+"\t</div>"+"\t<div class=\"noteContent\">Note Content...</div>"+"\t<div class=\"noteBottomLine\"></div>"+"</div>"};
HiveLib.Env={isInRoom:function(){
if(typeof HiveRoom!="undefined"){
if(HiveRoom.id&&HiveRoom.id.length>0){
return true;
}
}
return false;
}};
if(HiveSettings.value("SCRIPT_VERSION")=="1.1"){
HiveLib.Security={TRANSLATE_TABLE:{"MoveItem":"MoveOwnItem","ChangeItem":"ChangeOwnItem","ChangeItemScript":"ChangeOwnItemScript","DeleteItem":"DeleteOwnItem"},hasRights:function(_212,_213){
this.assertPemissionsTable();
var _214=_212.split(",");
for(var i=0;i<_214.length;i++){
_212=_214[i];
if(_213&&_213.ownerID&&HiveAvatar.ownAvatar&&_213.ownerID==HiveAvatar.ownAvatar.id&&HiveLib.Security.TRANSLATE_TABLE[_212]){
_212=HiveLib.Security.TRANSLATE_TABLE[_212];
}
if(this.permissionsTable[_212]==0){
return false;
}
}
return true;
},needTrust:function(_216,_217){
this.assertPemissionsTable();
var _218=_216.split(",");
for(var i=0;i<_218.length;i++){
_216=_218[i];
if(_217&&_217.ownerID&&HiveAvatar.ownAvatar&&_217.ownerID==HiveAvatar.ownAvatar.id&&HiveLib.Security.TRANSLATE_TABLE[_216]){
_216=HiveLib.Security.TRANSLATE_TABLE[_216];
}
if(this.permissionsTable[_216]==1){
return true;
}
}
return false;
},assertPemissionsTable:function(){
if(!this.permissionsTable&&typeof HiveUserPermissionsTable!="undefined"){
this.updatePemissionsTable(HiveUserPermissionsTable);
}
},updatePemissionsTable:function(_21a){
this.permissionsTable=_21a;
},getSignInMessage:function(_21b){
return "Please "+this.signInLink()+" "+_21b;
},signInLink:function(){
return "<a href='javascript:void(0);' onclick='Hive7.UIManager.openDialog(\"UserLogin\");'>sign in</a>";
},registerLink:function(){
return "<a href='javascript:void(0);' onclick='Hive7.UIManager.openDialogWindow(\"UserRegistration\");'>register</a>";
},encryptString:function(_21c,_21d){
return encryptedString(new RSAKeyPair(_21d.PubKeyExp,"",_21d.PubKeyMod),escape(_21c));
}};
Hive7.Viewport={viewport:null,viewportNode:null,isGlobalViewport:true,initialize:function(_21e){
if($(_21e)){
Hive7.Viewport.viewport=$(_21e);
Hive7.Viewport.viewportNode=$(_21e);
Hive7.Viewport.isGlobalViewport=false;
Hive7.Viewport.Header=new Hive7.Element($("header"));
Hive7.Viewport.TopPanel=new Hive7.Element($("topPanel"));
Hive7.Viewport.ViewportPanel=new Hive7.Element(_21e);
Hive7.Viewport.eventWindowResize=new Hive7.DomEvent(window,"resize");
Hive7.Viewport.eventWindowResize.addEventListener(Hive7.Viewport.onWindowResize);
Hive7.Viewport.eventWindowResize.dispatchEvent();
}else{
Hive7.Viewport.viewport=document;
Hive7.Viewport.viewportNode=document.body;
}
},startup:function(){
if(!Hive7.Viewport.viewport){
Hive7.Viewport.initialize();
}
},finalize:function(){
Hive7.Viewport.eventWindowResize.destroy();
},onWindowResize:function(_21f){
var size=Hive7.DOM.getViewportSize();
Hive7.Viewport.ViewportPanel.resizeTo(size.width,size.height-Hive7.Viewport.Header.Height());
HiveLib.Debugger.trace(Hive7.Viewport.ViewportPanel.domNode.scrollWidth,size-18);
Hive7.Viewport.TopPanel.resizeTo(Hive7.Viewport.ViewportPanel.domNode.scrollWidth||(size-18),Hive7.Viewport.TopPanel.Height());
},getViewport:function(){
if(!Hive7.Viewport.viewport){
Hive7.Viewport.initialize();
}
return Hive7.Viewport.viewport;
},getViewportNode:function(){
if(!Hive7.Viewport.viewportNode){
Hive7.Viewport.initialize();
}
return Hive7.Viewport.viewportNode;
},getViewportAspect:function(){
if(!Hive7.Viewport.viewport){
Hive7.Viewport.initialize();
}
if(!Hive7.Viewport.isGlobalViewport){
return {left:Hive7.Viewport.viewport.scrollLeft,top:Hive7.Viewport.viewport.scrollTop,width:Hive7.Viewport.ViewportPanel.Width(),height:Hive7.Viewport.ViewportPanel.Height()};
}else{
var size=HiveLib.DOM.getWindowDimension();
var _222=HiveLib.DOM.getWindowOffset();
return {left:_222.left,top:_222.top,width:size.width,height:size.height};
}
},getEventPointer:function(_223){
if(!Hive7.Viewport.viewport){
Hive7.Viewport.initialize();
}
var _224={x:Event.pointerX(_223),y:Event.pointerY(_223)};
if(!Hive7.Viewport.isGlobalViewport){
_224.x=_224.x-Hive7.Viewport.viewport.offsetLeft+Hive7.Viewport.viewport.scrollLeft;
_224.y=_224.y-Hive7.Viewport.viewport.offsetTop+Hive7.Viewport.viewport.scrollTop;
}
return _224;
},isPointerInViewport:function(_225){
var x=Event.pointerX(_225);
var y=Event.pointerY(_225);
},getViewportPoint:function(_228,_229){
if(!Hive7.Viewport.isGlobalViewport){
return {left:_228-Hive7.Viewport.viewport.offsetLeft+Hive7.Viewport.viewport.scrollLeft,top:_229-Hive7.Viewport.viewport.offsetTop+Hive7.Viewport.viewport.scrollTop};
}else{
return {left:_228,top:_229};
}
},getBodyPoint:function(_22a,_22b){
if(!Hive7.Viewport.isGlobalViewport){
return {left:_22a+Hive7.Viewport.viewport.offsetLeft-Hive7.Viewport.viewport.scrollLeft,top:_22b+Hive7.Viewport.viewport.offsetTop-Hive7.Viewport.viewport.scrollTop};
}else{
return {left:_22a,top:_22b};
}
}};
HiveLib.addStartup(Hive7.Viewport.startup,4);
}
Hive7.Utility={isString:function(str){
return (typeof (str.toUpperCase)=="function");
}};
Hive7.Core={loadScript:function(url,_22e){
Hive7.IO.load("SCRIPT",url,_22e);
},loadScriptsByList:function(_22f,_230){
Hive7.IO.load("SCRIPT",_22f,_230);
}};
Hive7.IO={cache:[],acceptedTypes:["SCRIPT","IMG"],load:function(type,src,_233){
type=String(type).toUpperCase();
if(Hive7.IO.acceptedTypes.indexOf(type)>=0){
var _234=[];
if(src!=null){
_234=(src instanceof Array)?src:[src];
}
var _235=function(_236,_237){
for(var i=0,length=_234.length;i<length;i++){
if(!Hive7.IO.inCache(_234[i])){
return;
}
}
if(typeof _233=="function"){
_233(_236,_237);
}
_233=null;
};
if(_234.length>0){
for(var i=0,length=_234.length;i<length;i++){
Hive7.IO.request(type,_234[i],_235);
}
}else{
_235(null,false);
}
}else{
}
},request:function(type,src,_23c){
if(Hive7.IO.cache[src]){
Hive7.IO.cache[src].observers.push(_23c);
if(Hive7.IO.cache[src].complete==true){
Hive7.IO.executeObservers(src);
}
}else{
var _23d=document.createElement(type);
Hive7.IO.cache[src]={complete:false,status:false,observers:[_23c],element:_23d};
if(HiveLib.isIE){
_23d.onreadystatechange=function(){
if(_23d.readyState=="loaded"||_23d.readyState=="complete"){
_23d.onreadystatechange=null;
Hive7.IO.cache[src].complete=true;
Hive7.IO.cache[src].status=true;
Hive7.IO.executeObservers(src);
}
};
}else{
_23d.onload=function(){
_23d.onload=null;
Hive7.IO.cache[src].complete=true;
Hive7.IO.cache[src].status=true;
Hive7.IO.executeObservers(src);
};
}
_23d.onerror=function(){
_23d.onload=null;
Hive7.IO.cache[src].complete=true;
Hive7.IO.cache[src].status=false;
Hive7.IO.executeObservers(src);
};
switch(type){
case "SCRIPT":
_23d.type="text/javascript";
_23d.src=HiveLib.findRes(src);
document.getElementsByTagName("head")[0].appendChild(_23d);
break;
case "IMG":
_23d.src=HiveLib.findRes(src);
break;
}
}
},executeObservers:function(url,_23f){
if(Hive7.IO.cache[url]){
while(Hive7.IO.cache[url].observers.length>0){
if(typeof Hive7.IO.cache[url].observers[0]=="function"){
try{
Hive7.IO.cache[url].observers[0](Hive7.IO.cache[url].element,Hive7.IO.cache[url].status);
}
catch(e){
HiveLib.Debugger.traceException("Observer of \""+url+"\"",e);
}
}
var _240=Hive7.IO.cache[url].observers.shift();
_240=null;
}
}
},inCache:function(src){
return (Hive7.IO.cache[src]&&Hive7.IO.cache[src].complete==true);
}};
function $e(s){
return escape(s);
}
function $u(s){
return unescape(s);
}
function $item(id){
var item=$(id);
if(item&&item.hiveType=="hiveItem"){
return item;
}else{
return null;
}
}
function $avatar(id){
var item=$(id);
if(item&&item.hiveType=="hiveAvatar"){
return item;
}else{
return null;
}
}
Object.clone=function(obj){
try{
var _249=new obj.constructor();
for(var _24a in obj){
if(obj[_24a]!=null&&typeof obj[_24a]=="object"){
_249[_24a]=Object.clone(obj[_24a]);
}else{
_249[_24a]=obj[_24a];
}
}
return _249;
}
catch(e){
return obj;
}
};
var HivePrototype={bindCache:{elements:{},handlers:{}}};
Function.prototype.bindWithParams=function(_24b){
var _24c=this;
var _24d=arguments;
var _24e=function(){
var pars=new Array();
for(var i=0;i<arguments.length;i++){
pars.push(arguments[i]);
}
for(var i=1;i<_24d.length;i++){
pars.push(_24d[i]);
}
return _24c.apply(_24b,pars);
};
_24e.owner=_24b;
return _24e;
};
String.prototype.insert=function _String_insert(_251,str){
return this.substr(0,_251-1)+str+this.substr(_251-1);
};
String.prototype.trim=function _String_trim(){
return this.replace(/(^\s*)|(\s*$)/g,"");
};
String.prototype.startsWith=function _String_startsWith(s){
return this.indexOf(s)==0;
};
String.prototype.endsWith=function _String_endsWith(s){
return this.lastIndexOf(s)==(this.length-s.length);
};
String.randomNumberString=function(_255){
var _256=""+(Math.random()+0.1)*Math.pow(10,_255);
return _256.substr(0,_255);
};
String.prototype.jsmask=function(){
return this.replace(/\"/g,"&quot;");
};
String.format=function(tmpl){
for(var i=1;i<arguments.length;i++){
re=new RegExp("\\{"+(i-1)+"\\}","gi");
tmpl=tmpl.replace(re,arguments[i]);
}
return tmpl;
};
String.htmlentities=function(str){
return String(str).replace(/</g,"&lt;").replace(/>/g,"&gt;");
};
Number.prototype.zeroBaseString=function _Number_zeroBaseString(n){
var str=this.toString();
while(str.length<n){
str="0"+str;
}
return str;
};
Date.prototype.date=function _Date_date(_25c){
var _25d=new Array();
var _25e=_25c;
_25d["%d"]=this.getDate();
_25d["%D"]=Number(this.getDate()).zeroBaseString(2);
_25d["%m"]=this.getMonth()+1;
_25d["%M"]=Number(this.getMonth()+1).zeroBaseString(2);
_25d["%n"]=Date.shortMonths[this.getMonth()];
_25d["%N"]=Date.fullMonths[this.getMonth()];
_25d["%y"]=this.getYear();
_25d["%Y"]=this.getFullYear();
var _25f=this.getHours();
var _260=(_25f>12)?(_25f-12):(_25f);
_260=(_260==0)?(12):(_260);
_25d["%h"]=_25f;
_25d["%H"]=Number(_25f).zeroBaseString(2);
_25d["%g"]=_260;
_25d["%G"]=Number(_25d["%g"]).zeroBaseString(2);
_25d["%i"]=this.getMinutes();
_25d["%I"]=Number(this.getMinutes()).zeroBaseString(2);
_25d["%S"]=Number(this.getSeconds()).zeroBaseString(2);
_25d["%a"]=(_25f>11)?("pm"):("am");
_25d["%A"]=(_25f>11)?("PM"):("AM");
_25d["%b"]=(_25f>11)?("p"):("a");
_25d["%B"]=(_25f>11)?("P"):("A");
for(key in _25d){
var _261=_25d[key];
var reg=new RegExp(key,"g");
_25e=_25e.replace(reg,_261);
}
return _25e;
};
Date.shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
Date.fullMonths=["January","February","March","April","May","June","July","August","September","October","November","December"];
Array.prototype.indexOf=function(item){
for(var i=0;i<this.length;i++){
if(this[i]==item){
return i;
}
}
return -1;
};
Array.prototype.remove=function(dx){
if(isNaN(dx)||dx>this.length){
return false;
}
this[dx]=null;
for(var i=0,n=0;i<this.length;i++){
if(i!=dx){
this[n++]=this[i];
}
}
this.length-=1;
};
Array.prototype.removeItem=function(item){
for(var i=0;i<this.length;i++){
if(this[i]==item){
this.remove(i);
break;
}
}
};
Array.prototype.insert=function(_269,item){
if(_269>=0){
if(_269>=this.length){
_269=this.length;
}
for(var i=this.length;i>=(_269+1);i--){
this[i]=this[i-1];
}
this[_269]=item;
return true;
}
return false;
};
if(!Array.prototype.shift){
Array.prototype.shift=function(){
if(this.length>0){
var _26c=this[0];
for(var i=1;i<length;i++){
this[i-1]=this[i];
}
this[this.length-1]=null;
this.length--;
return _26c;
}else{
return null;
}
};
}
Object.extend(Event,{KEY_UPLEFT:36,KEY_UPRIGHT:33,KEY_DOWNLEFT:35,KEY_DOWNRIGHT:34,KEY_SPACE:32,KEY_ANY:-1,MOUSE_LEFT:1,MOUSE_RIGHT:2,MOUSE_MIDDLE:3,isRightClick:function(_26e){
return (((_26e.which)&&(_26e.which==3))||((_26e.button)&&((_26e.button&2)==2)));
},keyCode:function(_26f){
return _26f.which?_26f.which:(_26f.keyCode?_26f.keyCode:(_26f.charCode?_26f.charCode:0));
},relatedTarget:function(_270){
return _270.relatedTarget||_270.toElement;
}});
Event.dummyEventListener=function(_271){
_271=_271||window.event;
Event.stop(_271);
};
Object.extend(Ajax.Request.prototype,{respondToReadyState:function(_272){
if(this.transport==null){
return;
}
try{
var _273=Ajax.Request.Events[_272];
}
catch(e){
return;
}
if(_273=="Complete"){
try{
(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(this.transport);
}
catch(e){
}
var _274;
try{
_274=this.transport.status;
}
catch(e){
_274=13030;
}
switch(_274){
case 12002:
case 12029:
case 12030:
case 12031:
case 12152:
case 13030:
(this.options["onException"]||Prototype.emptyFunction)("Connection lost with status "+_274+".<br>Trying to restore.");
return;
break;
}
}
(this.options["on"+_273]||Prototype.emptyFunction)(this.transport);
if(_273=="Complete"){
this.transport.onreadystatechange=Prototype.emptyFunction;
}
}});
AJAXSender=Class.create();
Object.extend(Object.extend(AJAXSender.prototype,Ajax.Request.prototype),{initialize:function(url){
this.transport=Ajax.getTransport();
this.url=url;
},request:function(){
if(this.transport.readyState==4||this.transport.readyState==0){
var _276=this.options.parameters||"";
if(_276.length>0){
_276+="&_=";
}
try{
if(this.options.method=="get"){
this.url+="?"+_276;
}
this.transport.open(this.options.method,this.url,this.options.asynchronous);
if(this.options.asynchronous){
this.transport.onreadystatechange=this.onStateChange.bind(this);
setTimeout((function(){
this.respondToReadyState(1);
}).bind(this),10);
}
this.setRequestHeaders();
var body=this.options.postBody?this.options.postBody:_276;
this.transport.send(this.options.method=="post"?body:null);
}
catch(e){
}
}
}});
Object.extend(String.prototype,{camelize:function(){
var _278=this.split("-");
if(_278.length==1){
return _278[0];
}
var _279=this.indexOf("-")==0?_278[0].charAt(0).toUpperCase()+_278[0].substring(1):_278[0];
for(var i=1,len=_278.length;i<len;i++){
var s=_278[i];
_279+=s.charAt(0).toUpperCase()+s.substring(1);
}
return _279;
},inspect:function(){
return "'"+this.replace("\\","\\\\").replace("'","\\'")+"'";
}});
Object.extend(Element,{cleanWhitespace:function(_27c){
_27c=$(_27c);
for(var i=0;i<_27c.childNodes.length;i++){
var node=_27c.childNodes[i];
if(node.nodeType==3&&!/\S/.test(node.nodeValue)){
Element.remove(node);
}
}
},getStyle:function(_27f,_280){
_27f=$(_27f);
var _281=_27f.style[_280.camelize()];
if(!_281){
if(document.defaultView&&document.defaultView.getComputedStyle){
var css=document.defaultView.getComputedStyle(_27f,null);
_281=css?css.getPropertyValue(_280):null;
}else{
if(_27f.currentStyle){
_281=_27f.currentStyle[_280.camelize()];
}
}
}
if(window.opera&&["left","top","right","bottom"].include(_280)){
if(Element.getStyle(_27f,"position")=="static"){
_281="auto";
}
}
return _281=="auto"?null:_281;
},setStyle:function(_283,_284){
_283=$(_283);
for(name in _284){
_283.style[name.camelize()]=_284[name];
}
}});
var HiveLoader={images:[],preloadImages:function(){
for(var i=0;i<arguments.length;i++){
if(this.images[arguments[i]]==null){
this.images[arguments[i]]=new Image();
}
}
},start:function(){
for(image in this.images){
if(typeof this.images[image]!="function"){
this.images[image].src=image;
}
}
},loadAll:function(_286,_287,_288,_289,_28a){
if(_286.length==0){
return;
}
var src=_286.shift();
var self=this;
HiveLoader.load(src,_286.length==1?_287:function(){
self.loadAll(_286,_287,_288,_289,_28a);
},_288,_289,_28a);
},load:function(src,_28e,_28f,_290,_291,_292){
var img=new Image();
_28e=(typeof _28e=="function")?_28e:Prototype.emptyFunction;
_28f=(typeof _28f=="function")?_28f:Prototype.emptyFunction;
if(src!=""){
img.onLoadHandler=_28e;
img.onErrorHandler=_28f;
img.interval=Math.round((_290)?_290:100);
img.attempts=Math.round((_291)?_291:100);
if(_292!==undefined){
img.userParams=_292;
}
img.src=src;
img.loadedSrc=src;
if(img.complete){
if(img.width==0&&img.height==0){
HiveLib.Debugger.trace("Warning","Image loading failed - "+this.src,true);
img.onErrorHandler(img);
}else{
img.onLoadHandler(img);
}
}else{
img.checkStatus=HiveLoader.checkStatus;
img.cycles=0;
img.timer=setTimeout(img.checkStatus.bind(img),img.interval);
}
}else{
HiveLib.Debugger.trace("Warning","Attempt to load image with empty SRC",true);
_28f(img);
}
return img;
},checkStatus:function(){
if(this.timer){
clearTimeout(this.timer);
}
if(this.complete){
if(this.width==0&&this.height==0){
HiveLib.Debugger.trace("Warning","Image loading failed - "+this.src,true);
this.onErrorHandler(this);
}else{
this.onLoadHandler(this);
}
}else{
if(this.cycles++==this.attempts){
HiveLib.Debugger.trace("Warning","Image loading failed - "+this.src,true);
this.onErrorHandler(this);
}else{
this.timer=setTimeout(this.checkStatus.bind(this),this.interval);
}
}
},stopLoading:function(img){
if(img.timer){
clearTimeout(img.timer);
}
},load2:function(src,_296,_297,_298,_299,_29a){
if(!HiveLib.isIE){
return HiveLoader.load(src,_296,_297,_298,_299,_29a);
}else{
var img=new Image();
_296=(typeof _296=="function")?_296:Prototype.emptyFunction;
_297=(typeof _297=="function")?_297:Prototype.emptyFunction;
if(src!=""){
if(_29a!==undefined){
img.userParams=_29a;
}
img.onload=function(){
img.onload=null;
img.onerror=null;
_296(img);
};
img.onerror=function(){
img.onload=null;
img.onerror=null;
HiveLib.Debugger.trace("Warning","Image loading failed - "+this.src,true);
_297(img);
};
img.loadedSrc=src;
img.src=src;
}else{
HiveLib.Debugger.trace("Warning","Attempt to load image with empty SRC",true);
_297(img);
}
return img;
}
}};
var HivePreloaderPage={images:[],count:0,loaded:0,showProgress:false,timer:null,timerLocal:null,finish:function(){
if(this.timer!=null){
clearTimeout(this.timer);
}
if(this.target!=null){
window.location.replace(this.target);
}else{
window.location.reload();
}
},prepare:function(){
this.percentsLabel=$("percentsLabel");
this.progressGauss=$("progressGauss");
this.showProgress=true;
},progress:function(){
if(this.showProgress){
this.loaded++;
var _29c=parseInt(Math.floor(this.loaded*100/this.count));
if(!isNaN(_29c)){
if(this.percentsLabel){
this.percentsLabel.innerHTML=_29c+"%";
}
if(this.progressGauss){
this.progressGauss.style.width=_29c+"%";
}
}
}
},process:function(_29d){
this.target=_29d;
this.count=arguments.length-1;
this.loaded=0;
this.timer=setTimeout(this.finish.bindAsEventListener(this),HiveSettings.value("PRELOAD_TIMEOUT"));
this.timerLocal=setTimeout(this.update.bindAsEventListener(this),200);
for(var i=1;i<this.count;i++){
var src=arguments[i];
var img=new Image();
img.src=src;
if(img.complete){
this.progress(src);
}else{
this.images.push(img);
}
}
},update:function(){
var _2a1=this.images.length;
var _2a2=0;
for(var i=0;i<_2a1;i++){
if(this.images[i].complete){
_2a2++;
if(!this.images[i].ready){
this.images[i].ready=true;
this.progress(this.images[i].src);
}
}
}
if(_2a2==_2a1){
this.finish();
}else{
this.timerLocal=setTimeout(this.update.bindAsEventListener(this),200);
}
}};
HiveLib.addStartup(function(){
HiveLoader.start();
},HiveLib.CLIENT_LOAD_SCRIPT_PRIORITY_LOW);

