//theJavascriptBody
var statusHelp = new Array();
var popupHelp = new Array();
function loadBodyMenu(vActionList)
{
var vActionTemp= new theActionList()
vActionTemp=vActionList
/*
<h2>No documents found</h2>
*/
return vActionTemp
}
function BodyStyleEdits(frm){return true};function popupHelp(field){return false};function statusHelp(field){return false}

var vImageBefore;
//alert(statusHelp("NamePlayer"))
var vEditCount=0;
var vView = new Array;
var vCount=-1;
function change(id, newClass) {

identity=document.getElementById(id);

identity.className=newClass;
//alert(identity.className)
}

function chkVer(imagename,objectsrc)
{
var n=navigator.appName
var v=parseInt(navigator.appVersion)
var browsok=((n=="Netscape")&&(v>=3))
var browsok2=((n=="Microsoft Internet Explorer")&&(v>=4))
if ((browsok)||(browsok2))
	{
	vImageBefore=document.images[imagename].src
	document.images[imagename].src=eval(objectsrc+".src")
	}
}
/* the pararmeter logic was removed - this logic is not currently used.  if reimplemented use layout profile or switch to body setting or move to Layout Javascript - probable the latter)
*/
function theArrayView(theID,
	theSubject,
	theDescription,
	theProductHTML,
	theEditMode,
	theSummary
	)
{
	this.length=6;
	this.ID=theID;
	this.Subject=theSubject;
	this.Description=theDescription;
	this.ProductHTML=theProductHTML;
	this.EditMode=theEditMode;
	this.Summary=theSummary;
if(theEditMode==vDocument["EditMode"] | theEditMode=="Both")
	{vEditCount=vEditCount+1}
}
function theTemp(theID,
	theSubject,
	theDescription,
	theCommand,
	theMode,
	theType)
{
	this.ID=theID;
	this.Subject=theSubject;
	this.Description=theDescription;
	this.Command=theCommand;
	this.Mode=theMode;
	this.Type=theType;
}
function theTempList()
{
var List
this.List = []
this.addToTemp=addToTemp;
}
function addToTemp(theID,
	theSubject,
	theDescription,
	theCommand,
	theMode,
	theType)
{
	this.List[this.List.length]=new theTemp(theID,theSubject,theDescription,theCommand,theMode,theType)
}
function theAction(theID,
	theSubject,
	theDescription,
	theCommand,
	theMode,
	theType
	)
{
	this.ID=theID;
	this.Subject=theSubject;
	this.Description=theDescription;
	this.Command=theCommand;
	this.Mode=theMode;
	this.Type=theType;
}
function theActionList()
{
var List
this.List = []
this.addToAction=addToAction;
}
function addToAction(theID,
	theSubject,
	theDescription,
	theCommand,
	theMode,
	theType)
{
if(theMode==vDocument["EditMode"] | theMode=="Both")
	{
	this.List[this.List.length]=new theAction(theID,theSubject,theDescription,theCommand,theMode,theType)
	}
}
function theMenuList()
{
var MenuList
this.MenuList = []
this.addToMenu=addToMenu;
//this.vObject=vObject;
}
function getListStyle(vStyle)
{
if(vStyle="Override Definition")
	{
	return ''
	}
else
	{
	return ''
	}
}
function addToMenu(vMenuItem)
{
this.MenuList[this.MenuList.length]=vMenuItem
}
function theSublist()
{
var Sublist
this.Sublist = []
this.addToSub=addToSub;
}
function addToSub(vSubItem)
{
this.Sublist[this.Sublist.length]=vSubItem
}
function writeMenu(vArray,vMainWidth,vSubWidth,vFromTop,vFromSide)
{
if(typeof vMainWidth=='undefined')
	{vMainWidth=90};
if(typeof vSubWidth=='undefined')
	{vSubWidth=150};
if(typeof vFromTop=='undefined')
	{vFromTop=10};
if(typeof vFromSide=='undefined')
	{vFromSide=40};
var BLANK_IMAGE="/icons/ecblank.gif";
//keywords
var code="code";var url="url";var sub="sub";
//styles
var color = {"border":"#666666", "shadow":"#DBD8D1", "bgON":"white","bgOVER":"#efefef"};
var css = {"ON":"clsCMOn", "OVER":"clsCMOver"};
var STYLE = {"border":1, "shadow":0, "color":color, "css":css};
var defcolor = {"border":"#666666", "shadow":"#DBD8D1", "bgON":"white","bgOVER":"#B6BDD2", "imagebg":"#DBD8D1", "oimagebg":"#B6BDD2"};
var topcolor = {"border":"#666666", "shadow":"#DBD8D1", "bgON":"white","bgOVER":"#efefef"};
var defcss = {"ON":"clsCMTopOn", "OVER":"clsCMTopOver"};
var TOP_LEFT = {"border":1, "borders":[1,1,0,1], "shadow":2, "color":defcolor, "css":defcss};
var TOP_MIDDLE = {"border":1, "borders":[0,1,0,1], "shadow":2, "color":topcolor, "css":defcss};
var TOP_RIGHT = {"border":1, "borders":[0,1,1,1],"shadow":2, "color":defcolor, "css":defcss};
var STYLE1 = {"border":1, "borders":[1,0,1,0], "shadow":2, "color":defcolor, "css":defcss};
var STYLE_TOP = {"border":1, "borders":[1,1,1,0], "shadow":2, "color":defcolor, "css":defcss};
var STYLE_BOTT = {"border":1, "borders":[1,0,1,1], "shadow":2, "color":defcolor, "css":defcss};
//items and formats
var vMenuList = new theMenuList(vMainWidth)
var vBodyTop =0
var vBodyLeft =0
if (typeof layoutAttribute!="undefined")
	{vBodyTop =layoutAttribute["BodyTop"]
	vBodyLeft =layoutAttribute["BodyLeft"]
	}
//var vBodyTop =layoutAttribute["BodyTop"]
//var vBodyLeft =layoutAttribute["BodyLeft"]
vMenuList.addToMenu({"pos":"relative","itemoff":[0,vMainWidth], "leveloff":[21,0], "style":STYLE, "size":[22,vMainWidth],  "style":TOP_MIDDLE})
//vMenuList.addToMenu({"pos":[200,150],"size":[22,75], "itemoff":[0,75], "imgsize":[16,27], "leveloff":[0,0],"delay":600, "imgsize":[20,24], "arrsize":[13,13])
var vPreviousSubject
var vPreviousCommand
var vBody = escape(vDocument["Subform"])
var vOrderUrl
if(vBody=='ListOnly')
	{vOrderURL="Javascript:viewListTools('Parent')"
	}
else
	{vOrderURL="Javascript:viewCurrentCategory()"
	}
var vSublist
var vTempList
var vSubSub=""
for ( rown = 0; rown < vArray.List.length; rown++)
 {//debugger;
//if(vArray.List[rown].Mode==vDocument["EditMode"] | vArray.List[rown].Mode=="Both")
if(true==true)
{
    if (rown==0)
	{
	vPreviousSubject=vArray.List[rown].Subject
	vPreviousCommand=vArray.List[rown].Command
	vSublist = new theSublist()
	vTempList = new theTempList()
	}
    else
	{
	if (vArray.List[rown].Type=="Main")
		{
		vSubSub = showSubMenus(vTempList)
		if(vSubSub!="")
			{
			vSubSub+="]})"
			eval(vSubSub)
			vTempList = new theTempList()
			}
		vMenuList.addToMenu({code:vPreviousSubject,url:vPreviousCommand,sub:vSublist.Sublist})
		vSublist = new theSublist()
		vPreviousSubject=vArray.List[rown].Subject
		vPreviousCommand=vArray.List[rown].Command
		}
	else if (vArray.List[rown].Type=="Response")
		{
		vSubSub = showSubMenus(vTempList)
		if(vSubSub!="")
			{
			vSubSub+="]})"
			eval(vSubSub)
			vTempList = new theTempList()
			}
		if (vSublist.Sublist.length==0)
			{
			vSublist.addToSub({"itemoff":[21,0],size:[22, vSubWidth], "style":STYLE1})
			}
		vSublist.addToSub({code:vArray.List[rown].Subject,url:vArray.List[rown].Command})
		}
	else if (vArray.List[rown].Type=="SubMain")
		{
		vSubSub = showSubMenus(vTempList)
		if(vSubSub!="")
			{
			vSubSub+="]})"
			eval(vSubSub)
			vTempList = new theTempList()
			}
		if (vSublist.Sublist.length==0)
			{
			vSublist.addToSub({"itemoff":[21,0],size:[22, vSubWidth], "style":STYLE1})
			}
		vTempList.addToTemp(vArray.List[rown].ID,vArray.List[rown].Subject,vArray.List[rown].Description,vArray.List[rown].Command,
		vArray.List[rown].Mode,vArray.List[rown].Type);
		}
	else if (vArray.List[rown].Type=="SubResponse")
		{
		vTempList.addToTemp(vArray.List[rown].ID,vArray.List[rown].Subject,vArray.List[rown].Description,vArray.List[rown].Command,
		vArray.List[rown].Mode,vArray.List[rown].Type);
		}
// New Testing
	else if (vArray.List[rown].Type=="NewRootMenu")
		{
		vSublist.addToSub({code:"Create New Root",url:"Javascript:none()",sub:[{size:[22, 120], itemoff:[21, 0], leveloff:[11, 79], delay:600, imgsize:[16, 			16], arrsize:[16, 16], style:{border:1,shadow:2, color:{border:"#666666", shadow:"#DBD8D1", bgON:"white", bgOVER:"#B6BDD2", 				imagebg:"#DBD8D1", oimagebg:"#B6BDD2"}, css:{ON:'clsCMOn', OVER:'clsCMOver'}}},
		{code:"Content",url:"Javascript:processNew('Root','thePrimaryEdit','Content')"},
          		{code:"Link",url:"Javascript:processNew('Root','theLinkEdit','Link')"}]
		})
		}
	}
}
}
		vSubSub = showSubMenus(vTempList)
		if(vSubSub!="")
			{
			vSubSub+="]})"
			eval(vSubSub)
			vTempList = new theTempList()
			}
vMenuList.addToMenu({code:vPreviousSubject,url:vPreviousCommand,sub:vSublist.Sublist})
//vMenuList.addToMenu({code:vItem1,url:"http://www.lotus.com"})
return vMenuList.MenuList
}
function showSubMenus(vTempList)
{
var vSubSub=""
		for ( tempRow = 0; tempRow  < vTempList.List.length; tempRow ++)
			{
			if (tempRow==0)
				{
				vSubSub="vSublist.addToSub({code:'" + vTempList.List[tempRow].Subject + "',url:\"" + vTempList.List[tempRow].Command + "\",sub:[{size:[22, 120], itemoff:[21, 0],"
 				vSubSub+="leveloff:[17, 100], delay:600, imgsize:[16,16], arrsize:[16, 16], style:{border:1,shadow:2, color:{border:'#666666',"
				vSubSub+=" shadow:'#DBD8D1', bgON:'white', bgOVER:'#B6BDD2',imagebg:'#DBD8D1', "				
				vSubSub+=" oimagebg:'#B6BDD2'},css:{ON:'clsCMOn', OVER:'clsCMOver'}}},"
				}
			else
				{
				vSubSub+="{code:'" + vTempList.List[tempRow].Subject + "',url:\"" + vTempList.List[tempRow].Command + "\"},"
				}
			}
return vSubSub
}
function printDefinition(vSection,vHTML,vGraphic,vTitle,vBorderWidth)
{
if(typeof vColor=='undefined')
	{vColor='red'};
if(typeof vHTML=='undefined')
	{vHTML='"Test text for section:'+vSection};
var vMsg = ''
document.write('<b>' + vSection + ' Section:' + '</b><br>')
document.write('<style>')
//document.write('div#definitionSection{')
//document.write('background-color:' + vTitleColor + ';')
//document.write('}')
document.write('table.listCurrentTable{')
//document.write('border: ' + vBorderWidth + ' px;')
document.write('float: none;')
//document.write('padding-left: 5px;')
//document.write('border-color:red')
document.write('}')
//document.write('td#definitionTitle{')
//document.write('background-color:' + vTitleColor + ';')
//document.write('}')
document.write('</style>')
//document.write('<div id=definitionSection>')
//document.write('This is a test')
//document.write('</div>')  
if(vSection=="thePrimary")
{
document.write('<div id=primarySection>')
document.write('<h1 id=primaryH1>')
document.write(vTitle)
document.write('</h1>')
document.write(vGraphic)
document.write(vHTML)
document.write('</div>')
}
else
{
document.write('<TABLE align=center border=0 id=listCurrentTable class=listCurrentTable cellSpacing=0>')
document.write('<tr>')
document.write('<td class=listCurrentTitle id=listCurrentTitle>')
document.write(vTitle)
document.write('</td>')
document.write('</tr>')
document.write('<tr>')
document.write('<td  id=listCurrentBody>')
document.write(vGraphic)
document.write(vHTML)
document.write('</td>')
document.write('</tr>')
document.write('</table>')
}
}
function changeDefinition(vSection,vStyle,vTitle,vTitleText,vBorder,vTitleColor)
{
var image;
var vMainObject
var vTitleObject
var vBorderObject
var vBorderName
var vTitleColorName
var vTitleColorOverName
if(vSection=="Primary")
	{vMainObject='primarySection'
	vTitleObject='primaryH1'
	vBorderObject='primaryH1'
	if(vStyle=='Default Definition')
		{
		vBorderName='thePrimaryBorder'
		vTitleColorName='thePrimaryTitleBGColor'
		}
	else
		{
		vBorderName='thePrimaryOverBorder'
		vTitleColorName='thePrimaryOverTitleBGColor'
		}
	}
else if (vSection=="List")
	{
	vMainObject='listCurrentTable'
	vTitleObject='listCurrentTitle'
	vBorderObject='listCurrentTable'
	if(vStyle=='Default Definition')
		{
		vBorderName='theListCurrentBorder'
		vTitleColorName='theListCurrentTitleBGColor'
		}
	else
		{
		vBorderName='theListCurOverBorder'
		vTitleColorName='theListCurOverTitleBGColor'
		}
	}
if(vTitleColor=='' | typeof vTitleColor=='undefined')
	{
	vTitleColor=getBodyAttribute(vTitleColorName)
	}
if(vStyle=="Do Not Display")
	{
	image=document.getElementById(vMainObject);
	image.style.display= 'none'
	return true
	}
else
	{
	image=document.getElementById(vMainObject);
	image.style.display= 'block'
	}
if(vStyle=="Default Definition")
	{
	image=document.getElementById(vTitleObject);
	image.style.backgroundColor=vTitleColor
	image.style.display= 'block'
	}
else
	{
	image=document.getElementById(vTitleObject);
	image.style.backgroundColor=vTitleColor
	image.style.display= 'block'
	}
if(vTitle=='No Title')
	{
	image=document.getElementById(vTitleObject);
	image.style.display= 'none'
	}
else if(vTitle=='Primary Description')
	{
	image=document.getElementById(vTitleObject);
	image.childNodes[0].nodeValue=vTitleText;
	image.style.display= 'block'
	}
else
	{
	image=document.getElementById(vTitleObject);
	image.childNodes[0].nodeValue=vTitleText;
	image.style.display= 'block'
	}
if(vBorder=='default')
	{
	image=document.getElementById(vBorderObject);
	var vBorderWidth=getBodyAttribute(vBorderName)
	if(vBorderWidth=='')
		{
		image.style.border= '0px solid'
		}
	else
		{
		image.style.border= vBorderWidth + 'px solid'
		}
	}
else
	{
	image=document.getElementById(vBorderObject);
	image.style.border=vBorder + 'px solid'
	}
}
function printSettings(vPrimary,vSecondary,vList,vSummary,vSection)
{
var vMsg = ''
document.write('<b>Primary Settings:' + '</b><br>')
document.write('  Current : ' + vPrimary + '<br>')
document.write('  List Border: ' + '' + '<br>')
document.write('  Display List Title: ' + '' + '<br>')
document.write('  List Title Background Color: ' + '' + '<br>'+ '<br>')  
document.write('<b>List Current Settings: ' + '</b><br>')
document.write('  Current : ' + vList + '<br>')
document.write('  List Border: ' + '' + '<br>')
document.write('  Display List Title: ' + '' + '<br>')
document.write('  List Title Background Color: ' + '' + '<br>'+ '<br>')  
document.write('<b>List Settings: ' + '</b><br>')
//document.write('  Current : ' + vList + '<br>')
document.write('  Column Count: ' + '' + '<br>')
document.write('  Title Font Color: ' + '' + '<br>')
document.write('  Title Font Link Color: ' + '' + '<br>')
document.write('  Title Font Link Active Color: ' + '' + '<br>')
document.write('  Title Font Link Visited Color: ' + '' + '<br>')
document.write('  Title Font Link Hover Color: ' + '' + '<br>')
document.write('  List Title Background Color: ' + '' + '<br>'+ '<br>') 
document.write('<b>List Settings (Style 2): ' + '</b><br>')
//document.write('  Current : ' + vList + '<br>')
document.write('  Column Count: ' + '' + '<br>')
document.write('  Title Font Color: ' + '' + '<br>')
document.write('  Title Font Link Color: ' + '' + '<br>')
document.write('  Title Font Link Active Color: ' + '' + '<br>')
document.write('  Title Font Link Visited Color: ' + '' + '<br>')
document.write('  Title Font Link Hover Color: ' + '' + '<br>')
document.write('  List Title Background Color: ' + '' + '<br>'+ '<br>')  
document.write('<b>Secondary Settings: '   + '</b><br>')
document.write('  Current : ' + vSecondary + '<br>')
document.write('  List Border: ' + '' + '<br>')
document.write('  Display List Title: ' + '' + '<br>')
document.write('  List Title Background Color: ' + '' + '<br>'+ '<br>')  
document.write('<b>Hi Lite Settings: '   + '</b><br>')
document.write('  Current : ' + vSummary + '<br>')
document.write('  List Border: ' + '' + '<br>')
document.write('  Display List Title: ' + '' + '<br>')
document.write('  List Title Background Color: ' + '' + '<br>') 
}
// testing for Javascript body attribute get
//getBodyAttribute("primaryTitleAlign")
// use above call in HTML page and document.write to create appropriate tag
// This is currently being done through body parameter passing
var bodyAttribute= new Array()
bodyAttribute["primaryTitleAlign"]="center";
// Current List
bodyAttribute["theListCurrentTitleBGColor"]="gray";
bodyAttribute["theListCurrentBorder"]="";
bodyAttribute["theListCurOverTitleBGColor"]="gray";
bodyAttribute["theListCurrentBorder"]="";
bodyAttribute["theListCurOverBorder"]="";
bodyAttribute["thePrimaryTitleBGColor"]="";
bodyAttribute["thePrimaryOverTitleBGColor"]="gray";
bodyAttribute["thePrimaryBorder"]="";
bodyAttribute["thePrimaryOverBorder"]="";

//Moved to theProfileBodyStyle ---bodyAttribute["listDisplayRoot"]="";
bodyAttribute["commentDisplayRoot"]="";
bodyAttribute["big"]="SUV";
function getBodyAttribute(vAttribute)
{
return(bodyAttribute[vAttribute])
}
function roundListCorners()
{
document.write('<div class=floatRight><img src=//ne.gif?openimageresource></div><div class=floatLeft><img src=//nw.gif?openimageresource></div>')
}
function()
{
alert('Body__Action')
}
