/*** 
This is the menu creation code - place it right after you body tag
Feel free to add this to a stand-alone js file and link it to your page.
**/

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

//Menu properties   
oCMenu.pxBetween=10
//oCMenu.fromLeft=0 
oCMenu.fromLeft=(bw.ie ? (cmpage.x2 > 1000 ? cmpage.x2 / 2 - 511 : 0) : (cmpage.x2 > 1000 ? cmpage.x2 / 2 - 519 : 0))
oCMenu.onresize="oCMenu.fromLeft=(bw.ie ? (cmpage.x2 > 1000 ? cmpage.x2 / 2 - 511 : 0) : (cmpage.x2 > 1000 ? cmpage.x2 / 2 - 519 : 0))"
oCMenu.fromTop=200   
oCMenu.rows=0 
oCMenu.menuPlacement="left"
oCMenu.openOnClick=1
oCMenu.closeOnClick=0

oCMenu.offlineRoot="" 
oCMenu.onlineRoot="" 
oCMenu.resizeCheck=1 
oCMenu.wait=50 
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=100

//Background bar properties
oCMenu.useBar=1
oCMenu.barWidth="menu"
oCMenu.barHeight="menu" 
oCMenu.barClass="clBar"
oCMenu.barX="menu"
oCMenu.barY="menu"
oCMenu.barBorderX=0
oCMenu.barBorderY=0
oCMenu.barBorderClass=""

//Level properties - ALL properties have to be spesified in level 0
oCMenu.level[0]=new cm_makeLevel() //Add this for each new level
oCMenu.level[0].width=200
oCMenu.level[0].height=30
oCMenu.level[0].regClass="clLevel0"
oCMenu.level[0].overClass="clLevel0over"
oCMenu.level[0].borderX=0 
oCMenu.level[0].borderY=0
oCMenu.level[0].borderClass=0
oCMenu.level[0].offsetX=0 
oCMenu.level[0].offsetY=0
oCMenu.level[0].rows=0
oCMenu.level[0].align="right" 


//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to spesify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)
oCMenu.level[1].width=300
oCMenu.level[1].height=37
oCMenu.level[1].regClass="clLevel1"
oCMenu.level[1].overClass="clLevel1over"
oCMenu.level[1].style=""
oCMenu.level[1].align="left" 
oCMenu.level[1].offsetX=0
oCMenu.level[1].offsetY=0
oCMenu.level[1].borderClass=0
oCMenu.level[1].borderX=1 
oCMenu.level[1].borderY=1
oCMenu.level[1].rows=1
oCMenu.level[1].align="bottom" 


//Specif CERUS
var puce = new Array()

function create_puce(id, posx, posy, on_off)
{	var divpuce = document.createElement("div"); 
	divpuce.id = "puce" + id;
	if (document.all) 
	{	divpuce.style.setAttribute("cssText", "position: absolute; left: " + posx + "px; top: " + posy + "px; z-index: 1000;");
	}
	else
	{	divpuce.setAttribute("style", "position: absolute; left: " + posx + "px; top: " + posy + "px; z-index: 1000;");
	};
	divpuce.innerHTML = "<img id='imgpuce" + id + "' src='pictures/menu/puce_" + (on_off ? "on" : "off") + ".gif'>";
    document.body.appendChild(divpuce);
	return divpuce;
}

function display_puce(id, posx, posy, on_off)
{	var divpuce = create_puce(id, posx, posy, on_off);
	puce.push(divpuce);
}


function puce_over(id)
{	puce[id].innerHTML = "<img id='imgpuce" + id + "' src='pictures/menu/puce_over.gif'>";
	puce[id].style.zIndex = 1000;
}

function puce_out(id, on_off)
{	puce[id].innerHTML = "<img id='imgpuce" + id + "' src='pictures/menu/puce_" + (on_off ? "on" : "off") + ".gif'>";
	puce[id].style.zIndex = 1000;
} 

function puce_placement()
{	for (i = 0; i < puce.length; i++)
		puce[i].style.left = (bw.ie ? (cmpage.x2 > 1000 ? cmpage.x2 / 2 - 320 : 190) : (cmpage.x2 > 1000 ? cmpage.x2 / 2 - 330 : 190));
}
