
var CurrentPopupWindowState=-1;
var PopupWindowMouseOver=true;
var PopupWindowPosX=0;
var PopupWindowPosY=0;
var PopupWindowXCoor = 0;
var PopupWindowYCoor = 0;
var w3c=(document.getElementById)? true: false;
var ie4=document.all&&!document.getElementById
var ie5=(w3c && document.all)? true : false;
var ie6=((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
var ns4=document.layers
var ns6=(w3c && (navigator.appName=="Netscape"))? true: false;
var DOM2=document.getElementById
var alerttimer=null;
var alertindex=0
var hex=255;
var win = null;
var popuplasturl='';

function NewWindow(url,w,h,resize){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
//LeftPosition = 20;
//TopPosition = 20;
//settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no'
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable='+resize
win = window.open(url,'NebulaPopup',settings)
}

function CreateBox(x,y,w,h,bgc,id){
var v=document.createElement('div');
v.setAttribute('id',id); 
v.style.position='absolute';
v.style.left=x+'px';
v.style.top=y+'px';
v.style.width=w+'px';
v.style.height=h+'px';
v.style.backgroundColor=bgc;
v.style.visibility='visible';
v.style.padding='0px 0px 0px 0px';
return v;
}

function SessionTimeout() {
	alert(window.top.location.href);
}

function PopupBox(URL,w,h,title,moveable,resize,wizard,instantclose) {

    // Get the current Window dimensions, regardless of browser and then
    //   set size of popup accordingly (if req'd)
    // http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
    // NOTE - this URL also covers scroll offsets in case of problems 
    //   with this on other browsers later - WB
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    if (w == -1) { w = myWidth - 75; }
    if (h == -1) { h = myHeight - 75; }
  
	if (fcontent.length!=0) { return };
	// Old code. Deprecated as these are not consistent across all versions of IE.
	//if (w==-1) { w=ns6 ? innerWidth-75 : document.body.clientWidth-75; }
	//if (h==-1) { h=ns6 ? innerHeight-75 : document.body.clientHeight-75; }
	//if (h==-1) { h=ns6 ? innerHeight-75 : screen.Height-75; }

	if (ns6) h+=0;
	if (UsePW) {
	    var pageWidth,pageHeight;
        if (self.innerHeight) 
        {
            pageWidth = self.innerWidth;
            pageHeight = self.innerHeight;
        }
        else if (document.documentElement && document.documentElement.clientHeight)
        {
            pageWidth = document.documentElement.clientWidth;
            pageHeight = document.documentElement.clientHeight;
        }
        else if (document.body) 
        {
            pageWidth = document.body.clientWidth;
            pageHeight = document.body.clientHeight;
        }
        var scrollX,scrollY;
        if (self.pageYOffset) 
        {
	        scrollX = self.pageXOffset;
	        scrollY = self.pageYOffset;
        }
        else if (document.documentElement && document.documentElement.scrollTop)
	    {
	        scrollX = document.documentElement.scrollLeft;
	        scrollY = document.documentElement.scrollTop;
        }
        else if (document.body) 
        {
	        scrollX = document.body.scrollLeft;
	        scrollY = document.body.scrollTop;
        }

		var x = (pageWidth/2)-(w/2)
		var y = (scrollY+((pageHeight/2)-(h/2)))
		if ((CurrentPopupWindowState==2) && (MM_findObj('Nebula_Popup').style.visibility!='hidden')) {
			return
		}
		if (ns6) {
			var CloseOnClick= wizard ? 'window.frames[\'PopupWindowIFrame\'].MM_findObj(\'wizardaction\').value=\'CANCEL\'; window.frames[\'PopupWindowIFrame\'].document.Wizard.submit(); return false;' : instantclose ? 'MM_findObj(\'Nebula_Popup\').style.visibility=\'hidden\'; MM_findObj(\'Nebula_PopupShaddow\').style.visibility=\'hidden\'; CurrentPopupWindowState=0; return false' : 'window.frames[\'PopupWindowIFrame\'].CloseWindow(); return false';
		} else {
			var CloseOnClick= wizard ? 'document.PopupWindowIFrame.MM_findObj(\'wizardaction\').value=\'CANCEL\'; document.PopupWindowIFrame.Wizard.submit(); return false;' : instantclose ? 'MM_findObj(\'Nebula_Popup\').style.visibility=\'hidden\'; MM_findObj(\'Nebula_PopupShaddow\').style.visibility=\'hidden\'; CurrentPopupWindowState=0; return false' : 'window.PopupWindowIFrame.CloseWindow(); return false';
		}
		CurrentPopupWindowState = instantclose ? 1 : 2
		if (wizard) {CurrentPopupWindowState=2}
		var MoveableHTML = moveable ? 'onMousedown="NJS_WindowDrag(event)" onmouseup="NJS_StopDrag(event)"' : '';
		if (wizard) {
			var HTML1 = '<table style="height: 42px; width: 100%;" cellspacing="0" border="0" cellpadding="0"><tr><td width="100%" style="background-image: url(/images/title1.gif); background-repeat: repeat-x; height: 19px; max-height: 19px;" ' + MoveableHTML + ' class="PopupWindowTitle">&nbsp;<span id="PopupWindowTitle">' + title + '</span></td><td width="17" style="height: 19px; text-align: right;background-image: url(/images/title1.gif); background-repeat: repeat-x; font-size: 1px;"><a href="#" onclick="' + CloseOnClick + '"><img src="/images/title2.gif" border="0" width="17"></a></td></tr><tr><td width="100%" colspan="2" style="height: 20px;"><div style="width:100%;height:20px;" name="WizardProgress" id="WizardProgress"><img src="/images/13x13trans.gif" style="height: 20px;" width="1"></div></td></tr><tr><td width="100%" colspan="2" style="height: 3px; background-image: url(/images/blackline.gif); background-repeat: repeat-x;"></td></tr></table>';
			var iframeheight=(h-42);
		} else {
			var HTML1 = '<table style="height: 19px; width: 100%;" cellspacing="0" border="0" cellpadding="0"><tr><td width="100%" style="background-image: url(/images/title1.gif); background-repeat: repeat-x; height: 19px; max-height: 19px;" ' + MoveableHTML + ' class="PopupWindowTitle">&nbsp;<span id="PopupWindowTitle">' + title + '</span></td><td width="17" style="background-image: url(/images/title1.gif); background-repeat: repeat-x; height: 19px; text-align: right; font-size: 1px;"><a href="#" onclick="' + CloseOnClick + '"><img src="/images/title2.gif" border="0" width="17"></a></td></tr></table>';
			var iframeheight=(h-19);
		}
		var HTML2 = '<iframe frameborder="0" marginwidth="3" marginheight="3" scrolling="auto" id="PopupWindowIFrame" name="PopupWindowIFrame" src="' + URL + '" width="100%" style="height: ' + iframeheight + 'px;"></iframe>';
		var objPop=MM_findObj('Nebula_Popup');
		var objPopShaddow=MM_findObj('Nebula_PopupShaddow');
		if (objPop==null) {
			var popup=new CreateBox(x,y,w,h,'white','Nebula_Popup')
			var shadow=new CreateBox(x+10,y+10,w,h,'#cccccc','Nebula_PopupShaddow');
			popup.style.borderStyle="outset";
			popup.style.borderWidth="2px";
			popup.style.borderColor='#333333';
			if(ie6)shadow.style.filter="alpha(opacity=50)";
			popup.style.zIndex=501;
			shadow.style.zIndex=500;
			popup.innerHTML='<div id="Pdh1">' + HTML1 + '</div>' + HTML2;
			document.body.appendChild(popup);
			document.body.appendChild(shadow);
		} else {
			var iframe = ns6 ? MM_findObj('PopupWindowIFrame') : document.all['PopupWindowIFrame']
			iframe.style.height=iframeheight + 'px';
			objPop.style.left=x; objPop.style.top=y;
			objPop.style.width=w; objPop.style.height=h;
			objPopShaddow.style.left=x+10; objPopShaddow.style.top=y+10;
			objPopShaddow.style.width=w; objPopShaddow.style.height=h;
			MM_findObj('Pdh1').innerHTML=HTML1;
			if (ns6) {
				if (window.frames['PopupWindowIFrame'].document.getElementById('Phtml')!=null)
					window.frames['PopupWindowIFrame'].MM_findObj('Phtml').innerHTML='';
				//MM_findObj('PopupWindowIFrame').src=URL
				window.frames['PopupWindowIFrame'].location.href=URL
			} else {
				if (document.PopupWindowIFrame.document.getElementById('Phtml')!=null)
					document.PopupWindowIFrame.document.getElementById('Phtml').innerHTML='';
				document.PopupWindowIFrame.location.href=URL;
			}
			objPop.style.visibility='visible'; 
			objPopShaddow.style.visibility='visible';

		}
	} else {
		NewWindow(URL,w+30,h);
	}
	popuplasturl=URL;
}


function NJS_WindowDrag(e)
{
	PopupWindowMouseOver=true
	PopupWindowPosX=parseInt(MM_findObj('Nebula_Popup').style.left+0);
	PopupWindowPosY=parseInt(MM_findObj('Nebula_Popup').style.top+0);
	PopupWindowXCoor=ns6? e.clientX: event.clientX
	PopupWindowYCoor=ns6? e.clientY: event.clientY
	document.onmousemove=NJS_moveImage;
}

function NJS_moveImage(e)
{
	var but = ns6 ? 1 : event.button
	if (PopupWindowMouseOver&&but==1)
	{
		var clientX=ns6?e.clientX:event.clientX;
		var clientY=ns6?e.clientY:event.clientY
		MM_findObj('Nebula_Popup').style.left=PopupWindowPosX+clientX-PopupWindowXCoor;
		MM_findObj('Nebula_Popup').style.top=PopupWindowPosY+clientY-PopupWindowYCoor;
		MM_findObj('Nebula_PopupShaddow').style.left=PopupWindowPosX+clientX-PopupWindowXCoor+10;
		MM_findObj('Nebula_PopupShaddow').style.top=PopupWindowPosY+clientY-PopupWindowYCoor+10;
		return false
	}
}

function NJS_StopDrag() { PopupWindowMouseOver=false }

function MM_changeProp(objName,x,theProp,theValue) {
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}
function MM_preloadimages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadimages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_setTextOfLayer(objName,x,newText) {
  if ((obj=MM_findObj(objName))!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ArchiveBox(DateStr) {
	var x=5;y=5;w=135;h=100;
	var popup=new CreateBox(x,y,w,h,'#999999','Nebula_ArchiveMessage')
	popup.style.borderStyle="outset";
	popup.style.borderWidth="2px";
	popup.style.borderColor='#333333';
	popup.style.zIndex=5001;
	popup.innerHTML='<a href="#" onclick="document.all.Nebula_ArchiveMessage.style.visibility=\'hidden\'; return false"><img border="0" width="21" style="height: 21px;" src="/images/info3.gif" align="left"></a><b>Archive mode</b><br clear="all"><font size="1">You are viewing an archived snapshot of the website from <b>' + DateStr + '</b>.<br>You can change the snapshot date using the administration menu option.';
	document.body.appendChild(popup);
}

function TimingBox(Msg) {
	var w=ns6 ? innerWidth-75 : document.body.clientWidth-75;
	var h=ns6 ? innerHeight-75 : document.body.clientHeight-75;
	var x = ((ns6 ? innerWidth : document.body.clientWidth)/2)-(w/2)
	var y = ns6 ? (innerHeight-h)/2 : (document.body.scrollTop+(document.body.clientHeight/2)-(h/2))

	var popup=new CreateBox(x,y,w,h,'#999999','Nebula_TimerMessage')
	popup.style.borderStyle="outset";
	popup.style.borderWidth="2px";
	popup.style.borderColor='#666666';
	popup.style.zIndex=5001;

	popup.innerHTML='<table onclick="document.all.Nebula_TimerMessage.style.visibility=\'hidden\'; return false" width="100%" style="height: 100%;" cellspacing="0" cellpadding="0" border="0"><tr><td width="100%"><img border="0" width="21" height="21" src="/images/info3.gif" align="left"><font style="font-size:10pt; font-weight:600; color: #ffffff">Nebula page execution performance analysis</font></td></tr><tr><td width="100%" height="100%"><div style="width:100%; height:100%; overflow:auto"><font style="font-size:8pt; font-weight:400; color: #ffffff" size="1" face="Courier, Courier New">' + Msg + '</td></tr></table>';
	document.body.appendChild(popup);
}

function showadminmenu(e) {
var TempMenu =document.getElementById('HM_Menu1');
if (TempMenu==null) {
	HM_f_MakeTree('HM_Menu1');
    var TempMenu = document.getElementById('HM_Menu1');
} 
if(!TempMenu) return false;
HM_CurrentMenu = TempMenu;
HM_f_PopMenu(e);
return false;
}
function nomenu(e) { return false }
function HTMLAdminDone() {
//	if (ie5||ns6){document.oncontextmenu=nomenu}
}
function HTMLDone() {
	HM_f_StartIt();
	if (ie5||ns6){document.oncontextmenu=showadminmenu;}
}

function FrmTopicListSelPage(FrmID,Pg) {
	//CurPage,Pages,PerPage,Items
	var Details = MM_findObj('Frm_' + FrmID + '_Details').value.split(',');
	var NewPg=Pg;
	var sPg='';
	if (Pg=='BACK') { if (Details[0]>1) {NewPg=parseInt(Details[0])-1;} else {return} }
	if (Pg=='NEXT') { if (Details[0]<Details[1]) {NewPg=parseInt(Details[0])+1;} else {return} }
	var max=(Details[2]*NewPg);
	var min=(max-Details[2])+1;
	for (var count=1;count<=Details[3];count++) {
		if ((count>=min) && (count<=max)) {MM_findObj('FL_' + FrmID + '_' + count).style.display='';} else {MM_findObj('FL_' + FrmID + '_' + count).style.display='none';}
	}
	Details[0]=NewPg;
	for (count=1;count<=Details[1];count++) {
		if (count==NewPg) {sPg=(sPg + '<b>[' + count + ']</b> ');} else {sPg=(sPg + '<a href="#" onclick="FrmTopicListSelPage(' + FrmID + ',' + count + '); return false" style="font-size:8pt">' + count + '</a> ') }
	}
	MM_setTextOfLayer('FL_' + FrmID + '_pages','',sPg);
	if (NewPg==1) {MM_findObj('FL_' + FrmID + '_prev').src='/images/frum/leftGrey.gif'} else {MM_findObj('FL_' + FrmID + '_prev').src='/images/frum/leftArrow.gif'}
	if (NewPg==Details[1]) {MM_findObj('FL_' + FrmID + '_next').src='/images/frum/rightGrey.gif'} else {MM_findObj('FL_' + FrmID + '_next').src='/images/frum/rightArrow.gif'}
	MM_findObj('Frm_' + FrmID + '_Details').value = Details.join(',');
}

function alertok(all) {
	var x = new Array();
	var b=0;
	for (var a=0;a<fcontent.length;a++) {
		if ((a!=alertindex-1) && !all) x[b++]=fcontent[a];
	}
	fcontent=x;
	if (alertindex!=0) alertindex--;
	clearTimeout(alerttimer);
	changecontent();
}

//-------------------------------------------------

function changecontent(){
    //var x = ((ns6 ? innerWidth : document.body.clientWidth)/2)-(250/2)
    //var y = ns6 ? (innerHeight-200)/2 : (document.body.scrollTop+(document.body.clientHeight/2)-(200/2))
    var x = 20;
    var y = 20;
    MM_findObj('alertbox').style.left=x;
    //MM_findObj('alertbox').style.top=y;
    //CH:height wasn't working properly with new themes - hard coded for now (maybe even forever...)
    MM_findObj('alertbox').style.top=300;
    MM_findObj('alertbox').style.zIndex=700;
    
    if (fcontent.length==0) {
	    MM_showHideLayers('alertbox','','hide');
	    return -1;
    }

    if (alertindex>=fcontent.length)
        alertindex=0

    MM_setTextOfLayer('alerttitle','','Alert ' + (alertindex+1) + ' of ' + fcontent.length);

    if (DOM2){
        document.getElementById("fscroller").style.color="rgb(255,255,255)"
        document.getElementById("fscroller").innerHTML=fcontent[alertindex]
        linksobj=document.getElementById("fscroller").getElementsByTagName("A")
        linkcolorchange(linksobj)
        colorfade()
    }
    else if (ie4)
            document.all.fscroller.innerHTML=fcontent[alertindex]
        else if (ns4){
            document.fscrollerns.document.fscrollerns_sub.document.write(fcontent[alertindex])
            document.fscrollerns.document.fscrollerns_sub.document.close()
        }

    alertindex++
    alerttimer=setTimeout("changecontent()",3000)
}

//-------------------------------------------------


var frame=20;

function linkcolorchange(obj){
if (obj.length>0){
for (i=0;i<obj.length;i++)
obj[i].style.color="rgb("+hex+","+hex+","+hex+")"
}
}

function colorfade() {	         	
if(frame>0) {	
hex=hex-12
document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")"; 
linkcolorchange(linksobj)
frame--;
setTimeout("colorfade()",20);	
}

else{
document.getElementById("fscroller").style.color="rgb(0,0,0)";
frame=20;
hex=255
}   
}

function PreParseMenu(arrayname,forcequick) {
//Called from PopupMenusDOM1.js for a specific menu
//Arrays for menus are created in the HTML in the form HM_ArrayX, HM_ArrayX_X, HM_ArrayX_X_X
//This function moves through the hierarchy of menus

    var MenuArrayIsValid = false;
    
    //check if there is an associated array in the HTML
    var MenuArrayIsObject = (typeof eval("window." + arrayname) == "object");
    
    //if there is a matching array in the HTML
    if (MenuArrayIsObject) {
		//split up the array
		var x1=eval(arrayname);
		
		//alert(arrayname+'#'+x1[0]+'#'+x1[2]);
		
		//x1[0][0] specifies the colours, etc for the menu - if it is '~' then use these default values
		if (x1[0][0]=='~') {
			var quick=true;
			var hdr=[180,"mouse_x_position + 1","mouse_y_position + 1","white","#ff8600","#3559A1","#3559A1","black","#ff8600",0,0,0,0,0,0,"null","null",,true];
		} else {
			var quick=x1[0][19];
			if (quick) 
			{
				//if colours are specified then assign to "hdr"
				var hdr=x1[0];
				hdr.length=19;
			}
		}
		if ((quick) || (forcequick)) {
		
			//set "temp" to be the array of colours, co-ords, etc
			var temp=[hdr];
			
			//alert(temp);
			
			//work through the rest of the array
			for (var count=1;count<x1.length;count++) {
				var x2=x1[count][0].split('=');
				//title,action,rollover,highlight,children gets set below, depending on code-these are default values
				var title=x2;
				var action='';
				var rollover=1;
				var highlight=0;
				var children=0;
				var NbPre= NbID + ';' + NbArc + ';' + NbPg + ';';
				
				if (x2.length!=1) var x3=x2[1].split(',')
				
				//title, action, rollover, highlight, children gets set below, depending on code
				if (x2[0]=='BM') {title=x2[1];children=1}
				if (x2[0]=='HR') {title="<hr color=black style=padding:0px;height:1px;border:0px;margin:0px />"}
				if (x2[0]=='MSG') {title='<b>'+x2[1]+'</b>';}
				if (x2[0]=='SMSG') {title='<font size="1">'+x2[1]+'</font>';}
				if (x2[0]=='MSGWF1') {title='<font size="1">This is an item previously edited by you which is still waiting to be approved, as the owner you can cancel the approval process using the Cancel option and action it using one of the other approval options.</font>';}
				if (x2[0]=='MSGWF2') {title='<font size="1">This item was recently edited by you and those changes are still awaiting approval, you can however cancel the approval process at any time.</font>';}
				if (x2[0]=='MSGWF3') {title='<font size="1">This item was recently changed and is awaiting your approval before the changes can be published, please select an option below</font>';}
				if (x2[0]=='MSGWF4') {title='<font size="1">This item was recently changed and is awaiting approval before the changes can be published.  As a workflow admistrator, you can perform any of the approval actions below</font>';}
				if (x2[0]=='MSGWF5') {title='<font size="1">As a workflow admistrator, you can perform any approval action on behalf of another user, please select an option below.</font>';}
				if (x2[0]=='MSGWF6') {title='<font size="1">This is an item previously created by you which is still waiting to be approved, as the owner you can cancel the approval process using the Cancel option and action it using one of the other approval options.</font>';}
				if (x2[0]=='MSGWF7') {title='<font size="1">This item is still waiting to be approved, as the owner can cancel the approval process at any time</font>';}
				if (x2[0]=='MSGWF8') {title='<font size="1">This item is waiting on your approval before it can be published, please select one of the options below</font>';}

				if (x2[0]=='HELP') {title='Help'; action="javascript:NewWindow('http://help.nebulaportal.com/embededhelp/default.asp',750,550,'yes')"}
				if (x2[0]=='UNDO') {title='Undo'; action="javascript:PopupBox('/Admin/Undo.asp?"+NbPre+"',600,250,'',1,1,0,1)"}
				//Tab dropdown menu links
				
				if (x2[0]=='PG') {
					var sURL='';
					//Check if the page can only be accessed using SSL
					if (x3[2]=='True')	{
						sURL = 'https://' + Hostname;}
					else	{
						sURL = 'http://' + Hostname;
					}
					title=x3[1]; action=sURL+'/default.asp?'+NbPre+'pg='+x3[0];children=1;
					}
				
				if (x2[0]=='NEWP') {title='Page'; action="javascript:PopupBox('/Admin/NewEditPage.asp?"+NbPre+"create=true&parentpageid="+NbPg+"',600,400,'',1,1,0,0)"}
				if (x2[0]=='OBCP') {title='<font size="1">Copy a section or a plugin from another page</a>'; action="javascript:PopupBox('/Admin/NewEditSectionLink.asp?"+NbPre+"usedcontent="+x3[0]+";usedapplications="+x3[1]+";create=true',660,420,'',1,1,0,1)"}
				if (x2[0]=='NWSC') {title=x3[1]; action="javascript:PopupBox('/Admin/NewEditSection.asp?"+NbPre+"create=true&sectiontype="+x3[0]+"',760,450,'Create a new content section - "+x3[1]+"',1,1,0,1)"}
				if (x2[0]=='NWPI') {title=x3[1]; action="javascript:PopupBox('/Admin/NewEditApplication.asp?"+NbPre+"create=true&applicationtypeid="+x3[0]+"',760,460,'',1,1,0,1)"}
				if (x2[0]=='CPWD') {title='Change my password'; action="javascript:PopupBox('/Admin/ChangePassword.asp?"+NbPre+"',350,200,'',1,1,0,1)"}
				if (x2[0]=='PDET') {title='Change my personal details'; action="javascript:PopupBox('/Admin/MyDetails.asp?"+NbPre+"',720,280,'',1,1,0,1)"}
				if (x2[0]=='MYMEM') {title='My membership'; action="javascript:PopupBox('/Admin/MyMembership.asp?"+NbPre+"',300,400,'',1,1,0,0)"}
				if (x2[0]=='MYSUB') {title='My subscriptions'; action="javascript:PopupBox('/Admin/MySubscriptions.asp?"+NbPre+"',530,330,'',1,1,0,1)"}
				if (x2[0]=='WFIB') {title='Workflow inbox'; action="javascript:PopupBox('/Admin/WorkflowInbox.asp?"+NbPre+"',700,500,'Workflow inbox',1,0,0,1)"}
				if (x2[0]=='VIEW') {title='View only mode'; action='/default.asp?'+NbPre+'action=DisableManagementFunctions'}
				if (x2[0]=='PUB') {title='Publish mode'; action='/default.asp?'+NbPre+'action=EnableManagementFunctions'}
				if (x2[0]=='HIDE') {title='Hide archived/scheduled content'; action='/default.asp?'+NbPre+'action=HideNonCurrentContent'}
				if (x2[0]=='SHOW') {title='Show archived/scheduled content'; action='/default.asp?'+NbPre+'action=ShowNonCurrentContent'}
				if (x2[0]=='NEWC') {title=x3[1]; action="javascript:PopupBox('/Admin/NewEditCommunity.asp?"+NbPre+"create=true&parentpageid=" + NbPg + "&CommunityTypeID="+x3[0]+"',550,300,'',1,1,0,1)"}
				if (x2[0]=='WSCFG') {title='Setup & configuration'; action="javascript:PopupBox('/Admin/WebsiteConfiguration.asp?"+NbPre+"',600,480,'',1,1,0,0)"}
				if (x2[0]=='WSBC') {title='Broadcast'; action="javascript:PopupBox('/Admin/Wizards/Broadcast/default.asp?"+NbPre+"',620,380,'',1,1,1,0)"}
				if (x2[0]=='WSSM') {title='Site map'; action="javascript:PopupBox('/Admin/Sitemap.asp?"+NbPre+"start=true',420,480,'',1,1,0,0)"}

				if (x2[0]=='PGPRP') {title='Properties'; action="javascript:PopupBox('/Admin/NewEditPage.asp?"+NbPre+"create=false&pageid=" + NbPg + "',600,400,'',1,1,0,1)"}
				if (x2[0]=='PGORD') {title='Order sub-pages'; action="javascript:PopupBox('/Admin/AutoOrdering.asp?"+NbPre+"pageid=" + NbPg + "&mode=PAGE',390,305,'',1,1,0,1)"}
				if (x2[0]=='PGPER')
				{
					if (x2.length==1) x2[1]='';					
					var x3=x2[1].split(',')
					title='Permissions'; action="javascript:PopupBox('/Admin/Permissions.asp?"+NbPre+"level=PAGE&permissionid=?&workflowschemeid="+x3[0]+"&pageid=" + NbPg + "',530,400,'',1,1,0,1)"
				}
				if (x2[0]=='MVCP') {title='Move or Copy'; action="javascript:PopupBox('/Admin/MoveDeletePage.asp?"+NbPre+"',350,420,'Move or copy the current page',1,1,0,1)"}

				if (x2[0]=='PGEML') {title='Email page link'; action="javascript:PopupBox('/Admin/EmailContent.asp?"+NbPre+"&Source=Page&pageid=" + NbPg + "',600,500,'',1,1,0,1)"}

				if (x2[0]=='DELP') {title='Delete'; action="javascript:PopupBox('/Admin/DeletePage.asp?"+NbPre+"pageid="+NbPg+"',300,185,'',1,1,0,1)"}
				if (x2[0]=='PGSUB') {title='Subscribe'; action="javascript:PopupBox('/Admin/ConfirmSubscribe.asp?"+NbPre+"subscriptiontype=PAGE&pageid="+NbPg+"',400,200,'Subscribe to page',1,1,0,1)"}
				if (x2[0]=='PGSUBE') {title='Subscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"subscriptiontype=PAGE&pageid="+NbPg+"',400,225,'Subscribe everyone to page',1,1,0,1)"}
				if (x2[0]=='PGSUBU') {title='Unsubscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"unsubscribe=true&subscriptiontype=PAGE&pageid="+NbPg+"',400,225,'Unsubscribe everyone from page',1,1,0,1)"}
				if (x2[0]=='MGMEM') {title='Manage membership'; action="javascript:PopupBox('/Admin/CommunityMembership.asp?"+NbPre+"',650,450,'Manage Community Membership',1,1,0,1)"}
				//MGMEM2 - Manage members of a community from the community navigator - need to pass in Community ID
				if (x2[0]=='MGMEM2') {title='Manage membership'; action="javascript:PopupBox('/Admin/CommunityMembership.asp?"+NbPre+"CommunityID="+x3[0]+"',650,450,'Manage Community Membership',1,1,0,1)"}
				if (x2[0]=='COMB') {title='Community broadcast'; action="javascript:PopupBox('/Admin/BroadcastCommunity.asp?"+NbPre+"EmailTemplateID="+x3[0]+"&CommunityID="+x3[1]+"',710,350,'Broadcast to community members',1,1,0,1)"}
				if (x2[0]=='OBPER') {title='Edit permissions'; action="javascript:PopupBox('/Admin/Permissions.asp?"+NbPre+"level=PAGEOBJECT&permissionid=?&workflowschemeid="+x3[2]+"&pageid="+x3[0]+"&objectid="+x3[1]+"',530,400,'',1,1,0,1)"}
				if (x2[0]=='SCDEL') {title='Delete this section'; action="javascript:PopupBox('/Admin/RemoveSection.asp?"+NbPre+"ObjectID="+x3[0]+"',300,170,'Delete this section',1,1,0,1)"}
				if (x2[0]=='MVIT') {title='Move/copy items'; action="javascript:PopupBox('/Admin/MoveCopy.asp?"+NbPre+"ObjectID="+x3[0]+"',610,400,'',1,1,0,1)"}
				if (x2[0]=='ITOD') {title='Order items'; action="javascript:PopupBox('/Admin/AutoOrdering.asp?"+NbPre+"mode=CONTENT&PageID="+x3[0]+"&ObjectID="+x3[1]+"',390,325,'',1,1,0,1)"}
				if (x2[0]=='ITPR') {title='Edit section details'; action="javascript:PopupBox('/Admin/NewEditSection.asp?"+NbPre+"create=false&sectiontype="+x3[0]+"&ObjectID="+x3[1]+"',760,450,'Edit section details',1,1,0,1)"}
				if (x2[0]=='OBSB') {title='Subscribe'; action="javascript:PopupBox('/Admin/ConfirmSubscribe.asp?"+NbPre+"subscriptiontype=SECTION&pageid="+x3[0]+"&objectid="+x3[1]+"',400,200,'Subscribe to this content section',1,1,0,1)"}
				if (x2[0]=='OBSBE') {title='Subscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"subscriptiontype=SECTION&pageid="+x3[0]+"&objectid="+x3[1]+"',400,225,'Subscribe everyone to this content section',1,1,0,1)"}
				if (x2[0]=='OBSBU') {title='Unsubscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"unsubscribe=true&subscriptiontype=SECTION&pageid="+x3[0]+"&objectid="+x3[1]+"',400,225,'Unsubscribe everyone from this content section',1,1,0,1)"}
				//NWIT = New item in a section
				if (x2[0]=='NWIT') {title=x3[9]; action="javascript:PopupBox('/Admin/Wizards/"+x3[0]+"/default.asp?"+NbPre+"pageid="+x3[1]+"&objectid="+x3[2]+"&contenttype="+x3[3]+"&csgid="+x3[4]+"&"+replaceSubstring(x3[5],'~','=')+"',"+x3[6]+","+x3[7]+",'Create a new "+x3[9]+"',1,1,"+x3[8]+",1)"}
				if (x2[0]=='EDAP') {title='Edit plugin properties'; action="javascript:PopupBox('/Admin/NewEditApplication.asp?"+NbPre+"create=false&ApplicationTypeID=?&ObjectID="+x3[0]+"',760,460,'',1,1,0,1)"}
				if (x2[0]=='DEPI') {title='Delete plugin'; action="javascript:PopupBox('/Admin/RemoveApplication.asp?"+NbPre+"ObjectID="+x3[0]+"',300,165,'Delete this plugin',1,1,0,1)"}
				if (x2[0]=='MGFRM') {title='Manage forums'; action="javascript:PopupBox('/Admin/ManageForums.asp?"+NbPre+"fromwebsiteconfig=false&create=true',530,330,'',1,1,0,1)"}
				if (x2[0]=='FRMSB') {title='Subscribe to entire forum'; action="javascript:PopupBox('/Admin/ConfirmSubscribe.asp?"+NbPre+"subscriptiontype=FORUM&PageID="+x3[0]+"&ObjectID="+x3[1]+"',400,200,'Subscribe to entire forum',1,1,0,1)"}
				if (x2[0]=='FRMSBE') {title='Subscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"subscriptiontype=FORUM&PageID="+x3[0]+"&ObjectID="+x3[1]+"',400,200,'Subscribe everyone to entire forum',1,1,0,1)"}
				if (x2[0]=='FRMSBU') {title='Unsubscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"unsubscribe=true&subscriptiontype=FORUM&PageID="+x3[0]+"&ObjectID="+x3[1]+"',400,200,'Unsubscribe everyone from entire forum',1,1,0,1)"}
				if (x2[0]=='NEWFM') {title='Add a new topic'; action="javascript:PopupBox('/Admin/NewEditTopic.asp?"+NbPre+"forumid="+x3[0]+"&pageobjectid="+x3[1]+"&create=true',530,330,'Add a new topic to the forum',1,1,0,1)"}
				if (x2[0]=='DCFSB') {title='Subscribe to document folder'; action="javascript:PopupBox('/Admin/ConfirmSubscribe.asp?"+NbPre+"subscriptiontype=DOCFOLDER&PageID="+x3[0]+"&ObjectID="+x3[1]+"',400,200,'Subscribe to document folder',1,1,0,1)"}
				if (x2[0]=='DCFSBE') {title='Subscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"subscriptiontype=DOCFOLDER&PageID="+x3[0]+"&ObjectID="+x3[1]+"',400,225,'Subscribe everyone to document folder',1,1,0,1)"}
				if (x2[0]=='DCFSBU') {title='Unsubscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"unsubscribe=true&subscriptiontype=DOCFOLDER&PageID="+x3[0]+"&ObjectID="+x3[1]+"',400,225,'Unsubscribe everyone from document folder',1,1,0,1)"}
				if (x2[0]=='DCLMO') {title='Order documents / images'; action="javascript:PopupBox('/Admin/AutoOrdering.asp?"+NbPre+"mode=CONTENT&PageID="+x3[0]+"&ObjectID="+x3[1]+"',390,325,'',1,1,0,1)"}
				//ILNW = New item in an image library
				if (x2[0]=='ILNW') {title='Add image(s)'; action="javascript:PopupBox('/Admin/Wizards/MultiUpload/Default.asp?"+NbPre+"PageID="+x3[0]+"&ObjectID="+x3[1]+"',750,480,'',1,1,1,0)"}
				//DCFNW = New item in a document folder
				if (x2[0]=='DCFNW') {title='Add document(s)'; action="javascript:PopupBox('/Admin/Wizards/MultiUpload/DocLib/Default.asp?"+NbPre+"PageID="+x3[0]+"&ObjectID="+x3[1]+"',750,480,'',1,1,1,0)"}
				if (x2[0]=='DCLOR') {
					if (x3[1]==0) {
						title=x3[0]; 
						action='/default.asp?'+NbPre+'DocLib'+x3[3]+'Order='+x3[2];
					} else {
						title='<font face=wingdings>&#252;</font> '+x3[0]; 
						action="#";
					}
				}
				if (x2[0]=='EDTPC') {title='Edit topic details'; action="javascript:PopupBox('/Admin/NewEditTopic.asp?"+NbPre+"forumid="+x3[0]+"&TopicID="+x3[1]+"&create=false&pageobjectid="+x3[2]+"',530,330,'Edit topic details',1,1,0,1)"}
				if (x2[0]=='DLTPC') {title='Delete this topic'; action="javascript:PopupBox('/Admin/ConfirmDeleteTopic.asp?"+NbPre+"forumid="+x3[0]+"&TopicID="+x3[1]+"&objectid="+x3[2]+"',300,190,'Delete this topic',1,1,0,1)"}
				if (x2[0]=='TCPST') {title='Post a message'; action="javascript:PopupBox('/Admin/NewEditPost.asp?"+NbPre+"forumid="+x3[0]+"&TopicID="+x3[1]+"&create=true&objectid="+x3[2]+"&RelatedContentID=',530,300,'Post a forum message',1,1,0,1)"}
				if (x2[0]=='DRYSB') {title='Subscribe to diary'; action="javascript:PopupBox('/Admin/ConfirmSubscribe.asp?"+NbPre+"subscriptiontype=DIARY&PageID="+NbPg+"&ObjectID="+x3[0]+"',400,200,'Subscribe to diary',1,1,0,1)"}
				if (x2[0]=='DRYSBE') {title='Subscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"subscriptiontype=DIARY&PageID="+NbPg+"&ObjectID="+x3[0]+"',400,200,'Subscribe everyone to diary',1,1,0,1)"}
				if (x2[0]=='DRYSBU') {title='Unsubscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"unsubscribe=true&subscriptiontype=DIARY&PageID="+NbPg+"&ObjectID="+x3[0]+"',400,200,'Unsubscribe everyone from diary',1,1,0,1)"}
				if (x2[0]=='DRYLV') {title=((x3[3]==1) ? '<font face=wingdings>&#252;</font> ' : '')+x3[2]; action='/default.asp?'+NbPre+'Diary'+x3[0]+'DS='+x3[1]+'&Diary'+x3[0]+'MNTH='+x3[4];}
				if (x2[0]=='DRYSE') {title=((x3[3]==1) ? '<font face=wingdings>&#252;</font> ' : '')+x3[2]; action='/default.asp?'+NbPre+'Diary'+x3[0]+'PER='+x3[1];}
				//DRYNE = New event in a diary
				if (x2[0]=='DRYNE') {title='New '+x3[5]; action="javascript:PopupBox('/Admin/Wizards/"+x3[0]+"/default.asp?"+NbPre+"PageID="+x3[1]+"&ObjectID="+x3[2]+"&ContentType="+x3[3]+"&"+replaceSubstring(x3[4],'~','=')+"',"+x3[6]+","+x3[7]+",'Create a new "+x3[5]+"',1,1,"+x3[8]+",1)"}
				if (x2[0]=='DRYNEM') {title='in '+x3[9]; action="javascript:PopupBox('/Admin/Wizards/"+x3[0]+"/default.asp?"+NbPre+"PageID="+x3[1]+"&ObjectID="+x3[2]+"&ContentType="+x3[3]+"&"+replaceSubstring(x3[4],'~','=')+"',"+x3[6]+","+x3[7]+",'Create a new "+x3[5]+"',1,1,"+x3[8]+",1)"}
				if (x2[0]=='NWET') {title=x3[3]; action="javascript:PopupBox('/Admin/Wizards/EMailTemplate/Default.asp?"+NbPre+"PageID="+x3[0]+"&EMailTemplateobjectid="+x3[1]+"&create=true&type="+x3[2]+"',750,480,'',1,1,1,0)"}
				//AE = Edit an item
				if (x2[0]=='AE') {title=x3[9]; action="javascript:PopupBox('/Admin/Wizards/"+x3[0]+"/default.asp?"+NbPre+"PageID="+x3[1]+"&ObjectID="+x3[2]+"&ContentID="+x3[3]+"&ContentType="+x3[4]+"&"+replaceSubstring(x3[5],'~','=')+"',"+x3[6]+","+x3[7]+",'"+x3[9]+"',1,1,"+x3[8]+",0)"}
				if (x2[0]=='DI') {title='Delete this item'; action="javascript:PopupBox('/Admin/DeleteContent.asp?"+NbPre+"pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',300,190,'Delete the selected item',1,1,0,1)"}
				if (x2[0]=='SI') {title='Subscribe'; action="javascript:PopupBox('/Admin/ConfirmSubscribe.asp?"+NbPre+"subscriptiontype=CONTENT&itemtype=ARTICLE&pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',400,200,'Subscribe to selected item',1,1,0,1)"}
				if (x2[0]=='SIE') {title='Subscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"subscriptiontype=CONTENT&itemtype=ARTICLE&pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',400,200,'Subscribe everyone to selected item',1,1,0,1)"}
				if (x2[0]=='SIU') {title='Unsubscribe Everyone'; action="javascript:PopupBox('/Admin/ConfirmSubscribeEveryone.asp?"+NbPre+"unsubscribe=true&subscriptiontype=CONTENT&itemtype=ARTICLE&pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',400,200,'Unsubscribe everyone from selected item',1,1,0,1)"}
				if (x2[0]=='IH') {title='Article / document history'; action="javascript:PopupBox('/Admin/DocumentHistory.asp?"+NbPre+"pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',750,440,'',1,1,0,1)"}
				if (x2[0]=='IP') {title='Permissions'; action="javascript:PopupBox('/Admin/Permissions.asp?"+NbPre+"level=CONTENT&permissionid=?&pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',530,400,'',1,1,0,1)"}
				//ARCH = Arcive / unarchive an item
				if (x2[0]=='ARCH') {title='Archive this item'; action="javascript:PopupBox('/Admin/ArchiveContentItem.asp?"+NbPre+"ArchiveContentID="+x3[0]+"',300,120,'Archive content item',1,0,0,1)"}
				if (x2[0]=='UNARCH') {title='Unarchive this item'; action="javascript:PopupBox('/Admin/UnarchiveContentItem.asp?"+NbPre+"ArchiveContentID="+x3[0]+"',300,120,'Unarchive content item',1,0,0,1)"}
				
				if (x2[0]=='IC') {title='Item checked out...'; action="javascript:PopupBox('/Admin/CheckoutStatus.asp?"+NbPre+"itempageid="+x3[0]+"&itemobjectid="+x3[1]+"&itemcontentid="+x3[2]+"',390,220,'Unarchive content item',1,1,0,1)"}
				if (x2[0]=='SMPNT') {title='Parent page (up)'; action='/default.asp?'+NbPre+'pg='+x3[0]}
				if (x2[0]=='SMP') {title=x3[1]; action='/default.asp?'+NbPre+'pg='+replaceSubstring(x3[0],'~','=')}
				if (x2[0]=='LSPR') {title='Properties'; action="javascript:PopupBox('/Admin/NewEditSectionLink.asp?"+NbPre+"Create=false&DestPageID="+x3[0]+"&DestObjectID="+x3[1]+"',660,420,'',1,1,0,1)"}
				if (x2[0]=='LSDE') {title='Delete'; action='/default.asp?'+NbPre+'DeletePageObject='+x3[0]+','+x3[1]}
				if (x2[0]=='LSGS') {title='Goto source page'; action='/default.asp?'+NbPre+'pg='+x3[0]}
				if (x2[0]=='DLEV') {title='Delete event'; action="javascript:PopupBox('/Admin/DeleteContent.asp?"+NbPre+"pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',300,190,'Delete this event',1,1,0,1)"}
				if (x2[0]=='EVPM') {title='Event Permissions'; action="javascript:PopupBox('/Admin/Permissions.asp?"+NbPre+"level=CONTENT&permissionid=?&pageid="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',530,400,'',1,1,0,1)"}
				//edit event
				if (x2[0]=='EDEV') {title='Edit ' + x3[9]; action="javascript:PopupBox('/Admin/Wizards/"+x3[0]+"/default.asp?"+NbPre+"PageID="+x3[1]+"&ObjectID="+x3[2]+"&ContentID="+x3[3]+"&ContentType="+x3[4]+"&"+replaceSubstring(x3[5],'~','=')+"',"+x3[6]+","+x3[7]+",'',1,1,"+x3[8]+",1)"}
				//WORKFLOW
				if (x2[0]=='CWF') {title='Cancel'; action="javascript:PopupBox('/Admin/CancelWorkflowProcess.asp?"+NbPre+"Mode="+x3[0]+"&PageID="+x3[1]+"&objectid="+x3[2]+"&contentid="+x3[3]+"&WorkflowSchemeID="+x3[4]+"&WorkflowStatusID="+x3[5]+"',400,180,'',1,1,0,1)"}
				if (x2[0]=='RSWF') {title='Re-submit for approval'; action="javascript:PopupBox('/Admin/ReSubmitApproval.asp?"+NbPre+"Mode="+x3[0]+"&PageID="+x3[1]+"&objectid="+x3[2]+"&contentid="+x3[3]+"&WorkflowSchemeID="+x3[4]+"&WorkflowStatusID="+x3[5]+"',400,180,'',1,1,0,1)"}
				if (x2[0]=='WFAP') {title=x3[7]; action="javascript:PopupBox('/Admin/ConfirmApprovalAction.asp?"+NbPre+"Mode="+x3[0]+"&PageID="+x3[1]+"&objectid="+x3[2]+"&contentid="+x3[3]+"&WorkflowSchemeID="+x3[4]+"&WorkflowStatusID="+x3[5]+"&ActionID="+x3[6]+"',500,230,'Confirm Approval Action',1,1,0,1)"}
				if (x2[0]=='WFSD') {title='Show differences'; action="javascript:PopupBox('/Admin/ShowDifferences.asp?"+NbPre+"PageID="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',750,480,'',1,1,0,1)"}
				if (x2[0]=='WFRA') {title='Re-assign'; action="javascript:PopupBox('/Admin/WorkflowReassign.asp?"+NbPre+"PageID="+x3[0]+"&objectid="+x3[1]+"&contentid="+x3[2]+"',600,400,'',1,1,0,1)"}
				
				if (x2[0]=='MCPI') {title='Manage Contacts'; action="javascript:PopupBox('/Admin/ManageContacts.asp?"+NbPre+"SrcBoxPageID="+x3[0]+"&SrcBoxObjectID="+x3[1]+"',700,500,'Manage Contacts',1,1,0,1)"}
				if (x2[0]=='ABOUT') {title='About Nebula'; action="javascript:PopupBox('/Admin/About.asp?"+NbPre+"',420,125,'',1,1,0,1)"}
				if (x2[0]=='IMP') {title='Impersonate a user'; action="javascript:PopupBox('/Admin/Impersonate.asp?"+NbPre+"',420,400,'',1,1,0,1)"}
				if (x2[0]=='IMPO') {title='Impersonate another user'; action="javascript:PopupBox('/Admin/Impersonate.asp?"+NbPre+"',420,400,'',1,1,0,1)"}
				if (x2[0]=='IMPR') {title='Revert back to your login'; action='/default.asp?'+NbPre+'action=impersonaterevert'}
				if (x2[0]=='RTHEM') {title='Refresh theme files'; action='/default.asp?'+NbPre+'action=refreshthemefiles'}
				if (x2[0]=='PCUD') {title='Update pages cache enabled flag'; action='/default.asp?'+NbPre+'action=updatecacheenabledflag'}
				//if (x2[0]=='CICD') {title='Clear binary cache (with delete)'; action='/default.asp?'+NbPre+'action=clearimagecachedelete'}
				if (x2[0]=='CICND') {title='Clear binary cache (no delete)'; action='/default.asp?'+NbPre+'action=clearimagecachenodelete'}
				if (x2[0]=='DPCC') {title='Delete page cache for this page'; action='/default.asp?'+NbPre+'action=deletepagecachecurrent'}
				if (x2[0]=='DPCW') {title='Delete page cache for the entire site'; action='/default.asp?'+NbPre+'action=deletepagecachesite'}
				if (x2[0]=='RTHEM') {title='Refresh theme files'; action='/default.asp?'+NbPre+'action=refreshthemefiles'}
			
			
				if (x2[0]=='MGREF') {title='Manage reference terms'; action="javascript:PopupBox('/Admin/ManageReferenceTerms.asp?"+NbPre+"',690,350,'',1,1,0,1)"}
				if (x2[0]=='DEVW') {title='View meeting / event'; action='/default.asp?'+NbPre+'Diary' + x3[0] + 'VIEW=' + x3[1] + '&UseDiaryID=' + x3[0]}
				if (x2[0]=='NAR') {title=x3[1]; action="javascript:PopupBox('/Admin/NebulaAnalyserReport.asp?"+NbPre+"applicationtypeid="+x3[0]+"',500,350,'',1,1,0,1)"}
				if (x2[0]=='ASWAS') {title='Change AsWas snapshot date'; action="javascript:PopupBox('/Admin/ChangeArchiveDate.asp?"+NbPre+"',350,215,'Change AsWas snapshot date',1,1,0,1)"}
				if (x2[0]=='PGRFS') {title='Refresh'; action="javascript:PopupBox('/Admin/PageRefresh.asp?"+NbPre+"',350,185,'Refresh page',1,1,0,1)"}
				
				//Security menu
				if (x2[0]=='MGU') {title='Users'; action="javascript:PopupBox('/Admin/ManageUsers.asp?"+NbPre+"',950,580,'',1,1,0,1)"}
				if (x2[0]=='MGG') {title='Groups'; action="javascript:PopupBox('/Admin/ManageGroups.asp?"+NbPre+"',690,350,'',1,1,0,1)"}
				if (x2[0]=='MGR') {title='Roles'; action="javascript:PopupBox('/Admin/ManageUserRights.asp?"+NbPre+"',400,350,'',1,1,0,1)"}
				if (x2[0]=='MGC') {title='Companies'; action="javascript:PopupBox('/Admin/ManageCompanies.asp?"+NbPre+"',600,330,'',1,1,0,1)"}
				if (x2[0]=='MGW') {title='Workflow'; action="javascript:PopupBox('/Admin/WorkflowSchemes.asp?"+NbPre+"',690,380,'',1,1,0,1)"}
				if (x2[0]=='ULU') {title='Unlock Users'; action="javascript:PopupBox('/Admin/UnlockUsers.asp?"+NbPre+"',690,380,'',1,1,0,1)"}

				//Contact management
				if (x2[0]=='AUC') {title='Add a contact'; action="javascript:PopupBox('/Admin/CreateEditContact.asp?" + NbPre + "PageID=" + x3[0] + "&RightGroupID=" + x3[1] + "&create=true',710,500,'Add a contact',1,1,0,1)"}
				if (x2[0]=='EUC') {title='Edit the contact'; action="javascript:PopupBox('/Admin/CreateEditContact.asp?" + NbPre + "UserID=" + x3[0] + "&RightGroupID=" + x3[1] + "&edit=true', 710, 500, 'Edit the contact', 1, 1, 0, 1)"}
				if (x2[0]=='DUC') {title='Delete the contact'; action="javascript:PopupBox('/Admin/DeleteContact.asp?" + NbPre + "UserID=" + x3[0] + "&delete=true', 400, 320, 'Delete the contact', 1, 1, 0, 1)"}
				if (x2[0]=='ACC') {title='Add an organisation'; action="javascript:PopupBox('/Admin/CreateEditCompanyContact.asp?" + NbPre + "PageID=" + x3[0] + "&RightGroupID=" + x3[1] + "&create=true',400,485,'Add an organisation',1,1,0,1)"}
				if (x2[0]=='ECC') {title='Edit the organisation'; action="javascript:PopupBox('/Admin/CreateEditCompanyContact.asp?" + NbPre + "CompanyID=" + x3[0] + "&edit=true', 400, 485, 'Edit the organisation', 1, 1, 0, 1)"}
				if (x2[0]=='DCC') {title='Delete the organisation'; action="javascript:PopupBox('/Admin/ConfirmDeleteCompanyContact.asp?" + NbPre + "WebsiteID=" + x3[0] + "&CompanyID=" + x3[1] + "', 300, 200, 'Delete the organisation', 1, 1, 0, 1)"}
				if (x2[0]=='VUC') {title='View contact details'; action="javascript:PopupBox('/Admin/ViewContact.asp?" + NbPre + "&UserID=" + x3[0] + "', 710, 400, 'View contact details', 1, 1, 0, 1)"}
				if (x2[0]=='VCC') {title='View organisation details'; action="javascript:PopupBox('/Admin/ViewCompany.asp?" + NbPre + "&CompanyID=" + x3[0] + "', 710, 400, 'View organisation details', 1, 1, 0, 1)"}

				//Reports
				if (x2[0]=='REPWF') {title='Workflow schemes'; action="javascript:NewWindow('/Admin/Reports/WorkflowSchemes.asp?" + NbPre + "',750,550,'yes')"}				
				if (x2[0]=='REPP') {title='Permissions'; action="javascript:NewWindow('/Admin/Reports/Permissions.asp?" + NbPre + "',750,550,'yes')"}
				if (x2[0]=='REPOI') {title='Outstanding Items'; action="javascript:NewWindow('/Admin/Reports/OutstandingItems.asp?" + NbPre + "',750,550,'yes')"}
				if (x2[0]=='REPLU') {title='Locked Users'; action="javascript:NewWindow('/Admin/Reports/LockedUsers.asp?" + NbPre + "',750,550,'yes')"}
				if (x2[0]=='REPAU') {title='All Users'; action="javascript:NewWindow('/Admin/Reports/AllUsers.asp?" + NbPre + "',750,550,'yes')"}
				if (x2[0]=='REPCU') {title='Users By Company'; action="javascript:NewWindow('/Admin/Reports/CompanyUsers.asp?" + NbPre + "',750,550,'yes')"}
				if (x2[0]=='REPH7') {title='Hits In Last 7 Days'; action="javascript:NewWindow('/Admin/Reports/HitsInLast7Days.asp?" + NbPre + "',750,550,'yes')"}
				if (x2[0]=='REPEP7') {title='Exit Pages In Last 7 Days'; action="javascript:NewWindow('/Admin/Reports/ExitPagesLast7Days.asp?"+NbPre+"',750,550,'yes')"}
								
				//TRANSACTION FOLDERS
				if (x2[0]=='TRXC') {title='New '+x3[1]; action="javascript:PopupBox('/Admin/TransactionCreateEdit.asp?"+NbPre+"TransactionCode="+x3[0]+"&PageID="+x3[2]+"&ObjectID="+x3[3]+"&ContentID="+x3[4]+"&Action="+x3[5]+"',760,460,'',1,1,0,0)"}
				if (x2[0]=='TRXE') {title='Edit '+x3[1]; action="javascript:PopupBox('/Admin/TransactionCreateEdit.asp?"+NbPre+"TransactionCode="+x3[0]+"&PageID="+x3[2]+"&ObjectID="+x3[3]+"&ContentID="+x3[4]+"&Action="+x3[5]+"',760,460,'',1,1,0,0)"}				
				if (x2[0]=='WFH') {title='Workflow History'; action="javascript:PopupBox('/Admin/WFProcesses.asp?"+NbPre+"PageID="+x3[0]+"&ObjectID="+x3[1]+"&ContentID="+x3[2]+"',740,520,'Workflow History',1,0,0,1)"}
								
				temp[count]=[title,action,rollover,highlight,children];
				
				//alert(temp[count]);
			}	//end for
			
			//move down the hierarchy of menus
			eval(arrayname + '=temp');
			for (count=1;count<100;count++) {
				PreParseMenu(arrayname + '_' + count,true);
			}	//end for
		}	//end if quick or forcequick
	}
}

function replaceSubstring(inputString, fromString, toString) {
   var temp = inputString;
   if (fromString == "") {
      return inputString;
   }
   if (toString.indexOf(fromString) == -1) {
      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } else {
      var midStrings = new Array("~", "`", "_", "^", "#");
      var midStringLen = 1;
      var midString = "";
      while (midString == "") {
         for (var i=0; i < midStrings.length; i++) {
            var tempMidString = "";
            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
            if (fromString.indexOf(tempMidString) == -1) {
               midString = tempMidString;
               i = midStrings.length + 1;
            }
         }
      }

      while (temp.indexOf(fromString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(fromString));
         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
         temp = toTheLeft + midString + toTheRight;
      }
      while (temp.indexOf(midString) != -1) {
         var toTheLeft = temp.substring(0, temp.indexOf(midString));
         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
         temp = toTheLeft + toString + toTheRight;
      }
   } 
   return temp;
} 
//------------
function hideApp(AppID) 
{	var thisApp = document.getElementById(AppID);
	thisApp.style.display = "none";
}
//------------
function showApp(AppID) 
{	var thisApp = document.getElementById(AppID);
	if (thisApp.style.display == "none") 
		{thisApp.style.display = "block";}
	else 
		{hideApp(AppID);}
}
//------------
NB_Lded[1]=true;


