
function FindPosition(image_name){
    if(!document.images[image_name]){
        return null;
    }
    this.image_name = image_name;
    this.xPos = 500;
    this.yPos = 500;
    this.ref_image = document.images[image_name];
    this.getRealLeft = getRealLeft;
    this.getRealTop = getRealTop;
    this.getRealLeft();
    this.getRealTop();
}

function getRealLeft(move) {
   if(!move){
        move = 0;
    }
   if(document.layers){
     this.xPos = this.ref_image.x + move;    
     return this.xPos;
   }
	this.xPos = this.ref_image.offsetLeft;
	tempEl = this.ref_image.offsetParent;
  	while (tempEl != null) {
  		this.xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
    this.xPos = this.xPos + move;
	return this.xPos;
}

function getRealTop(move) {
    if(!move){
        move = 0;
    }
    if(document.layers){
     this.yPos = this.ref_image.y + move; 
     return this.yPos
   }
	this.yPos = this.ref_image.offsetTop;
	tempEl = this.ref_image.offsetParent;
	while (tempEl != null) {
  		this.yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
    this.yPos = this.yPos + move;
	return this.yPos;
}

var dropmenu1 = new FindPosition("onlineservices");
var dropmenu2 = new FindPosition("personal");
var dropmenu3 = new FindPosition("business");
var dropmenu4 = new FindPosition("loans");
var dropmenu5 = new FindPosition("info");
/*var dropmenu6 = new FindPosition("edu");
var dropmenu7 = new FindPosition("services");*/

function showMenu(menu){
	
	switch(menu){
		case "on":
		oM.m["on"].b.moveIt(dropmenu1.xPos+140,dropmenu1.yPos);
		break;
		case "per":
		oM.m["per"].b.moveIt(dropmenu2.xPos+140,dropmenu2.yPos);
		break;
		case "bus":
		oM.m["bus"].b.moveIt(dropmenu3.xPos+140,dropmenu3.yPos);
		break;
		case "ln":
		oM.m["ln"].b.moveIt(dropmenu4.xPos+140,dropmenu4.yPos);
		break;
		case "info":
		oM.m["info"].b.moveIt(dropmenu5.xPos+140,dropmenu5.yPos);
		break;
		/*case "me":
		oM.m["me"].b.moveIt(dropmenu6.xPos,dropmenu6.yPos + 22);
		break;
		case "serv":
		oM.m["serv"].b.moveIt(dropmenu7.xPos,dropmenu7.yPos + 22);
		break;*/
	} 
	oM.showsub(menu);
}
//end of file

//end file
