// JavaScript Document

var ie4=document.all;
var ns6=document.getElementById&&!document.all;
var layerFlag = 0;


function writeHeader()
{
	document.write(
	  "<TABLE cellSpacing=0 cellPadding=0 width='100%' border=0>" +
        "<TBODY>"+
          "<TR>"+
            "<TD><a href='http://www.ooilgroup.com'><img src='images/logo_title.gif' border='0'></a></TD>"+
            "<TD align=right vAlign=bottom>"+
			"<TABLE cellSpacing=0 cellPadding=0 border=0>"+
                "<TBODY>"+
                  "<TR>"+
                    "<TD valign='bottom' class=topNav><a href='#' class='hpNewsLink'>Home</a>  | "+
					"<a href='#' class='hpNewsLink'>e-News Alert</a>  | "+
					"<A class='hpNewsLink' href='#'>Contact Us</A> | <a href='#' class='hpNewsLink'>Site Map</a>"+ 
					"</TD>"+
                    "<TD width=96 valign='bottom'>"+
					"<TABLE cellSpacing=0 cellPadding=0 width=96 border=0>"+
                        "<TBODY>"+
                          "<TR>"+
                            "<TD width='91%' valign='bottom'>"+
							"<INPUT class=search id=Header1_textfield onFocus='this.select();' value=Search name=Header1:textfield>"+
							"</TD>"+
                            "<TD width='9%'><IMG height=17 src='images\space.gif' width=1>"+
							"</TD>"+
                            "<TD>"+
							"<INPUT type=image src='images/search.gif' border=0' style='width:9px; height:17px;'>"+
							"</TD>"+
                          "</TR>"+
                        "</TBODY>"+
                      "</TABLE>"+
                  "</TR>"+
                "</TBODY>"+
              "</TABLE>"+
          "</TR>"+
        "</TBODY>"+
      "</TABLE>");
}

function writeFooter()
{
	document.write(
	 "<TABLE class=footer width='100%' border=0 cellpadding=0 cellspacing=0>"+
        "<TBODY>"+
          "<TR>"+
            "<TD valign='bottom'>"+
			"<A href='#' class='lightLink'>Copyright © 2004-2007</A> Orient Overseas (International) Limited. All Rights   Reserved.<BR>Access to and use of this web site and any of its pages   constitutes acceptance of <A href='#' class='lightLink'>Terms of Use</A> (Last   updated: <span class='note'>10 May 2004</span>) and<BR><A href='#' class='lightLink'>Privacy and Security   Statement</A> (Last updated: <span class='note'>10 May 2004</span>)."+
			"<BR><BR><a href='#' class='lightLink'>Copyright Infringement Policy</a>&nbsp;|&nbsp;<a href='#' class='lightLink'>Hyperlink Policy</a>"+
			"</TD>"+
			"</TR>"+
        "</TBODY>"+
      "</TABLE>");
}

/*------------------------------------------------------------------------------------------------------------*/

var menuBarItems = new Array();
/*--- Array(menubar value, menubar URL, submenu number, (submenu value, submenu URL))---*/
menuBarItems[0] = new Array("Corporate","","7",new Array("About OOIL","#","Corporate Values","#","Corporate Information","#","Significant Events","#","Shareholder Information","#","Community Investment","#","Corporate Video","#"));
menuBarItems[1] = new Array("Business","","4",new Array("Overview","#","Container Transport & Logistics Service","#","SPorts & Terminals","#","Property","#"));
menuBarItems[2] = new Array("Financials","","6",new Array("Latest Financial Data","#","Historical Financial Highlights","#","Key OOCL Operational Statistics","#","Result Announcements","#","Interim & Annual Reports","#","Investor Presentations","#"));
menuBarItems[3] = new Array("Newsroom","","3",new Array("Press Release","#","Statutory Announcements","#","Information to Shareholders","#"));
menuBarItems[4] = new Array("Investor Relations","","5",new Array("Stock Watch","#","Analyst List","#","Investors Calendar","#","Contact IR Team","#","Tool Kit Download","#"));
menuBarItems[5] = new Array("e-News Alert","#","0",new Array());

var subMenuWidth = 210 + "px";
var subIframWidth = subMenuWidth - 5 + "px";

function writeMenu(){
	document.write('<TABLE cellSpacing=0 cellPadding=0 border=0>'+
            '<TBODY>'+
              '<TR valign="middle">');
	writeMenuItems();
	document.write('</TR></TBODY></TABLE>');
}

function writeMenuItems(){ 
	for (i=0; i<menuBarItems.length; i++) {
		var menuValue = menuBarItems[i][0];
		var menuURL = menuBarItems[i][1];
		var subMenuNum = menuBarItems[i][2];
		var actionLink = "onClick=javascript:window.location='"+ menuURL +"';";
		if (menuURL == "") actionLink = "";
		document.write('<TD onMouseOver="ShowMenu(\''+
						i+
						'\');" onMouseOut="HideMenu(\''+
						i +
						'\');">'+
					   '<TABLE cellSpacing=0 cellPadding=0 border=0><TBODY><TR><TD class="menuBarItem" onMouseOver="this.className=\'menuBarItemMouseOver\'" onMouseOut="this.className=\'menuBarItem\'" '+
					   actionLink+
					   ' noWrap id="menuItem'+
					   i+
					   '">'+ 
					   menuValue+
					   '</TD></TR><TR><TD><DIV class=return><DIV id="MenuLayer'+
					   i+
					   '" style="Z-INDEX:-1; VERTICAL-ALIGN: middle; WIDTH: '+
					   subMenuWidth +
					   '; POSITION:absolute;"><IFRAME id=MenuFrm'+
					   i+
						   ' style="Z-INDEX: -1; WIDTH: '+
					   subIframWidth+
					   '; POSITION: absolute; opacity: 0; filter: alpha(opacity=0);" frameborder="0"></IFRAME>'+'<table border="0" cellspacing="0" cellpadding="0" width="'+
					   subMenuWidth +
					   '" id=MenuTbl'+
					   i+
					   '><tbody>');
		writeSubMenuItems(i);
		document.write('</tbody></table></DIV></DIV></TD></TR></TBODY></TABLE></TD>');
		}
}

function writeSubMenuItems(index){
	var subMenuNum = menuBarItems[index][2];
	if (subMenuNum > 0) 
	{
		document.write('<TR><TD class="subMenuTopLeft"><img src="images/space.gif" height="15" /></TD>'+
                		'<TD class="subMenuTopRight"><img src="images/space.gif" height="15" /></TD></TR>');
		for (j=0;j<(subMenuNum*2);j++){
		var subMenuValue = menuBarItems[index][3][j];
		var subMenuURL = menuBarItems[index][3][j+1];
		document.write('<tr><td colspan="2" class="subMenuMouseOut" onMouseOver="this.className=\'subMenuMouseOver\'" onMouseOut="this.className=\'subMenuMouseOut\'" onClick="javascript:window.location=\''+ subMenuURL+'\';">'+subMenuValue +'</td></tr>');
		j++;
		}
		document.write('<tr><td class="subMenuBottomLeft"><img src="images/space.gif" height="15" /></td>'+
                		'<td class="subMenuBottomRight"><img src="images/space.gif" height="15" /></td></tr>');

	}
}

var ie4=document.all;
var ns6=document.getElementById&&!document.all;
function OOILShowMenu(MenuIDIndex)
{
    var MenuID = "MenuLayer" + MenuIDIndex;
    var MenuFrmID = "MenuFrm" + MenuIDIndex;
    var MenuTbleID = "MenuTbl" + MenuIDIndex;
	var MenuItemID = "menuItem" + MenuIDIndex;
    
    if(document.getElementById(MenuID) != null)
    {
        if (ie4||ns6)
        {
            var dropmenuobj=document.getElementById? document.getElementById(MenuID) : MenuID
            if(dropmenuobj.style.zIndex < 0)
                dropmenuobj.style.zIndex = 20;
        }
       document.getElementById(MenuFrmID).height = document.getElementById(MenuTbleID).offsetHeight;
       document.getElementById(MenuItemID).className = "menuBarItemMouseOver" ;
   }
}

function OOILHideMenu(MenuIDIndex)
{
    var MenuID = "MenuLayer" + MenuIDIndex;
	var MenuItemID = "menuItem" + MenuIDIndex;
    if(document.getElementById(MenuID) != null)
    {
        if (ie4||ns6)
        {
            var dropmenuobj=document.getElementById? document.getElementById(MenuID) : MenuID
            if(dropmenuobj.style.zIndex > 0)
	            dropmenuobj.style.zIndex = -1;
        }
        document.getElementById(MenuItemID).className = "menuBarItem" ;
    }
}

/*------------------------------------------------------------------------------------------------------------*/

var FavoritesItems = new Array();
/*--- Array(Favorites value, Favorites URL, subFavorites number, (subFavorites value, subFavorites URL))---*/
FavoritesItems[0] = new Array("Investor's Favorites ","","15",new Array("Significant Events","#","Shareholder Information","#","Latest Financial Data","#","Historical Financial Highlights","#","Key OOCL Operational Statistics","#","Result Announcements","#","Interim &amp; Annual Reports","#","Press Releases","#","Statutory Announcements","#","Information to Shareholders","#","Stock Watch","#","Analyst List","#","Investor Calendar","#","Tool Kit Download","#","Contact IR Team","#"));

function writeFavorites(){
	document.write('<TABLE align="right" cellSpacing=0 cellPadding=0 border=0>'+
            '<TBODY>'+
              '<TR valign="middle">');
	writeFavoritesItems();
	document.write('</TR></TBODY></TABLE>');
}

var subFavoritesWidth = "213px";

function writeFavoritesItems(){ 
	for (i=0; i<FavoritesItems.length; i++) {
		var FavoritesValue = FavoritesItems[i][0];
		var FavoritesURL = FavoritesItems[i][1];
		var subFavoritesNum = FavoritesItems[i][2];
		var actionLink = "onClick=javascript:window.location='"+ FavoritesURL +"';";
		if (FavoritesURL == "") actionLink = "";
		document.write('<TD onMouseOver="ShowFavorites(\''+
						i+
						'\');" onMouseOut="HideFavorites(\''+
						i +
						'\');">'+
					   '<TABLE id="FavoritesTb" cellSpacing=0 cellPadding=0 border=0><TBODY><TR><TD class="menuBarFavorites" onMouseOver="this.className=\'menuBarItemMouseOver\'" onMouseOut="this.className=\'menuBarFavorites\'" '+
					   actionLink+
					   ' noWrap id="FavoritesItem0">'+ 
					   FavoritesValue+
					   '<img src="images/icon_favorites.gif" align="absmiddle">'+
					   '</TD></TR><TR><TD><DIV class=return><DIV id="FavoritesLayer0" style="Z-INDEX:-1; VERTICAL-ALIGN: middle; WIDTH: '+
					   subFavoritesWidth +
					   '; POSITION:absolute; left:200px;"><IFRAME id=FavoritesFrm'+
					   i+
					   ' style="Z-INDEX: -1; WIDTH: '+
					   subFavoritesWidth +
					   ';  POSITION: absolute;" frameborder="0" ></IFRAME>'+
					   '<table border="0" cellspacing="0" cellpadding="0" width="'+
					   subFavoritesWidth +
					   '" id=FavoritesTbl'+
					   i+
					   '><tbody>');
		writeSubFavoritesItems(i);
		document.write('</tbody></table></DIV></DIV></TD></TR></TBODY></TABLE></TD>');
		}
}

function writeSubFavoritesItems(index){
	var subFavoritesNum = FavoritesItems[index][2];
	if (subFavoritesNum > 0) 
	{
		document.write('<TR><TD class="subFavoritesTopLeft"><img src="images/space.gif" height="15" /></TD>'+
                		'<TD class="subFavoritesTopRight"><img src="images/space.gif" height="15" /></TD></TR>');
		for (j=0;j<(subFavoritesNum*2);j++){
		var subFavoritesValue = FavoritesItems[index][3][j];
		var subFavoritesURL = FavoritesItems[index][3][j+1];
		document.write('<tr><td colspan="2" class="subMenuMouseOut" onMouseOver="this.className=\'subMenuMouseOver\'" onMouseOut="this.className=\'subMenuMouseOut\'" onClick="javascript:window.location=\''+ subFavoritesURL+'\';">'+subFavoritesValue +'</td></tr>');
		j++;
		}
		document.write('<tr><td class="subMenuBottomLeft"><img src="images/space.gif" height="15" /></td>'+
                		'<td class="subMenuBottomRight"><img src="images/space.gif" height="15" /></td></tr>');

	}

}

function resetLayerPos(flag)
{
   var itemobj = document.getElementById("FavoritesItem0"); 
   var layerobj = document.getElementById("FavoritesLayer0"); 
   var itemLeft = itemobj.offsetLeft; 
   var itemWidth = itemobj.offsetWidth; 
   var layerWidth = layerobj.offsetWidth; 
   var layerLeft = getObjectPosition(itemobj) + itemWidth - layerWidth;
   layerobj.style.left = layerLeft + "px";

}
function getObjectPosition(inputObj){
	
	var left = inputObj.offsetLeft;
	var top = inputObj.offsetTop;
	var myParent = inputObj.offsetParent;
	while (myParent != null) {
		left += myParent.offsetLeft;
		top += myParent.offsetTop;
		myParent = myParent.offsetParent;
	}
	return left;
}


var ie4=document.all;
var ns6=document.getElementById&&!document.all;
function ShowFavorites(FavoritesIDIndex)
{
    var FavoritesID = "FavoritesLayer" + FavoritesIDIndex;
    var FavoritesFrmID = "FavoritesFrm" + FavoritesIDIndex;
    var FavoritesTbleID = "FavoritesTbl" + FavoritesIDIndex;
	var FavoritesItemID = "FavoritesItem" + FavoritesIDIndex;
    
    if (ie4||ns6)
    {
        var dropmenuobj=document.getElementById? document.getElementById(FavoritesID) : FavoritesID
        if(dropmenuobj.style.zIndex < 0)
            dropmenuobj.style.zIndex = 20;
    }
   document.getElementById(FavoritesFrmID).height = document.getElementById(FavoritesTbleID).offsetHeight;
   document.getElementById(FavoritesItemID).className = "menuBarItemMouseOver" ;
	resetLayerPos();
   document.getElementById(FavoritesID).style.visibility ="visible";

}


function HideFavorites(FavoritesIDIndex)
{
    var FavoritesID = "FavoritesLayer" + FavoritesIDIndex;
	var FavoritesItemID = "FavoritesItem" + FavoritesIDIndex;
	if (ie4||ns6)
    {
	    var dropmenuobj=document.getElementById? document.getElementById(FavoritesID) : FavoritesID
	    if(dropmenuobj.style.zIndex > 0)
		    dropmenuobj.style.zIndex = -1;
    }
	 document.getElementById(FavoritesItemID).className = "menuBarFavorites";
	 //document.getElementById(FavoritesID).style.visibility ="hidden";
}

