/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="http://www.sats.com.sg/newsats/about_us/mission_statement.html">Our Mission and Vision</a>'
menu1[1]='<a href="http://www.sats.com.sg/newsats/about_us/brand_promise.html">Our Brand Promise</a>'
menu1[2]='<a href="http://www.sats.com.sg/newsats/about_us/grp_structure.html">Group Structure</a>'
menu1[3]='<a href="http://www.sats.com.sg/newsats/about_us/mgt_team/directors_profile.html">Board & Management</a>'
menu1[4]='<a href="http://www.sats.com.sg/newsats/about_us/overseas_assoc.html">Geographical Reach</a>'
menu1[5]='<a href="http://www.sats.com.sg/newsats/about_us/our_clients/our_clients.html">Our Customers</a>'
menu1[6]='<a href="http://www.sats.com.sg/newsats/about_us/milestones/2009.html">Milestones</a>'
menu1[7]='<a href="http://www.sats.com.sg/newsats/about_us/sats_story.html">History of SATS</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="http://www.sats.com.sg/newsats/services/airport_range_svcs.html">Airport Services</a>'
menu2[1]='<a href="http://www.sats.com.sg/newsats/services/food_services.html">Food Solutions</a>'

//Contents for menu 3, and so on
var menu3=new Array()
menu3[0]='<a href="http://www.sats.com.sg/newsats/investor_relations/financial_results.html">Financial Results & Presentation</a>'
menu3[1]='<a href="http://www.sats.com.sg/newsats/investor_relations/capitalmarketsday.html">Roadshow / Capital Markets Day</a>'
menu3[2]='<a href="http://www.sats.com.sg/newsats/investor_relations/corp_data.html">Corporate Strategy</a>'
menu3[3]='<a href="http://www.sats.com.sg/newsats/investor_relations/operating_stats/operating_stats.html">Operating Statistics</a>'
menu3[4]='<a href="http://www.sats.com.sg/newsats/investor_relations/corp_governance.html">Corporate Governance</a>'
menu3[5]='<a href="http://www.sats.com.sg/newsats/investor_relations/shareholding_info.html">Share Price</a>'
menu3[6]='<a href="http://www.sats.com.sg/newsats/investor_relations/corp_info.html">Shareholder Info</a>'
menu3[7]='<a href="http://www.sats.com.sg/newsats/investor_relations/annual_reports.html">Annual Reports</a>'

var menu4=new Array()
menu4[0]='<a href="http://www.sats.com.sg/newsats/news_events/2010.html">2010</a>'
menu4[1]='<a href="http://www.sats.com.sg/newsats/news_events/2009.html">2009</a>'
menu4[2]='<a href="http://www.sats.com.sg/newsats/news_events/2008.html">2008</a>'
menu4[3]='<a href="http://www.sats.com.sg/newsats/news_events/2007.html">2007</a>'
menu4[4]='<a href="http://www.sats.com.sg/newsats/news_events/2006.html">2006</a>'
menu4[5]='<a href="http://www.sats.com.sg/newsats/news_events/2005.html">2005</a>'
menu4[6]='<a href="http://www.sats.com.sg/newsats/news_events/2004.html">2004</a>'
menu4[7]='<a href="http://www.sats.com.sg/newsats/news_events/archives/archives.html">Archive</a>'

var menu5=new Array()
menu5[0]='<a href="http://www.sats.com.sg/newsats/career_scholarship/careers_scholarships.html">Careers</a>'
menu5[1]='<a href="http://www.sats.com.sg/newsats/career_scholarship/newsletters.html">Affinity Newsletters</a>'

var menu7=new Array()
menu7[0]='<a href="http://www.sats.com.sg/newsats/others/contact_us.html">Contact Us</a>'
menu7[1]='<a href="http://www.sats.com.sg/newsats/feedback_enquiries/hotline.html">Hotline To Report Wrongdoing</a>'
		
var menuwidth='220px' //default menu width
var menubgcolor='white'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){

if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)

dropmenuobj.x=getposOffset(obj, "left")+5
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)

}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

//add functions to elements' event, while not interfering with other scripts that may use that event
function addEvent(obj, eventType, func){

	var originalFunction = obj[eventType];
	if(typeof originalFunction != 'function')
	{	obj[eventType] = func;
	}
	else
	{	var strOriginalFunction = originalFunction.toString();
		var strFunc = func.toString();
		if (strOriginalFunction.indexOf(strFunc) == -1)
		{	obj[eventType] = function()
			{	originalFunction();
				func();
			}
		}
	}
  
}



//-------------------------------------add, remove or change classes to elements -------------------
//--------------------------while not interfering with other scripts that may use that element's 
//------------------------------------class names--------------------------------------------
function addClass(obj, style)
{	var originalClass = obj.className;
	if (originalClass.indexOf(style) == -1)
	{	obj.className = originalClass + " " + style;
	}
}

function removeClass(obj, style)
{	var originalClass = obj.className;
	var pos = originalClass.indexOf(style);
	
	if (pos != -1)
	{	var firstPart = originalClass.substring(0, pos);
		var secondPart = originalClass.substring(pos+style.length, originalClass.length);
		obj.className = firstPart + secondPart;
	}
}

function changeClass(obj, oldStyle, newStyle)
{	removeClass(obj, oldStyle);
	addClass(obj, newStyle);
}


/**************************************rollover for right nav****************************************/
addEvent(window, "onload", init_right_nav);

//construct the right nav link objects
function init_right_nav()
{	right_nav_links = new Array();
	
	//get the anchors
	var links = document.getElementById("right_nav");;
	if (links == null)
	{	return;	}
	
	links = links.getElementsByTagName("a");
	var i = 0;
	//construct the right nav link objects
	for (i=0; i<links.length; i++)
	{	var img_src = links[i].getElementsByTagName("img")[0].src;
		if ((img_src.indexOf("_off") != -1) && (img_src.indexOf("lvl4") == -1))
		{	var new_link = new right_nav_link(links[i], right_nav_links.length);
			right_nav_links.push(new_link);
		}
	}
	
}



function right_nav_link(the_link, index)
{	this.status = "off";
	this.img = the_link.getElementsByTagName("img")[0];
	this.hover_img = new Image();
	this.off_img = new Image();
	
	//get the off and hover img
	var src = this.img.src;
	if (src.indexOf("_off") != -1)
	{	src = src.split("_off")[0];
		this.off_img.src = src + "_off.gif";
		this.hover_img.src = src + "_h.gif";	
	}
	
	//add the mouseover and out functions
	var func = function()
	{	right_nav_links[index].hover();	}
	
	addEvent(the_link, "onmouseover", func);

	var func = function()
	{	right_nav_links[index].out();	}
	
	addEvent(the_link, "onmouseout", func);
}

right_nav_link.prototype.hover = function()
{	
	if(this.status == "off")
	{	this.img.src = this.hover_img.src;
		this.status = "over";
	}
}

right_nav_link.prototype.out = function()
{	if(this.status == "over")
	{	this.img.src = this.off_img.src;
		this.status = "off";
	}
}



