if(!saw.customlink){saw.customlink=function(){};saw.customlink.setCustomLinks=function(a){saw.customlink.customLinks=new saw.customlink.CustomLinks(a)};saw.customlink.getCustomLinks=function(){return saw.customlink.customLinks};saw.customlink.CustomLinks=function(a){this.customLinks=a;this.insertPrefMap=null;this.navbarMenuTabIdx=[]};saw.customlink.CustomLinks.prototype.prepareHeaderInsertPref=function(){if(this.customLinks){this.insertPrefMap={};this.insertPrefMap.help=new Array();for(var b=0;b<this.customLinks.length;b++){if(this.customLinks[b].hide=="header"){continue}var c=this.customLinks[b].locations;if(c){for(var a=0;a<c.length;a++){var d=c[a];if(d.name!="header"){continue}tInsertBef=d.insertBefore?d.insertBefore:"help";if(!this.insertPrefMap[tInsertBef]){this.insertPrefMap[tInsertBef]=new Array()}var e=this.insertPrefMap[tInsertBef];e.push(this.customLinks[b])}}else{this.insertPrefMap.help.push(this.customLinks[b])}}}};saw.customlink.CustomLinks.prototype.insertHeaderCustomLinks=function(b){if(this.insertPrefMap==null){this.prepareHeaderInsertPref()}var g=new Array();var k=new Array();if(this.insertPrefMap){for(var c=0;c<b.length;c++){var f=b[c];if(f){var a=this.insertPrefMap[f.id];for(var d=0;a&&d<a.length;d++){var e=a[d];if(e.name){var h=new saw.header.Menubar.MenuModel(e.id,e.name,e.icon0,new obips.Callback(this,this.onHeaderCustomLink),null,e.description);h.userData=e;k.push(h);g.push(e.id)}k.push(null)}}if(!f||!f.hidden){k.push(f)}}return k}else{for(var c=0;c<b.length;c++){var f=b[c];if(!f||!f.hidden){k.push(f)}}}return k};saw.customlink.CustomLinks.prototype.insertGetStartedCustomLinks=function(){var f=this.customLinks;if(f){var a=document.getElementById("idGetStartedCustomLinksDiv");for(var k=0;k<f.length;k++){if(this.customLinks[k].hide=="getstarted"){continue}var o=this.customLinks[k].locations;var l=null;if(o){var p=true;for(var h=0;h<o.length;h++){if(o[h].name!="getstarted"){continue}l=o[h].insertBefore;p=false}if(p){continue}}var g=saw.createTable(1);var d=f[k];var n=g.rows[0];n.className="BIHGetStartedLink";var m=n.insertCell(0);m.className="GetStartedActionIcon";if(d.icon1){var c=saw.createChildElement(m,"img");c.src=d.icon1;c.alt="";c.title=""}var b=n.insertCell(1);var r=saw.createChildElement(b,"A");r.href="javascript:void(null)";r.style.paddingLeft="5px";r.userObject=d;var q=this;r.onclick=q.onGetStartedCustomLink;r.appendChild(document.createTextNode(d.name));r.title=d.description;if(l){var e=this.getChildElement(a,l);if(e){e.parentNode.insertBefore(g,e)}else{a.appendChild(g)}}else{a.appendChild(g)}}}};saw.customlink.CustomLinks.prototype.getChildElement=function(c,d){var b=c.childNodes;for(var a=0;b!=null&&a<b.length;a++){if(b[a].id==d){return b[a]}}return null};saw.customlink.CustomLinks.prototype.getAllLinks=function(){return this.customLinks};saw.customlink.CustomLinks.prototype.onHeaderCustomLink=function(b,a){var c=b.menu.userData;if(c.target=="self"){a=saw.getEvent(a);obips.launcher.launchURL(c.src,{ctrlKey:a&&a.ctrlKey})}else{if(c.target=="blank"){saw.header.Menubar.getManager().hidePopupPanel();obips.launcher.launchNewWindow(c.src,"_blank")}else{saw.header.Menubar.getManager().hidePopupPanel();obips.launcher.launchNewWindow(c.src,c.target)}}};saw.customlink.CustomLinks.prototype.onGetStartedCustomLink=function(a){a=saw.getEvent(a);var b=saw.getEventTarget(a).userObject;if(b.target=="self"){obips.launcher.launchURL(b.src,{ctrlKey:a&&a.ctrlKey})}else{if(b.target=="blank"){saw.header.Menubar.getManager().hidePopupPanel();obips.launcher.launchNewWindow(b.src,"_blank")}else{saw.header.Menubar.getManager().hidePopupPanel();obips.launcher.launchNewWindow(b.src,b.target)}}}};