var b="<a href=javascript:void(0) onfocus=blur()"
var d=" style=display:none"
var n=" onmouseover=_MENU(this,1) onmouseout=_MENU(this)"
var m=" onmouseover=_MENU(0,1,this) onmouseout=_MENU(0,0,this)"

var a=""
a+="<link rel=stylesheet href=/modules/text/manager_edit.css>"
a+="<script src=/modules/text/area.js></script>"
a+="<script src=/modules/text/link.js></script>"
a+="<script src=/modules/text/tip.js></script>"
a+="<script src=/modules/text/text.js></script>"
a+="<script src=/modules/text/menu.js></script>"
a+="<script src=/shared/select_menu.js></script>";
a+="<script src=/shared/color/C.js></script>"


a+="<span id=EDIT_T>"
a+="<table class=TabS id=TabS style=width:"+(FF?"100%":ww)+">"
a+="<tr><th>"
a+="<em"+d+"><s></s>H &times; <s></s>W</em><em"+d+">&lt;<s></s>&gt;</em><em"+d+"><s></s>Y <s></s>X</em>"
a+=b+" onmouseover=\"T_S(event,'Hide toolbar<br>Scroll to return',1)\" onclick=\"document.getElementById('TabS').style.visibility='hidden'\">&#9668;</a>"
a+=b+" onclick=/modules/text/manager.php id=Mq_1Pag"+n+">Page</a>"
a+=b+" id=Mq_1Tmp"+n+">Template</a>"
//a+=b+" lang=_M_9style id=Mq_1style"+n+">Style</a>"
a+=b+" lang=_M_9area id=Mq_1area"+n+">Area</a>"
//a+=b+" lang=_M_9text onmouseover=\"T_S(event,'Click here to enter Text mode, then Click on objects and change their text content')\">Text</a>"
a+=b+" lang=_M_9link id=Mq_1link"+n+">Link</a>"
//a+=b+" lang=_M_9tip onmouseover=\"T_S(event,'Click here to enter Tooltip mode, then Click on objects to apply or edit their tooltip')\">Tooltip</a>"
a+=b+" lang=_M_9menu id=Mq_1menu"+n+">Menu</a>"
//a+=b+" lang=_M_9form id=Mq_1form"+n+">Form</a>"
a+=b+" onclick=\"location=location.href\">Reload</a>"
a+="</th></tr>"
a+="<tr><td><br></td></tr>"
a+="</table>"
a+="</span>"


a+="<span class=TabP>"

a+="<p id=Mp_Pag"+m+d+">"
a+=b+" onclick=P.W('Page_Details','/modules/text/page_detail.php?Pid="+Pid+"',520)>Details</a>"
if(P.CONTENT['PAGES'])
	a+=b+" id=Mq_2Pgg"+n+">Pages</a>"
a+=b+" onclick=P.W('Search_Engine_Optimisation','/modules/htmlexport/start.php') onmouseover=\"T_S(event,'Search engine<br>optimisation',1)\">SEO</a>"
a+=b+" onclick=P.W('Export_Site','/modules/htmlexport/export.php?WR="+W+"');P.WMN(W) onmouseover=\"T_S(event,'Export the site to go live',1)\">Export</a>"
a+="</p>"

if(P.CONTENT['PAGES'])
{
	a+="<p id=Mp_Pgg"+m+d+">"
	a+=b+" onclick=\"P.WNC(W,'Page: New');location='/modules/text/manager.php?newPage=1&WR="+WR+"'\">New Page</a>"
	a+=b+" onclick=P.W('Pages','/modules/text/pages.php?WR="+W+"',P.wh,P.ww,0,0,2) onmouseover=\"T_S(event,'The Page List window allows editing and deletion of pages')\">Page List &#9660;</a>"
	var p=P.CONTENT['PAGES'].split("}")
	a+=(p.length>10?"<em style=height:189>":"")
	var i=0
	while(p[i])
	{
		var q=p[i].split("|")
		a+=b+(q[0]==Pid?" class=active":" onclick=\"P.WNC(W,'Page:_"+q[2]+"');location='/modules/text/manager.php?page="+q[1]+"'\"")+" onmouseover=\"T_S(event,'Link="+q[1]+"<br>Id="+q[0]+"',1)\">"+q[2].replace(/_/g," ")+"</a>"
		i++
	}
	a+=(p.length>10?"</em>":"")
	a+="</p>"
}

a+="<p id=Mp_Tmp"+m+d+">"
a+=b+" id=Mq_2Tmp3"+n+">Edit</a>"
a+=b+" id=Mq_2Tmp1"+n+">Switch</a>"
a+=b+" id=Mq_2Tmp2"+n+">Back-Ups</a>"
a+=b+" onclick=P.W('Upload_Template','/modules/text/upload_template.php') onmouseover=\"T_S(event,'	Upload to the Templates folder')\">Upload</a>"
a+="</p>"

a+="<p id=Mp_Tmp1"+m+d
if(P.CONTENT['TEMPLATES'])
{
	a+=">"
	var p=P.CONTENT['TEMPLATES'].split("}")
	a+=(p.length>10?"<em style=height:189>":"")
	var i=0
	while(p[i])
	{
		var q=p[i].split("|")
		a+=b+(q[0]==Tid?" class=active":" onclick=temp_set("+q[0]+")")+" onmouseover=\"T_S(event,'<b>Switch Template</b><br>File: "+q[2]+"<br>Id="+q[0]+"',1)\">"+q[1]+"</a>"
		i++
	}
	a+=(p.length>10?"</em>":"")
}
else
	a+=" class=TabT>None available"
a+="</p>"

if(P.CONTENT['TEMPLATES'])
{
	a+="<p id=Mp_Tmp3"+m+d+">"
	var p=P.CONTENT['TEMPLATES'].split("}")
	a+=(p.length>10?"<em style=height:189>":"")
	var i=0
	while(p[i])
	{
		var q=p[i].split("|")
		a+=b+" onclick=\"P.W('Edit_Template:_"+q[1]+"_/_File:_"+q[2]+"','/modules/text/temp_edit.php?WR="+W+"&Tid="+q[0]+"',P.wh,P.ww,0,0,2);P.WMN(W)\" onmouseover=\"T_S(event,'<b>Edit Template</b><br>File: "+q[2]+"<br>Id="+q[0]+"',1)\""+(q[0]==Tid?" class=active":"")+">"+q[1]+"</a>"
		i++
	}
	a+=(p.length>10?"</em>":"")
	a+="</p>"
}

a+="<p id=Mp_Tmp2"+m+d
if(P.CONTENT['TEMPLATE_BACKUPS'])
{
	a+=">"
	var p=P.CONTENT['TEMPLATE_BACKUPS'].split("}")
	a+=(p.length>10?"<em style=height:189>":"")
	var i=0
	while(p[i])
	{
		var q=p[i].split("|")
		a+=b+" onclick="+(q[0]==Tid?0:"temp_set("+q[0]+")")+(q[0]==Tid?" class=m0n onmouseover=\"T_S(event,'Current template',1)\"":"")+">"+q[1]+"</a>"
		i++
	}
	a+=(p.length>10?"</em>":"")
	a+=b+" onclick=temp_del() onmouseover=\"T_S(event,'Permanently delete all backup templates')\">Delete</a>"
}
else
	a+=" class=TabT>None available"
a+="</p>"

a+="<p id=Mp_style"+m+d+">"
a+=b+" lang=_M_1style onmouseover=\"T_S(event,'Edit styles found in the cascading style sheets')\">Edit</a>"
a+=b+" lang=_M_2style onmouseover=\"T_S(event,'View style sheets',1)\">View</a>"
a+="</p>"

a+="<p id=Mp_area"+m+d+">"
a+=b+" lang=_M_1area onmouseover=\"T_S(event,'Click to enter Edit Area mode, Then Click on objects to assign or select as areas - or hold the A-Key and click')\">Edit</a>"
a+=b+" lang=_M_2area onmouseover=\"T_S(event,'Click to enter New Area mode, Then Click on objects to assign areas')\">Insert</a>"
a+="</p>"

a+="<p id=Mp_menu"+m+d+">"
a+=b+" lang=_M_1menu onmouseover=\"T_S(event,'Click on objects to assign a dropdown menu. Click on sub-menus to edit them.<br><b>IMPORTANT!</b> Its better to assign drop down menus to links and images that have a height and width. Avoid assigning menus to tags that contain other objects')\">Edit</a>"
a+=b+" lang=_M_2menu onmouseover=\"T_S(event,'Edit the look and feel of menus')\">Style</a>"
a+="</p>"

a+="<p id=Mp_form"+m+d+">"
a+=b+" lang=_M_1form onmouseover=\"T_S(event,'Once an area is clicked on, a new empty form will appear. Then click on the area and a window for adding elements will appear. Add various form elements and then save.<br><b>IMPORTANT!</b> All forms created this way will be contained in a table with 2 columns for descriptor and field')\">Info</a>"
a+=b+" lang=_M_2form onmouseover=\"T_S(event,'Edit the look and feel of the form')\">Style</a>"
a+="</p>"

// menu addr
if(P.CONTENT['PAGES'])
{
	a+="<p id=Mp_Maddr onmouseover=_MENU(0,1,this) onmouseout=_MENU(0,0,this)"+d+">"
	var p=P.CONTENT['PAGES'].split("}")
	a+=(p.length>10?"<em style=height:189>":"")
	var i=0
	while(p[i])
	{
		var q=p[i].split("|")
		a+=b+(q[0]==Pid?" class=active":" onclick=MENU_insert_address(this.lang) lang=\""+q[1]+"\" onmouseover=\"T_S(event,'/index.php?page="+q[1]+"',1)\"")+">"+q[2].replace(/_/g," ")+"</a>"
		i++
	}
	a+=(p.length>10?"</em>":"")
	a+="</p>"
}

// menu targets
a+="<p id=Mp_Madtg onmouseover=_MENU(0,1,this) onmouseout=_MENU(0,0,this)"+d+">"
a+=b+"onclick=MENU_insert_address(this.lang,1) lang='' onmouseover=\"T_S(event,'Default',1)\">Replace this Page</a>"
a+=b+"onclick=MENU_insert_address(this.lang,1) lang='_blank' onmouseover=\"T_S(event,'_blank',1)\">New Window/Tab</a>"
a+="</p>"

a+="</span>"


// zones
a+="<span id=EDIT_Z>"
a+="<table id=EDIT_shld"+d+"><tr><td><br></td></tr></table>"
a+="<table id=EDIT_z0ff"+d+"><tr><td><br></td></tr></table>"
a+="<span id=EDIT_zAs"+d+"></span>"
a+="<div id=EDIT_zAi"+d+"></div>"
a+="<div id=EDIT_zhl"+d+" onclick=EDIT_close()></div>"
a+="</span>"


// windows
a+="<span id=EDIT_W>"

var st1="<tr><td><img src=/W/S1.png height=8 width=8></td><td style='background:url(/W/S2.png) repeat-x bottom left'></td><td><img src=/W/S3.png height=8 width=16></td></tr><tr><td style='background:url(/W/S8.png) repeat-y top left'></td>"
var st2="</td><td style='background:url(/W/S4.png) repeat-y top right'></td></tr><tr><td><img src=/W/S7.png height=16 width=8></td><td style='background:url(/W/S6.png) repeat-x top left'></td><td><img src=/W/S5.png height=16 width=16></td></tr></table>"

// links
a+="<table id=LINK_box"+d+">"
a+=st1
a+="<td class=edittd>"
a+="<h5 lang=m00v>Link Editor</h5>"
a+="<div>Display<input type=text onkeyup=LINK_value(this,0) style='margin:0 0 0 8' onmouseover=\"T_S(event,'Set how the link will display to users. TIP short phrases are best')\"></div>"
a+="<div id=ml_tt>Tool-tip<input type=text onkeyup=LINK_value(this,1) style='margin:0 0 0 6' onmouseover=\"T_S(event,'Attach a descriptive tool-tip (like this one) to the link')\"></div>"
a+="Address<input type=text onkeyup=LINK_value(this,2) style='margin:0 0 0 2' "+(P.CONTENT['PAGES']?"id=Mq_1Maddr onclick=_MENU(this,1) onmouseout=_MENU(this)":"onmouseover=\"T_S(event,'Add the address for the link.')\"")+"></div>"
a+="<div id=ml_tg>Target<input type=text onkeyup=LINK_value(this,3) style='margin:0 0 0 12' id=Mq_1Madtg onclick=_MENU(this,1) onmouseout=_MENU(this)></div>"
a+="<button onclick=LINK_remove() onmouseover=\"T_S(event,'Remove this link from page',1)\">Remove</button>"
a+="<button onclick=LINK_dupli() onmouseover=\"T_S(event,'Duplicate link here',1)\">Duplicate</button>"
a+=st2

// text box
a+="<table id=TIP_box"+d+">"
a+=st1
a+="<td class=edittd>"
a+="<h5 lang=m00v>ToolTip Editor</h5>"
a+="<div id=ml_tt>Tool-tip<input type=text onkeyup=TIP_value(this,1) style='margin:0 0 0 6' onmouseover=\"T_S(event,'Attach a descriptive tool-tip (like this one) to the link')\"></div>"
a+="<button onclick=TIP_remove() onmouseover=\"T_S(event,'Remove this tooltip from object',1)\">Remove</button>"
a+=st2

// menu link
a+="<table id=MENU_link onmousemove=EDIT_mw('MENU_link') onclick=EDIT_mw('MENU_link')"+d+">"
a+=st1
a+="<td class=edittd>"
a+="<h5 lang=m00v>Menu Editor</h5>"
a+="<div>Display<input type=text onkeyup=MENU_value(this,1) style='margin:0 0 0 8' onmouseover=\"T_S(event,'Set how the link will display to users. TIP short phrases are best')\"></div>"
a+="<div id=ml_tt>Tool-tip<input type=text onkeyup=MENU_value(this,4) style='margin:0 0 0 6' onmouseover=\"T_S(event,'Attach a descriptive tool-tip (like this one) to the link')\"></div>"
a+="<div id=ml_ah>"
a+="Address<input type=text onkeyup=MENU_value(this,2) style='margin:0 0 0 2' "+(P.CONTENT['PAGES']?"id=Mq_1Maddr onclick=_MENU(this,1) onmouseout=_MENU(this)":"onmouseover=\"T_S(event,'Add the address for the link.')\"")+"></div>"
a+="<div id=ml_tg>Target<input type=text onkeyup=MENU_value(this,3) style='margin:0 0 0 12' id=Mq_1Madtg onclick=_MENU(this,1) onmouseout=_MENU(this)></div>"
a+="<button onclick=MENU_move(1) onmouseover=\"T_S(event,'Move link up',1)\">&#9650;</button>"
a+="<button onclick=MENU_move() onmouseover=\"T_S(event,'Move link down',1)\">&#9660;</button>"
a+="<button onclick=MENU_add() onmouseover=\"T_S(event,'Add links to this menu',1)\">Add</button>"
a+="<button onclick=MENU_remove() onmouseover=\"T_S(event,'Remove this link from menu',1)\">Remove</button>"
a+="<button id=ml_ac onclick=MENU_child(2) onmouseover=\"T_S(event,'Attach a menu to link',1)\">Menu</button>"
a+=st2

// menu children
a+="<table id=MENU_children onmousemove=EDIT_mw('MENU_children') onclick=EDIT_mw('MENU_children')"+d+">"
a+=st1
a+="<td class=edittd>"
a+="<h5 lang=m00v>Menu Child</h5>"
a+="<div><select id=mc_d onchange=MENU_child(value) onmouseover=\"T_S(event,'Select the position of the dropdown menu')\"><option value=0>Position<option value=1>Below<option value=2>Right</select></div>"
a+="<center>"
a+="<div><button id=mc_r onclick=\"if(confirm('WARNING!\\nThis action cannot be undone!\\nProceed with deletion of all associated menus?')){MENU_child(0,E_O.id);MENU_act++;EDIT_doSave();MENU_close()}\">Remove Menu</button></div>"
a+="</center>"
a+=st2

// menu styles
a+="<table id=MENU_style"+d+";top:200;left:200>"
a+=st1
a+="<td class=edittd>"
a+="<h5 lang=m00v>Menu Styler</h5>"
a+="<div id=MENU_eg style=color:"+MENUs[0]+";background:"+MENUs[1]+";border-color:"+MENUs[4]+" onmouseover=\"this.style.color=MENUs[2];this.style.background=MENUs[3]\" onmouseout=\"this.style.color=MENUs[0];this.style.background=MENUs[1]\">Sample Link</div>"
a+="<button onclick=MENU_col(this,0,event) onmouseover=T_S(event,MENUs[0],1)>Text Colour</button>"
a+="<button onclick=MENU_col(this,1,event) onmouseover=T_S(event,MENUs[1],1)>Background</button>"
a+="<button onclick=MENU_col(this,2,event) onmouseover=T_S(event,MENUs[2],1)>Hover Colour</button>"
a+="<button onclick=MENU_col(this,3,event) onmouseover=T_S(event,MENUs[3],1)>Hover Background</button>"
a+="<button onclick=MENU_col(this,4,event) onmouseover=T_S(event,MENUs[4],1)>Border Colour</button>"
a+=st2

a+="</span>"

document.write(a)


function TabScroll(h)
{
	clearTimeout(MENU_t["tabS"])
	var t=document.getElementById("TabS")
	if(h)
	{
		if(h==99)
		{
			t.style.top=sy-t.offsetHeight
			MENU_t["tabS"]=setTimeout("TabScroll(1)",16)
		}
		else
		{
			t.style.visibility=""
			var y=parseInt(t.style.top)
			if(y<sy)
			{
				t.style.top=y+1
				MENU_t["tabS"]=setTimeout("TabScroll(1)",16)
			}
		}
	}
	else
	{
		var y=parseInt(t.style.top)
		if(y!=sy||t.style.visibility=="hidden")
		{
			var h=y+t.offsetHeight
			if(sy>y&&sy<h)
				MENU_t["tabS"]=setTimeout("TabScroll(1)",800)
			else
			{
				t.style.visibility="hidden"
				MENU_t["tabS"]=setTimeout("TabScroll(99)",800)
			}
		}
	}
}
