
var url = self.location.href;
if (url.indexOf("#")!=-1)
	self.location.href=url.substring(url.indexOf('#'),url.length);

//This function calculates the height of the div that contains the iframe.
//280 is the number of pixels of the header + footer
var Y =	document.documentElement.clientHeight-document.body.clientHeight; //template height		
var promoHeight = document.documentElement.clientHeight-(Y)-288;
//alert("promoHeight is "+promoHeight);

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2004 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function setIframe(h) {
  var theIframe = document.getElementById? document.getElementById('promo'): document.all? document.all['promo']: null;
  if (theIframe) {
    viewport.getWinHeight();
    //  both theIframe.height and theIframe.style.height seem to work 
    theIframe.style.height = promoHeight;
    theIframe.style.marginTop = 0;
  }
}

// for sizing and positioning the iframe in the window
// .5 for height="50%"
setIframe(1);
window.onresize = function() { setIframe(1) }

//End of iframe code


var newH = 36;
if(document.layers){
	document.write('<style>.clS,.clSover{border: 0px;}</style>');
	newH += 1;
}

oM=new makeCM("oM"); 
oM.resizeCheck=0; 
oM.rows=1;  
oM.onlineRoot=""
oM.offlineRoot=""
oM.pxBetween=0; 
oM.fillImg=imgdir+"clearpix.gif"; 
oM.fromTop=0; 
oM.fromLeft=0; 
oM.wait=300; 
oM.zIndex=400;
oM.useBar=0; 
oM.barWidth="0"; 
oM.barHeight="menu"; 
oM.barX=0;
oM.barY="menu"; 
oM.barClass="clB";
oM.barBorderX=0; 
oM.barBorderY=0;
db="<img src='"+imgdir+"clearpix.gif' width='3' height='1' border='0' alt='' />";

//oM.level[0]=new cm_makeLevel(width,height,regClass,overClass,borderX,borderY,borderClass,rows,align,offsetX,offsetY,arrow,arrowWidth,arrowHeight)<img src="http://www.ffsbky.com/images/menu_arrow.gif" width="14" height="10" alt="" border="0">
oM.level[0]=new cm_makeLevel(0,0,"clS","clS",0,0,"clB",0,"bottom",0,0,0,0,0);
oM.level[0].filter="PROGID:DXImageTransform.Microsoft.Alpha(opacity=95, finishopacity=95, style=1)"; 
oM.level[0].roundBorder=1;
oM.level[1]=new cm_makeLevel(177,20,"clS","clSover",0,0,"clB",0,"right",0,0,imgdir+"tri.gif",5,10);


/******************************************
Menu item creation:
myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) 
*************************************/

oM.makeMenu('menu1');


	
oM.makeMenu('menu2');

					
			
oM.makeMenu('menu3');

oM.makeMenu('menu4');

		

oM.menuPlacement=new Array(0);
oM.construct();

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("personal");
var dropmenu2 = new  FindPosition("business");
var dropmenu3 = new  FindPosition("aboutus");
var dropmenu4 = new  FindPosition("customer");




function showMenu(menu){
	switch(menu){
		case "menu1":
		oM.m["menu1"].b.moveIt(dropmenu1.xPos,dropmenu1.yPos+24);
		break;
		case "menu2":
		oM.m["menu2"].b.moveIt(dropmenu2.xPos,dropmenu2.yPos+24);
		break;		
		case "menu3":
		oM.m["menu3"].b.moveIt(dropmenu3.xPos,dropmenu3.yPos+24);
		break;		
		case "menu4":
		oM.m["menu4"].b.moveIt(dropmenu4.xPos,dropmenu4.yPos+24);
		break;
		case "menu5":
		oM.m["menu5"].b.moveIt(dropmenu5.xPos,dropmenu5.yPos+24);
		break;
	}
	oM.showsub(menu);
}
//end of file
