var SMW_AJAX_GENERAL=0,AjaxRequestManager=function(){};
AjaxRequestManager.prototype={initialize:function(){this.calls=[]},addCall:function(a,b){var c=b==undefined?0:b;if(this.calls[c]==undefined)this.calls[c]=[];this.calls[c].push(a)},removeCall:function(a,b){var c=b==undefined?0:b;if(this.calls[c]!=undefined)for(var d=0,e=this.calls[c].length;d<e;d++){var f=this.calls[c].indexOf(a);f!=-1&&this.calls[c].splice(f,1)}},stopCalls:function(a,b){var c=a==undefined?0:a;if(this.calls[c]!=undefined){for(var d=0,e=this.calls[c].length;d<e;d++)if(this.calls[c][d]){this.calls[c][d].abort();
delete this.calls[c][d];this.calls[c][d]=null}this.calls.splice(c,1);b&&b()}}};var ajaxRequestManager=new AjaxRequestManager;ajaxRequestManager.initialize();var sajax_debug_mode=false,sajax_request_type="POST",NULL=function(){};
function sajax_debug(a){if(!sajax_debug_mode)return false;var b=document.getElementById("sajax_debug");if(!b){b=document.createElement("p");b.className="sajax_debug";b.id="sajax_debug";var c=document.getElementsByTagName("body")[0];c.firstChild?c.insertBefore(b,c.firstChild):c.appendChild(b)}c=document.createElement("div");c.appendChild(document.createTextNode(a));b.appendChild(c);return true}
function sajax_init_object(){sajax_debug("sajax_init_object() called..");var a;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){a=null}}if(!a&&typeof XMLHttpRequest!="undefined")a=new XMLHttpRequest;a||sajax_debug("Could not create connection object.");return a}
function sajax_do_call(a,b,c,d){var e,f,g,h;d=d?d:0;g=wgServer+wgScriptPath+"/index.php?action=ajax";if(sajax_request_type=="GET"){g=g.indexOf("?")==-1?g+"?rs="+encodeURIComponent(a):g+"&rs="+encodeURIComponent(a);for(e=0;e<b.length;e++)g=g+"&rsargs[]="+encodeURIComponent(b[e]);h=null}else{h="rs="+encodeURIComponent(a);for(e=0;e<b.length;e++)h=h+"&rsargs[]="+encodeURIComponent(b[e])}f=sajax_init_object();if(!f){alert("AJAX not supported");return false}try{f.open(sajax_request_type,g,true)}catch(i){window.location.hostname==
"localhost"&&alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.");throw i;}if(sajax_request_type=="POST"){f.setRequestHeader("Method","POST "+g+" HTTP/1.1");f.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}f.setRequestHeader("Pragma","cache=yes");f.setRequestHeader("Cache-Control","no-transform");f.onreadystatechange=function(){d!=0&&ajaxRequestManager.removeCall(f,d);if(f.readyState==4){sajax_debug("received ("+f.status+
" "+f.statusText+") "+f.responseText);if(typeof c=="function")c(f);else if(typeof c=="object")if(c.tagName=="INPUT"){if(f.status==200)c.value=f.responseText}else c.innerHTML=f.status==200?f.responseText:"<div class='error'>Error: "+f.status+" "+f.statusText+" ("+f.responseText+")</div>";else alert("bad target for sajax_do_call: not a function or object: "+c);f.onreadystatechange=NULL;delete f}};sajax_debug(a+" uri = "+g+" / post = "+h);f.send(h);d!=0&&ajaxRequestManager.addCall(f,d);sajax_debug(a+
" waiting..");delete f;return true}function sajax_do_call_jq(a,b,c){var d,e=typeof c!=="undefined";jQuery.ajax({type:"POST",url:wgServer+wgScriptPath+"/index.php?action=ajax",data:{rs:a,"rsargs[]":b},dataType:"html",async:e,success:function(f,g,h){if(e)c(h);else d=f}});return d};function BrowserDetectLite(){var a=navigator.userAgent.toLowerCase();this.isMozilla=(this.isGecko=a.indexOf("gecko")!=-1||a.indexOf("safari")!=-1)&&a.indexOf("gecko/")+14==a.length;this.isNS=this.isGecko?a.indexOf("netscape")!=-1:a.indexOf("mozilla")!=-1&&a.indexOf("spoofer")==-1&&a.indexOf("compatible")==-1&&a.indexOf("opera")==-1&&a.indexOf("webtv")==-1&&a.indexOf("hotjava")==-1;this.isIE=a.indexOf("msie")!=-1&&a.indexOf("opera")==-1&&a.indexOf("webtv")==-1;this.isOpera=a.indexOf("opera")!=-1;this.isSafari=
a.indexOf("safari")!=-1;this.isKonqueror=a.indexOf("konqueror")!=-1;this.isIcab=a.indexOf("icab")!=-1;this.isAol=a.indexOf("aol")!=-1;this.isWebtv=a.indexOf("webtv")!=-1;this.isGeckoOrOpera=this.isGecko||this.isOpera;this.isGeckoOrSafari=this.isGecko||this.isSafari}var OB_bd=new BrowserDetectLite;GeneralBrowserTools={};
GeneralBrowserTools.getCookie=function(a){var b=null;if(document.cookie!=""){var c=document.cookie.indexOf(a+"=");if(c>=0){c=c+a.length+1;a=document.cookie.indexOf(";",c);if(a<0)a=document.cookie.length;b=document.cookie.substring(c,a);b=unescape(b)}}return b};GeneralBrowserTools.setCookieObject=function(a,b){var c=Object.toJSON(b);document.cookie=a+"="+c};GeneralBrowserTools.getCookieObject=function(a){a=GeneralBrowserTools.getCookie(a);var b;try{b=a.evalJSON(false)}catch(c){return null}return b};
GeneralBrowserTools.selectAllCheckBoxes=function(a){$(a).getInputs("checkbox").each(function(b){b.checked=!b.checked})};GeneralBrowserTools.getSelectedText=function(a){if(OB_bd.isGecko)var b=a.value.substring(a.selectionStart,a.selectionEnd);else if(OB_bd.isIE)b=document.selection.createRange().text;return b};
GeneralBrowserTools.isTextSelected=function(a){if(OB_bd.isGecko){if(a.selectionStart!=a.selectionEnd)return true}else if(OB_bd.isIE)if(document.selection.createRange().text.length>0)return true;return false};GeneralBrowserTools.purge=function(a){if(OB_bd.isIE){var b=a.attributes,c,d,e;if(b){d=b.length;for(c=0;c<d;c+=1)if(b[c]){e=b[c].name;if(typeof a[e]==="function")a[e]=null}}if(b=a.childNodes){d=b.length;for(c=0;c<d;c+=1)GeneralBrowserTools.purge(a.childNodes[c])}}};
GeneralBrowserTools.getURLParameter=function(a){return location.href.toQueryParams()[a]};GeneralBrowserTools.navigateToPage=function(a,b,c){a=wgArticlePath.replace(/\$1/,a!=null?a+":"+b:b);window.open(wgServer+a+(c?"?action=edit":""),"")};GeneralBrowserTools.toggleHighlighting=function(a,b){a&&Element.removeClassName(a,"selectedItem");Element.addClassName(b,"selectedItem");return b};
GeneralBrowserTools.repasteMarkup=function(a){if(Prototype.BrowserFeatures.XPath){a=document.evaluate("//*[@"+a+'="true"]',document,null,XPathResult.ANY_TYPE,null);for(var b=a.iterateNext(),c=[],d=0;b!=null;){c[d]=b;b=a.iterateNext();d++}c.each(function(e){e.innerHTML=e.textContent})}};GeneralBrowserTools.nextDIV=function(a){for(a=a.nextSibling;a&&a.nodeName!="DIV";)a=a.nextSibling;return a};GeneralXMLTools={};
GeneralXMLTools.createTreeViewDocument=function(){if(OB_bd.isGeckoOrOpera)var a=(new DOMParser).parseFromString("<result/>","text/xml");else if(OB_bd.isIE){a=new ActiveXObject("Microsoft.XMLDOM");a.async="false";a.loadXML("<result/>")}return a};GeneralXMLTools.createDocumentFromString=function(a){if(OB_bd.isGeckoOrOpera)var b=(new DOMParser).parseFromString(a,"text/xml");else if(OB_bd.isIE){b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a)}return b};
GeneralXMLTools.hasChildNodesWithTag=function(a,b){if(a==null)return false;return a.getElementsByTagName(b).length>0};GeneralXMLTools.addBranch=function(a,b){for(var c=a,d=b.length-3;d>=0;d--)c=GeneralXMLTools.addNodeIfNecessary(b[d],c);c.hasChildNodes()||c.removeAttribute("expanded")};
GeneralXMLTools.addNodeIfNecessary=function(a,b){for(var c=a.getAttribute("title"),d=0;d<b.childNodes.length;d++)if(b.childNodes[d].getAttribute("title")==c)return b.childNodes[d];c=GeneralXMLTools.importNode(b,a,false);a.firstChild!=null&&a.firstChild.tagName=="gissues"&&GeneralXMLTools.importNode(c,a.firstChild,true);return c};
GeneralXMLTools.importNode=function(a,b,c){var d;if(OB_bd.isIE||OB_bd.isSafari)d=a.appendChild(b.cloneNode(c));else if(OB_bd.isGecko)d=a.appendChild(document.importNode(b,c));return d};
GeneralXMLTools.getNodeById=function(a,b){if(Prototype.BrowserFeatures.XPath)return(a.contentType=="text/xml"||a.ownerDocument!=null&&a.ownerDocument.contentType=="text/xml"?(a.documentElement!=null?a.documentElement.ownerDocument:a.ownerDocument).evaluate('//*[@id="'+b+'"]',a,null,XPathResult.ANY_TYPE,null):document.evaluate('//*[@id="'+b+'"]',document.documentElement,null,XPathResult.ANY_TYPE,null)).iterateNext();else if(OB_bd.isIE)return a.selectSingleNode('//*[@id="'+b+'"]');else{var c=a.childNodes,
d;if(c.length==0)return null;for(var e=0,f=c.length;e<f;e++)if(c[e].nodeType!=4){if(c[e].getAttribute("id")==b)return c[e];d=GeneralXMLTools.getNodeById(c[e],b);if(d!=null)return d}return null}};
GeneralXMLTools.getAttributeNodeByText=function(a,b){if(Prototype.BrowserFeatures.XPath){var c=[],d;d=a.contentType=="text/xml"||a.ownerDocument!=null&&a.ownerDocument.contentType=="text/xml"?(a.documentElement!=null?a.documentElement.ownerDocument:a.ownerDocument).evaluate("//attribute::*[contains(string(self::node()), '"+b+"')]",a,null,XPathResult.ANY_TYPE,null):document.evaluate("//attribute::*[contains(string(self::node()), '"+b+"')]",document.documentElement,null,XPathResult.ANY_TYPE,null);for(var e=
d.iterateNext();e!=null;){c.push(e);e=d.iterateNext()}return c}else if(OB_bd.isIE){d=a.selectNodes("/descendant::attribute()[contains(string(self::node()), '"+b+"')]");d.moveNext();for(e=d.current();e!=null;){c.push(d.current());d.moveNext()}return result}};
GeneralXMLTools.getNodeByText=function(a,b){if(Prototype.BrowserFeatures.XPath){var c=[],d;d=a.contentType=="text/xml"||a.ownerDocument!=null&&a.ownerDocument.contentType=="text/xml"?(a.documentElement!=null?a.documentElement.ownerDocument:a.ownerDocument).evaluate("/descendant::text()[contains(string(self::node()), '"+b+"')]",a,null,XPathResult.ANY_TYPE,null):document.evaluate("/descendant::text()[contains(string(self::node()), '"+b+"')]",document.documentElement,null,XPathResult.ANY_TYPE,null);
for(var e=d.iterateNext();e!=null;){c.push(e);e=d.iterateNext()}return c}else if(OB_bd.isIE){d=a.selectNodes("/descendant::text()[contains(string(self::node()), '"+b+"')]");d.moveNext();for(e=d.current();e!=null;){c.push(d.current());d.moveNext()}return result}else if(OB_bd.isSafari){var f=[],g=function(h){h=h.childNodes;if(h.length!=0)for(var i=0,j=h.length;i<j;i++)if(h[i].nodeType==3)h[i].nodeValue.indexOf(b)!=-1&&f.push(h[i]);else g(h[i])};g(a,b);return f}};
GeneralXMLTools.importSubtree=function(a,b){for(var c=0;c<b.childNodes.length;c++)GeneralXMLTools.importNode(a,b.childNodes[c],true)};GeneralXMLTools.removeAllChildNodes=function(a){if(a.firstChild){child=a.firstChild;do{nextSibling=child.nextSibling;GeneralBrowserTools.purge(child);a.removeChild(child);child=nextSibling}while(child!=null)}};GeneralXMLTools.getAllParents=function(a){var b=[],c=0;do{b[c]=a;a=a.parentNode;c++}while(a!=null);return b};GeneralTools={};
GeneralTools.getEvent=function(a){return a?a:window.event};GeneralTools.getImgDirectory=function(a){return a.substring(0,a.lastIndexOf("/")+1)};GeneralTools.splitSearchTerm=function(a){return a.split(" ").without("")};GeneralTools.matchArrayOfRegExp=function(a,b){for(var c=true,d=0,e=b.length;d<e;d++)if(b[d].exec(a)==null){c=false;break}return c};GeneralTools.makeWikiURL=function(a){return wgServer+wgArticlePath.replace(/\$1/,a)};
GeneralTools.makeTSCURI=function(a){if(typeof smwghTripleStoreGraph=="undefined")return false;var b=a.split(":");a=encodeURIComponent(b[0]);if(b.length==1)return smwghTripleStoreGraph+"/a/"+a;else{b=b[1].toLowerCase();return smwghTripleStoreGraph+"/"+b+"/"+a}};
GeneralTools.URLEncode=function(a){a=(a+"").toString();var b=function(d,e,f){var g=[];g=f.split(d);return g.join(e)},c=this._URL_Histogram();a=encodeURIComponent(a);for(search in c){replace=c[search];a=b(search,replace,a)}return a.replace(/(\%([a-z0-9]{2}))/g,function(d,e,f){return"%"+f.toUpperCase()})};
GeneralTools._URL_Histogram=function(){var a={};a["'"]="%27";a["("]="%28";a[")"]="%29";a["*"]="%2A";a["~"]="%7E";a["!"]="%21";a["%20"]="+";a["\u00dc"]="%DC";a["\u00fc"]="%FC";a["\u00c4"]="%D4";a["\u00e4"]="%E4";a["\u00d6"]="%D6";a["\u00f6"]="%F6";a["\u00df"]="%DF";a["\u20ac"]="%80";a["\u0081"]="%81";a["\u201a"]="%82";a["\u0192"]="%83";a["\u201e"]="%84";a["\u2026"]="%85";a["\u2020"]="%86";a["\u2021"]="%87";a["\u02c6"]="%88";a["\u2030"]="%89";a["\u0160"]="%8A";a["\u2039"]="%8B";a["\u0152"]="%8C";a["\u008d"]=
"%8D";a["\u017d"]="%8E";a["\u008f"]="%8F";a["\u0090"]="%90";a["\u2018"]="%91";a["\u2019"]="%92";a["\u201c"]="%93";a["\u201d"]="%94";a["\u2022"]="%95";a["\u2013"]="%96";a["\u2014"]="%97";a["\u02dc"]="%98";a["\u2122"]="%99";a["\u0161"]="%9A";a["\u203a"]="%9B";a["\u0153"]="%9C";a["\u009d"]="%9D";a["\u017e"]="%9E";a["\u0178"]="%9F";return a};var OBPendingIndicator=Class.create();
OBPendingIndicator.prototype={initialize:function(a){this.container=a;this.pendingIndicator=document.createElement("img");Element.addClassName(this.pendingIndicator,"obpendingElement");this.pendingIndicator.setAttribute("src",wgServer+wgScriptPath+"/extensions/SMWHalo/skins/OntologyBrowser/images/ajax-loader.gif");this.contentElement=null},show:function(a,b){if($("content")!=null){var c=0;if(b!=undefined)switch(b){case "right":c=a?$(a).offsetWidth-16:$(this.container).offsetWidth-16;break;case "left":break}if(this.contentElement==
null){this.contentElement=$("content");this.contentElement.appendChild(this.pendingIndicator)}if(a){this.pendingIndicator.style.left=c+Position.cumulativeOffset($(a))[0]-Position.realOffset($(a))[0]+"px";this.pendingIndicator.style.top=Position.cumulativeOffset($(a))[1]-Position.realOffset($(a))[1]+$(a).scrollTop+"px"}else{this.pendingIndicator.style.left=c+Position.cumulativeOffset(this.container)[0]-Position.realOffset(this.container)[0]+"px";this.pendingIndicator.style.top=Position.cumulativeOffset(this.container)[1]-
Position.realOffset(this.container)[1]+this.container.scrollTop+"px"}this.pendingIndicator.style.display="block";this.pendingIndicator.style.visibility="visible"}},showOn:function(a){container=a.offsetParent;$(container).insert({top:this.pendingIndicator});a=$(a).positionedOffset();this.pendingIndicator.style.left=a[0]+"px";this.pendingIndicator.style.top=a[1]+"px";this.pendingIndicator.style.display="block";this.pendingIndicator.style.visibility="visible";this.pendingIndicator.style.position="absolute"},
hide:function(){Element.hide(this.pendingIndicator)},remove:function(){Element.remove(this.pendingIndicator)}};var Breadcrumb=Class.create();
Breadcrumb.prototype={initialize:function(a){this.lengthOfBreadcrumb=a},update:function(){var a=GeneralBrowserTools.getCookie("breadcrumb"),b,c=this.removeTitleFromQuery(document.location.search);try{b=a.evalJSON(true)}catch(d){b=null}if(b==null)b=[{pageName:wgPageName,queryString:c}];else{if(b[b.length-1].pageName!=wgPageName)b.push({pageName:wgPageName,queryString:c});else if(b[b.length-1].pageName==wgPageName&&b[b.length-1].queryString!=c)b[b.length-1]={pageName:wgPageName,queryString:c};b.length>
this.lengthOfBreadcrumb&&b.shift()}document.cookie="breadcrumb="+b.toJSON()+"; path="+wgScript;this.pasteInHTML(b)},pasteInHTML:function(a){var b="",c=0,d=[],e=a[a.length-1],f=e.pageName.split(":"),g=f.length==2?f[1]:f[0];g=g.replace(/_/g," ");e=0;for(var h=a.length;e<h;++e){e=a[e];f=e.pageName.split(":");f=f.length==2?f[1]:f[0];f=f.replace(/_/g," ");var i=encodeURIComponent(e.pageName);if(wgArticlePath.indexOf("?title=")!=-1){i=i.replace(/%3A/g,":");i=wgArticlePath.replace("$1",i)+e.queryString}else{i=
i.replace(/%2F/g,"/");i=i.replace(/%3A/g,":");i=wgArticlePath.replace("$1",i)+e.queryString}var j=false;d[c]=f;for(e=0;e<c;++e)if(d[e]==f)j=true;c++;if(e<h-1&&f!=g&&j==false)b+='<a href="'+wgServer+i+'">'+f+" &gt; </a>";if(e==h-1)b+='<span id="smwh_breadcrumb_currentpage">'+f+"</span>"}a=$("breadcrumb");if(a==null){c=$("firstHeading");if(c!=null){c.insert({before:"<div id='breadcrumb'/>"});a=$("breadcrumb")}}if(a!=null)a.innerHTML=b},removeTitleFromQuery:function(a){if(a!=null&&a!=undefined){a=a.replace(/title=(.*?)&/i,
"");a=a.replace(/\?title=(.*?)$/i,"")}else a="";return a.replace("/title=(.*?)&/i","")}};var smwhg_breadcrumb=new Breadcrumb(5);Event.observe(window,"load",smwhg_breadcrumb.update.bind(smwhg_breadcrumb));var GeneralGUI=Class.create();
GeneralGUI.prototype={initialize:function(){this.closedContainers=GeneralBrowserTools.getCookieObject("smwNavigationContainers");if(this.closedContainers==null)this.closedContainers={}},switchVisibilityWithState:function(a){if($(a).visible()){this.closedContainers[a]=true;closedimg='<img id="'+a+'_img" class="icon_navi" onmouseout="(src=\''+wgScriptPath+"/extensions/SMWHalo/skins/expandable.gif')\" onmouseover=\"(src='"+wgScriptPath+'/extensions/SMWHalo/skins/expandable-act.gif\')" src="'+wgScriptPath+
'/extensions/SMWHalo/skins/expandable.gif"/>';$(a+"_img").replace(closedimg)}else{this.closedContainers[a]=false;openedimg='<img id="'+a+'_img" class="icon_navi" onmouseout="(src=\''+wgScriptPath+"/extensions/SMWHalo/skins/expandable-up.gif')\" onmouseover=\"(src='"+wgScriptPath+'/extensions/SMWHalo/skins/expandable-up-act.gif\')" src="'+wgScriptPath+'/extensions/SMWHalo/skins/expandable-up.gif"/>';$(a+"_img").replace(openedimg)}GeneralBrowserTools.setCookieObject("smwNavigationContainers",this.closedContainers);
this.switchVisibility(a)},update:function(){for(var a in this.closedContainers)if(this.closedContainers[a]==true){closedimg='<img id="'+a+'_img" class="icon_navi" onmouseout="(src=\''+wgScriptPath+"/extensions/SMWHalo/skins/expandable.gif')\" onmouseover=\"(src='"+wgScriptPath+'/extensions/SMWHalo/skins/expandable-act.gif\')" src="'+wgScriptPath+'/extensions/SMWHalo/skins/expandable.gif"/>';$(a+"_img").replace(closedimg);this.switchVisibility(a)}},switchVisibility:function(a){$(a).visible()?$(a).hide():
$(a).show()}};var smwhg_generalGUI=new GeneralGUI;Event.observe(window,"load",smwhg_generalGUI.update.bind(smwhg_generalGUI));var ContentSlider=Class.create();
ContentSlider.prototype={initialize:function(){this.sliderObj=null;this.savedPos=-1;this.sliderWidth=OB_bd.isIE?13:12;this.timer=null},activateResizing:function(){if(!(!$("contentslider")||wgAction=="annotate")){$("contentslider").innerHTML='<img id="contentSliderHandle" src="'+wgScriptPath+'/extensions/SMWHalo/skins/slider.gif"/>';var a=OB_bd.isIE?document.body.offsetWidth:window.innerWidth;a=($("p-logo").getWidth()-this.sliderWidth)/a;var b=GeneralBrowserTools.getCookie("cp-slider");b=b!=null?b:
this.savedPos!=-1?this.savedPos:a;this.slide(b);if(this.sliderObj!=null){this.sliderObj.setDisabled();this.sliderObj=null}this.sliderObj=new Control.Slider("contentSliderHandle","contentslider",{sliderValue:b,minimum:a,maximum:0.5,onSlide:this.slide.bind(this),onChange:this.slide.bind(this)})}},slide:function(a){var b=OB_bd.isIE?document.body.offsetWidth:window.innerWidth,c=($("p-logo").getWidth()-this.sliderWidth)/b,d=b*(a-c)+$("p-logo").getWidth();if(a<c)this.sliderObj!=null&&this.sliderObj.setValue(c);
else if(a>0.5)this.sliderObj!=null&&this.sliderObj.setValue(0.5);else{var e=OB_bd.isIE?a*25:a*38;$("p-cactions").style.marginLeft=b*(a-c)-e+"px";$("content").style.marginLeft=d-e+"px";var f=this.sliderWidth;$$("#main_navtree div.dtreestatic").each(function(g){g.style.width=b*a+f-7-e+"px"});c=$("main_navtree");if(c!=null)c.style.width=b*a+f-5-e+"px";$("p-navigation").style.width=b*a+f-5-e+"px";$("p-search").style.width=b*a+f-5-e+"px";$("p-tb").style.width=b*a+f-5-e+"px";if($("p-treeview")!=null)$("p-treeview").style.width=
b*a+f-5-e+"px";document.cookie="cp-slider="+a+"; path="+wgScript;this.savedPos=a}},resizeTextbox:function(){if(OB_bd.isIE){this.timer!=null&&window.clearTimeout(this.timer);var a=this;this.timer=window.setTimeout(function(){a.activateResizing()},1E3)}else this.activateResizing()}};var smwhg_contentslider=new ContentSlider;Event.observe(window,"load",smwhg_contentslider.activateResizing.bind(smwhg_contentslider));Event.observe(window,"resize",smwhg_contentslider.resizeTextbox.bind(smwhg_contentslider));var smwghLoggerEnabled=false,SmwhgLogger=Class.create();SmwhgLogger.prototype={initialize:function(){},log:function(a,b,c){if(smwghLoggerEnabled){a=a==null?"":a;b=b==null?"":b;var d=(new Date).toGMTString(),e=wgPageName==null?"":wgPageName;c=c==null?"":c;sajax_do_call("smwLog",[a,b,c,e,d],this.logcallback.bind(this))}},logcallback:function(a){a.status!=200&&alert("logging failed: "+a.statusText)}};var smwhgLogger=new SmwhgLogger;var Language=Class.create();
Language.prototype={initialize:function(){},getMessage:function(a,b){switch(b){case "user":var c=wgUserLanguageStrings[a];c||(c=a);break;case "cont":(c=wgContLanguageStrings[a])||(c=a);break;default:c=wgUserLanguageStrings[a];if(!c)(c=wgContLanguageStrings[a])||(c=a)}c=c.replace(/\$n/g,wgCanonicalNamespace);c=c.replace(/\$p/g,wgPageName);c=c.replace(/\$t/g,wgTitle);c=c.replace(/\$sftt/g,typeof smwhgSfTargetTitle!=="undefined"?smwhgSfTargetTitle:wgTitle);c=c.replace(/\$u/g,wgUserName);return c=c.replace(/\$s/g,
wgServer)}};var gLanguage=new Language;var SMW_DerivedFactsTab=Class.create();
SMW_DerivedFactsTab.prototype={initialize:function(){this.mActiveTab=1;this.sandglass=new OBPendingIndicator;this.mDFLoaded=false},init:function(){if($("dftTab1")&&$("dftTab2")){Event.observe("dftTab1","click",this.activateTab1.bindAsEventListener(this));Event.observe("dftTab2","click",this.activateTab2.bindAsEventListener(this))}},activateTab1:function(){if(this.mActiveTab!=1){this.mActiveTab=1;$("dftTab2Content").hide();$("dftTab1Content").show();$("dftTab1").addClassName("dftTabActive");$("dftTab1").removeClassName("dftTabInactive");
$("dftTab2").addClassName("dftTabInactive");$("dftTab2").removeClassName("dftTabActive")}},activateTab2:function(){if(this.mActiveTab!=2){this.mActiveTab=2;$("dftTab1Content").hide();$("dftTab2Content").show();$("dftTab2").addClassName("dftTabActive");$("dftTab2").removeClassName("dftTabInactive");$("dftTab1").addClassName("dftTabInactive");$("dftTab1").removeClassName("dftTabActive");if(!this.mDFLoaded){this.sandglass.show("dftTab2Content");sajax_do_call("smwf_om_GetDerivedFacts",[wgPageName],this.getDerivedFacts.bind(this))}}},
getDerivedFacts:function(a){this.sandglass.hide();if(a.status!=200)$("dftTab2ContentInnerDiv").replace('<div id="dftTab2ContentInnerDiv" style="padding: 20px;">'+gLanguage.getMessage("DF_REQUEST_FAILED")+"</div>");else{$("dftTab2ContentInnerDiv").replace('<div id="dftTab2ContentInnerDiv">'+a.responseText+"</div>");this.mDFLoaded=true}}};var smwDft=new SMW_DerivedFactsTab;Event.observe(window,"load",smwDft.init.bindAsEventListener(smwDft));

