/*** 
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 NUMBER 1 **********************************/

//Menu object creation
oCMenu1=new makeCM("oCMenu1") //Making the menu object. Argument: menuname

//Menu properties   
oCMenu1.pxBetween=-1
oCMenu1.fromLeft=5
oCMenu1.fromTop=160
oCMenu1.rows=0
oCMenu1.menuPlacement=0

oCMenu1.offlineRoot="" 
oCMenu1.onlineRoot="" 
oCMenu1.resizeCheck=1
oCMenu1.wait=500 
oCMenu1.zIndex=0

//Level properties - ALL properties have to be spesified in level 0
oCMenu1.level[0]=new cm_makeLevel() //Add this for each new level

oCMenu1.level[0].width=150
oCMenu1.level[0].height=30 
oCMenu1.level[0].regClass="cl2Level0"
oCMenu1.level[0].overClass="cl2Level0over"
oCMenu1.level[0].borderX=0
oCMenu1.level[0].borderY=1
oCMenu1.level[0].borderClass="cl2Level0border"
oCMenu1.level[0].offsetX=-1
oCMenu1.level[0].offsetY=0
oCMenu1.level[0].arrow="images/arrow.gif"
oCMenu1.level[0].arrowWidth=8
oCMenu1.level[0].arrowHeight=10
oCMenu1.level[0].align="bottom"


//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
oCMenu1.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number)

//oCMenu1.level[1].clippx=15

oCMenu1.level[1].width=120
oCMenu1.level[1].height=28
oCMenu1.level[1].regClass="cl2Level1"
oCMenu1.level[1].overClass="cl2Level1over"
oCMenu1.level[1].borderX=1
oCMenu1.level[1].borderY=1
oCMenu1.level[1].align=""
oCMenu1.level[1].offsetX=-1
oCMenu1.level[1].offsetY=1
oCMenu1.level[1].borderClass="cl2Level1border"
oCMenu1.level[1].arrow=""
oCMenu1.level[0].align="right"


/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/

oCMenu1.makeMenu('top1','','General Information','gen_info.html')
oCMenu1.makeMenu('top2','','Virtual Branch <br>Internet Site','https://www.netit.financial-net.com/portchestertfcu/','_blank','','40')
oCMenu1.makeMenu('top3','','Services Provided','services.html')
	oCMenu1.makeMenu('sub01','top3','Share (Savings)','services.html')
	oCMenu1.makeMenu('sub02','top3','Loans','services.html#loans')
	oCMenu1.makeMenu('sub03','top3','Other Services','services.html#other')

oCMenu1.makeMenu('top4','','Reasons For <br>Using PCTFCU','reasons.html','','','40')
oCMenu1.makeMenu('top5','','Financial Conditions')
	oCMenu1.makeMenu('sub04','top5','Assets','fin_conditions.html','','130')
	oCMenu1.makeMenu('sub05','top5','Liability & Equity','fin_conditions.html#liability','','130')
	oCMenu1.makeMenu('sub06','top5','Net Income','fin_conditions.html#net','','130')

oCMenu1.makeMenu('top6','','Our Board','our_board.html')
oCMenu1.makeMenu('top7','','Applications')
	oCMenu1.makeMenu('sub07','top7','Loan Application','loan_app.html','','140')
	oCMenu1.makeMenu('sub08','top7','Visa Credit Card <br>Application','visa_card_app.html','','140','40')
	oCMenu1.makeMenu('sub9','top7','Visa Check/ATM <br>Card Application','visa_atm_app.html','','140','40')

oCMenu1.makeMenu('top8','','View Your Visa <br>Account On-Line','https://www.ezcardinfo.com/','_blank','','40')
oCMenu1.makeMenu('top9','','Re-Order Checks','https://reorder.libertysite.com/','_blank')
oCMenu1.makeMenu('top10','','ATM Locators','atm_locator.html')
	oCMenu1.makeMenu('sub10','top10','Surcharge-Free <br> ATM Locator','http://www.co-opnetwork.org/public/locators/ATMlocator/index.cfm','_blank','140','40')
	oCMenu1.makeMenu('sub11','top10','Neighborhood <br>Surcharge-Free <br>ATM Locator','atm_locator.html','','140','50')

oCMenu1.makeMenu('top11','','Contact Us','contact.html')
	
//Leave this line - it constructs the menu
oCMenu1.construct()		

//Extra code to find position:
function findPos(num){
  //alert(num)
  if(bw.ns4){   //Netscape 4
    x = document.layers["layerMenu"+num].pageX
    y = document.layers["layerMenu"+num].pageY
  }else{ //other browsers
    x=0; y=0; var el,temp
    el = bw.ie4?document.all["divMenu"+num]:document.getElementById("divMenu"+num);
    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]
}
function placeElements(){
  //Changing the position of ALL top items:
  pos = findPos(0)
  oCMenu1.m["top0"].b.moveIt(pos[0],pos[1])
  pos = findPos(1)
  oCMenu1.m["top1"].b.moveIt(pos[0],pos[1])
  pos = findPos(2)
  oCMenu1.m["top2"].b.moveIt(pos[0],pos[1])

  //Setting the fromtop value
  oCMenu1.fromTop = pos[1]
}
placeElements()
//Setting it to re place the elements after resize - the resize is not perfect though..
oCMenu1.onafterresize="placeElements()"


