/*** 
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.
**/

//Extra code to find position:
function findPos(){
  if(bw.ns4){   //Netscape 4
    x = document.layers.layerMenu.pageX
    y = document.layers.layerMenu.pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all["divMenu"]:document.getElementById("divMenu");
    if(el.offsetParent){
      temp = el
      while(temp.offsetParent){ //Looping parent elements to get the offset of them as well
        temp=temp.offsetParent; 
        x+=temp.offsetLeft
        y+=temp.offsetTop;
      }
    }
    x+=el.offsetLeft
    y+=el.offsetTop
  }
  //Returning the x and y as an array
  return [x,y]
}

pos = findPos()



//menu properties = globale einstellungen
var oM=new makeCM("oM")
oM.pxBetween=6				//wird nur interpretiert, wenn menuPlacement nicht gesetzt ist

//Using the cm_page object to place the menu ----
oM.fromLeft=pos[0]+100		// alternative eingabe "30%"
oM.fromTop=pos[1]+16		// wert wird nur interpretiert, wenn menuPlacement nicht gesetzt ist
//We also need to "re place" the menu on resize. So:
oM.onresize="pos = findPos(); oM.fromLeft=pos[0]; oM.fromTop=pos[1]"

oM.menuPlacement='center'	//center     http://coolmenus.dhtmlcentral.com/projects/coolmenus/properties.asp?m=47&id=28
oM.wait=1000
oM.fillImg="cm_fill.gif"
oM.zIndex=100 
oM.resizeCheck=1

oM.onlineRoot=""
oM.offlineRoot=""

oM.rows=1				//Ausrichtung Top-Menü  1=horizontal 0=vertikal

//Background bar properties
oM.useBar=0
oM.barWidth="40%" 			// "100%"
oM.barHeight=20				// "menu"
oM.barX="menu"
oM.barY="menu"				// "menu" wenn der abstand von links dem des menüs entsprechen soll
oM.barClass="clBar" 
oM.barBorderX=2
oM.barBorderY=2
oM.barBorderClass="clB4"

//

//Level properties
//Syntax for fast creation (advanced users only)
//oM.level[1]=new cm_makeLevel (width,height,regClass,overClass,borderX,borderY,borderClass,rows,align,offsetX,offsetY,arrow,arrowWidth,arrowHeight)

// BESCHREIBUNGEN
/* align:
The value of this property controls the alignment of the subitems of this level. All items (except the top items) will be positioned relative to the parent element. The align property in co-operation with offsetX and offsetY spesifies the position of the subitems. 

Values:
"bottom": The sub menus of this level will come out on the top of this item
"top": The sub menus of this level will come out on the bottom of this item
"left": The sub menus of this level will come out on the right of this item
"right": The sub menus of this level will come out on the left of this item 

New values in version 4:
"righttop": The menus will come out to the right but go upwards.
"lefttop": The menus will out to the left but go upwards.
"bottomleft": The menus comes out of the bottom but goes left.
"topleft": The menu comes out above the current element and goes left.

In generally "left" and "right" works best for menus in columns and "top" and "bottom" works best for menus in rows. The new "bottomleft" and "topleft" are usefull for menus that use columns on sublevels.
*/



// TOP LEVEL - 1. Eben

//unten + align right primärnavi geht seknavi horizontal auf
// randeinstellungen auf alles von primär
oM.level[0]=new cm_makeLevel()
oM.level[0].width=160
oM.level[0].height=20
oM.level[0].regClass="clT" 
oM.level[0].overClass="clTover"  
oM.level[0].borderX=0			//
oM.level[0].borderY=2
oM.level[0].borderClass="clB2" 
oM.level[0].rows=1				// 0=vertikal 1=horizontal
oM.level[0].align="bottom" //left
oM.level[0].offsetX=0			//horizontal
oM.level[0].offsetY=0 				//vertikal
oM.level[0].arrow=0
oM.level[0].arrowWidth=0
oM.level[0].arrowHeight=0

// Subnavigation 2. Ebene
oM.level[1]=new cm_makeLevel()
oM.level[1].width=0
oM.level[1].height=20   // kann wieder auf 0 gesetzt werden, wenn ausschliesslich gifs verwendet werden
oM.level[1].regClass="clS" 
oM.level[1].overClass="clSover" 
oM.level[1].borderX=0			//orange
oM.level[1].borderY=0
oM.level[1].borderClass="clB1"
oM.level[1].align="topleft"			// war top
oM.level[1].rows=1
oM.level[1].offsetX=0			//horizontal   vom vorgänger menüpunkt
oM.level[1].offsetY=30			//vertikal    von oberkante topnavi gemessen
oM.level[1].arrow=""
oM.level[1].arrowWidth=0
oM.level[1].arrowHeight=0

// 4. navi ebene (blau)
oM.level[2]=new cm_makeLevel()
oM.level[2].width=60
oM.level[2].height=14
oM.level[2].borderClass="clB3"
oM.level[2].regClass="clS2"
oM.level[2].overClass="clS2over"  
oM.level[2].borderX=0
oM.level[2].borderY=0
oM.level[2].rows=0
oM.level[2].offsetX=-1		//horizontal
oM.level[2].offsetY=00		//vertikal
oM.level[2].align="bottom"  //left


//oM.level[1]=new cm_makeLevel(width,height,regClass,overClass,borderX,borderY,borderClass,rows,align,offsetX,offsetY,arrow,arrowWidth,arrowHeight)
/*
oM.level[3]=new cm_makeLevel(0,0,"","",3,3,"clB",0,"left")
oM.level[3].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5)" 

oM.level[4]=new cm_makeLevel(0,0,"","",3,3,"clB2",0,"left")
oM.level[4].filter=""
oM.level[4].slidepx=10


oM.level[5]=new cm_makeLevel(0,0,"","",3,3,"clB2",0,"left")
oM.level[5].slidepx=0
oM.level[5].clippx=10

oM.level[6]=new cm_makeLevel(0,0,"","",3,3,"clB2",1,"right")
oM.level[6].clippx=10
oM.level[6].regClass="clS" 
oM.level[6].overClass="clSover" 
oM.level[6].border=null
oM.level[6].borderClass="clB1"

oM.level[7]=new cm_makeLevel(0,0,"","",3,3,"clB2",1,"right")
oM.level[7].clippx=10
*/


