var homeSVG=null
var homeContextMenu=null
var Home=null
function initHomeSVG()
{
	homeSVG=document.embeds["homeEmbed"].getSVGDocument();
	homeContextMenu=homeSVG.getElementById("homeContextMenu")
	Home=homeSVG.getElementById("Home")
	homeContext()
}

function homeContext()
{

	//---put in a seperator(resident element)
	var separator=homeSVG.createElement("separator")
	homeContextMenu.appendChild(separator)

	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","goHome()")
	myFunct.setAttribute("id","goHomeContext")
	var functName="MobiusPortal.com Home Page"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)
//---spiral---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","spiral()")
	myFunct.setAttribute("id","spiralContext")

	var functName="   The SVG Spiral"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)

//---path---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","path()")
	myFunct.setAttribute("id","pathContext")
	var functName="   SVG Path Element"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)
//---matrix Transforms---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","matrixTransforms()")
	myFunct.setAttribute("id","matrixTransformsContext")
	var functName="   Matrix Transformation"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)
//---symbol---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","symbol()")
 	myFunct.setAttribute("id","symbolContext")
	var functName="   SVG Symbol Element"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)

//---global map---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","globalMap()")
	myFunct.setAttribute("id","globalMapContext")
	var functName="   Global Map of Avian Flu"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)

//---bubbles map---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","bubbles()")
	myFunct.setAttribute("id","bubblesContext")
	var functName="   Bubbles~n~Boxes"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)

//---icons ---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","icons()")
	myFunct.setAttribute("id","iconsContext")
	var functName="   SVG Icons"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)

//---unicode icons ---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","unicode()")
	myFunct.setAttribute("id","unicodeContext")
	var functName="   Unicode Font Icons"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)

//---trace ---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","trace()")
	myFunct.setAttribute("id","traceContext")
	var functName="   SVGtrace"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)

//---discovery ---
	var myFunct=homeSVG.createElement("item")
	myFunct.setAttribute("onactivate","discovery()")
	myFunct.setAttribute("id","discoveryContext")
	var functName="   SVGdiscovery"
	var textNode=homeSVG.createTextNode(functName)
	myFunct.appendChild(textNode)
	homeContextMenu.appendChild(myFunct)




updateHomeContext()
}



function updateHomeContext()
{
  var newMenuRoot = parseHomeXML( printHomeNode( homeSVG.getElementById( "homeContextMenu" ) ), contextHomeMenu );

 contextHomeMenu.replaceChild( newMenuRoot, contextHomeMenu.firstChild )
}
function disableHomeContextItem(itemId)
{
	var ItemId=homeSVG.getElementById(itemId)
	ItemId.setAttribute("enabled","no")
	updateHomeContext()
}


function checkHomeContextItem(itemId)
{
	var ItemId=homeSVG.getElementById(itemId)
	ItemId.setAttribute("checked","yes")
	updateHomeContext()
}
function focusHome()
{
	Home.setAttribute("stroke","blue")
	showHomePop()
}
function unfocusHome()
{
	Home.setAttribute("stroke","black")
	homePop.hide()
}
//------popup----
//---create an HTML Popup---
var homePop = window.createPopup();
var homePopBox = homePop.document.body;
homePopBox.style.fontSize=14
homePopBox.style.padding=4

function showHomePop()
{
	homePopBox.innerHTML="Right-Click mouse to navigate"
	var popWidth =200
	var popHeight = homePopBox.scrollHeight;

	var popX = 60
	var popY = 0

	homePop.show(popX,popY,popWidth,popHeight);
	//---reread to force actual height---

	var popWidth = homePopBox.scrollWidth;
	var popHeight = homePopBox.scrollHeight;
	homePop.show(popX,popY,popWidth,popHeight);
}




function goHome()
{
	window.location="http://www.mobiusPortal.com"
}

function spiral()
{
	window.location="http://www.mobiusPortal.com/Spiral/svgSpiral.htm"
}
function path()
{
	window.location="http://www.mobiusPortal.com/Path/svgPath.htm"
}
function matrixTransforms()
{
	window.location="http://www.mobiusPortal.com/Matrix/svgMatrix.htm"
}
function symbol()
{
	window.location="http://www.mobiusPortal.com/Symbol/svgSymbol.htm"
}
function globalMap()
{
	window.location='http://www.mobiusportal.com/GlobalMap/AvianFlu/viewPort_AF.asp'
}
function bubbles()
{
	window.location='http://www.mobiusportal.com/BubblesAndBoxes/bubblesAndBoxes.htm'
}
function icons()
{
	window.location='http://www.mobiusPortal.com/SVGicons/icons.htm'
}
function unicode()
{
	window.location='http://www.mobiusPortal.com/UnicodeFonts/icons.htm'
}
function trace()
{
	window.location='http://www.mobiusPortal.com/SVGtrace/svgTrace.htm'
}
function discovery()
{
	window.location='http://www.SVGdiscovery.com/svgDiscovery.htm'
}

