var YuE = YAHOO.util.Event;
var YuD = YAHOO.util.Dom;
YAHOO.namespace("example.container");
/*
	Initialize and render the MenuBar when its elements are ready 
	to be scripted.
*/

YuE.onContentReady("productsandservices", function () {
	var ua = YAHOO.env.ua,
    oAnim;  // Animation instance

	/*
    	"beforeshow" event handler for each submenu of the MenuBar
        instance, used to setup certain style properties before
        the menu is animated.
    */

	function onSubmenuBeforeShow(p_sType, p_sArgs) {

		var oBody,
			oElement,
			oShadow,
			oUL;
					
		if (this.parent) {
		
			oElement = this.element;

            /*
            	Get a reference to the Menu's shadow element and 
                set its "height" property to "0px" to syncronize 
                it with the height of the Menu instance.
            */
			
            oShadow = oElement.lastChild;
            oShadow.style.height = "0px";
                        
            /*
            	Stop the Animation instance if it is currently 
                animating a Menu.
            */     
			
			if (oAnim && oAnim.isAnimated()) {                        
            	oAnim.stop();
                oAnim = null;                       
			}

			/*
            	Set the body element's "overflow" property to 
                "hidden" to clip the display of its negatively 
                positioned <ul> element.
            */ 
			
			oBody = this.body;

            //  Check if the menu is a submenu of a submenu.

			if (this.parent && !(this.parent instanceof YAHOO.widget.MenuBarItem)) {
                        
				/*
                	There is a bug in gecko-based browsers and Opera where 
                    an element whose "position" property is set to 
                    "absolute" and "overflow" property is set to 
                    "hidden" will not render at the correct width when
                    its offsetParent's "position" property is also 
                    set to "absolute."  It is possible to work around 
                    this bug by specifying a value for the width 
                    property in addition to overflow.
                */
				
                if (ua.gecko || ua.opera) {
                	oBody.style.width = oBody.clientWidth + "px";
				}
                                                       
				/*
                	Set a width on the submenu to prevent its 
                    width from growing when the animation 
                    is complete.
                */ 
				
				if (ua.ie == 7) {
					oElement.style.width = oElement.clientWidth + "px";
                }				
			}
    
			oBody.style.overflow = "hidden";

			/*
				Set the <ul> element's "marginTop" property 
                to a negative value so that the Menu's height
                collapses.
            */ 

            oUL = oBody.getElementsByTagName("ul")[0];
            oUL.style.marginTop = ("-" + oUL.offsetHeight + "px");
                    
		}
	}

	/*
    	"tween" event handler for the Anim instance, used to 
        syncronize the size and position of the Menu instance's 
        shadow and iframe shim (if it exists) with its 
        changing height.
	*/
	
	function onTween(p_sType, p_aArgs, p_oShadow) {

		if (this.cfg.getProperty("iframe")) {                    
			this.syncIframe();                
		}
                
		if (p_oShadow) {
			p_oShadow.style.height = this.element.offsetHeight + "px";
		}
	}
	
	/*
    	"complete" event handler for the Anim instance, used to 
        remove style properties that were animated so that the 
        Menu instance can be displayed at its final height.
    */
	
	function onAnimationComplete(p_sType, p_aArgs, p_oShadow) {

		var oBody = this.body,
        oUL = oBody.getElementsByTagName("ul")[0];

        if (p_oShadow) {
			p_oShadow.style.height = this.element.offsetHeight + "px";
		}

		oUL.style.marginTop = "";
        oBody.style.overflow = "";
                    
		//  Check if the menu is a submenu of a submenu.

		if (this.parent && !(this.parent instanceof YAHOO.widget.MenuBarItem)) {

			// Clear widths set by the "beforeshow" event handler
			if (ua.gecko || ua.opera) {
				oBody.style.width = "";
			}
                        
			if (ua.ie == 7) {
				this.element.style.width = "";
			}
		}                    
	}

	/*
    	"show" event handler for each submenu of the MenuBar 
        instance - used to kick off the animation of the 
        <ul> element.
	*/

	function onSubmenuShow(p_sType, p_sArgs) {

	var oElement,
        oShadow,
        oUL;
                
	if (this.parent) {

        oElement = this.element;
        oShadow = oElement.lastChild;
        oUL = this.body.getElementsByTagName("ul")[0];
                    
        /*
        	Animate the <ul> element's "marginTop" style 
            property to a value of 0.
        */
		
        oAnim = new YAHOO.util.Anim(oUL, 
        	{ marginTop: { to: 0 } },
            .2, YAHOO.util.Easing.easeOut);


            oAnim.onStart.subscribe(function () {        
				oShadow.style.height = "100%";                        
            });
    
            oAnim.animate();
    
			/*
            	Subscribe to the Anim instance's "tween" event for 
                IE to syncronize the size and position of a 
                submenu's shadow and iframe shim (if it exists)  
                with its changing height.
            */  
			
            if (YAHOO.env.ua.ie) {                            
            	oShadow.style.height = oElement.offsetHeight + "px";

                /*
                	Subscribe to the Anim instance's "tween"
                    event, passing a reference Menu's shadow 
                    element and making the scope of the event 
                    listener the Menu instance.
                */
				
                oAnim.onTween.subscribe(onTween, oShadow, this);
    
            }
    
            /*
            	Subscribe to the Anim instance's "complete" event,
                passing a reference Menu's shadow element and making 
                the scope of the event listener the Menu instance.
            */  
			
			oAnim.onComplete.subscribe(onAnimationComplete, oShadow, this);                    
		}
                
	}

	/*
		Instantiate a MenuBar:  The first argument passed to the 
        constructor is the id of the element in the page 
        representing the MenuBar; the second is an object literal 
        of configuration properties.
	*/
	
	var oMenuBar = new YAHOO.widget.MenuBar("productsandservices", { 
                                                            autosubmenudisplay: true, 
                                                            hidedelay: 750, 
                                                            lazyload: true });


	/*
    	Subscribe to the "beforeShow" and "show" events for 
        each submenu of the MenuBar instance.
    */
                
    oMenuBar.subscribe("beforeShow", onSubmenuBeforeShow);
    oMenuBar.subscribe("show", onSubmenuShow);

     /*
     	Call the "render" method with no arguments since the 
        markup for this MenuBar already exists in the page.
     */
	 
     oMenuBar.render();          
          
});
/*function showborder(e) {
	this.getElementsByTagName('img')[0].style.border = '2px solid #58BFCF';
	this.getElementsByTagName('img')[0].style.padding = '0';
}

function hideborder(e) {
	this.getElementsByTagName('img')[0].style.border = 'none';
	this.getElementsByTagName('img')[0].style.padding = '2px';
}*/
function showborder(e) {
	//e.getElementsByTagName('img')[0].style.border = '2px solid #58BFCF';
	//e.getElementsByTagName('img')[0].style.padding = '0';
	if (document.getElementById('desc').innerHTML !== 'home') {
		this.style.backgroundColor = '#8D7449';
		this.style.color = '#FFFFFF';
	} else {
		this.style.backgroundColor = '#8D7449';
		this.style.color = '#ffffff';
	}
}

function hideborder(e) {
	//e.getElementsByTagName('img')[0].style.border = 'none';
	//e.getElementsByTagName('img')[0].style.padding = '2px';
	if (document.getElementById('desc').innerHTML !== 'home') {
		this.style.backgroundColor = '';
		this.style.color = '#8D7449';
	} else {
		this.style.backgroundColor = '';
		this.style.color = '#ffffff';
	}
}

YuE.onDOMReady(function () {
	function gotohere(){
		if(document.getElementById('desc').innerHTML == 'Making New Paths') {
				location.href = "Case-Studies.html";
		} else {
		location.href = "Institutional-Overview.html";	
		
		}
	}	
	var sideTwo = YuD.getElementsByClassName('orht1')[2];
	YuE.addListener(sideTwo, "click", gotohere);					 
						 
	function gotothere(){
		location.href = "To-My-Fellow-Stakeholders.html";
	}	
	var abc = YuD.getElementsByClassName('orht1')[1];
	YuE.addListener(abc, "click", gotothere);	
	
		
	
	var allright = YuD.getElementsByClassName('orht1');
	for (var i=0; i<allright.length; i++) {
	YuE.addListener(allright[i], "mouseover", showborder);
	YuE.addListener(allright[i], "mouseout", hideborder);
	}
	
	var yisCur = 0;		
	var yisIndex = 1;
	var indexContainer = document.getElementById('yis-index');
	function yisGoForward(){
		if(yisCur>-6){
		yisCur = yisCur-1;
		yisIndex = yisIndex+1;
		indexContainer.innerHTML = yisIndex+' of 7';
		var myAnim = new YAHOO.util.Anim('yis-img-inner', { left: { to: yisCur*441 } }, 1, YAHOO.util.Easing.easeOut);
		myAnim.animate();
		}
		//alert('hi');
	}
	function yisGoBack(){
		if(yisCur<0){
		yisCur = yisCur+1;
		yisIndex = yisIndex-1;
		indexContainer.innerHTML = yisIndex+' of 7';
		var myAnim = new YAHOO.util.Anim('yis-img-inner', { left: { to: yisCur*441 } }, 1, YAHOO.util.Easing.easeOut);
		myAnim.animate();
		}
		//alert('hi');
	}
	YuE.addListener("yis-prev", "click", yisGoBack);
	YuE.addListener("yis-next", "click", yisGoForward);
	
	
	document.getElementById('yis-img-inner').innerHTML = '<img src="images/yearin-0.gif" width="441" height="235" /><img src="images/yearin-1.gif" width="441" height="235" /><img src="images/yearin-2.gif" width="441" height="235"/><img src="images/yearin-3.gif" width="441" height="235"/><img src="images/yearin-4.gif" width="441" height="235" /><img src="images/yearin-5.gif" width="441" height="235"/><img src="images/yearin-6.gif" width="441" height="235"/>';
	
YAHOO.example.container.dialog = new YAHOO.widget.Dialog("yis", 
																{ width : "480px",
																  fixedcenter : true,
																  visible : false, 
																  modal : true,
																   draggable : false, 
																  constraintoviewport : true																  													});
									  
	
	YAHOO.example.container.dialog.render();
	var yi = YuD.getElementsByClassName('orht1')[0];
	
	YuE.addListener(yi, "click", YAHOO.example.container.dialog.show, YAHOO.example.container.dialog, true);
	YuE.addListener(document.getElementById('yyyis'), "click", YAHOO.example.container.dialog.show, YAHOO.example.container.dialog, true);
	YuE.addListener("clo", "click", YAHOO.example.container.dialog.hide, YAHOO.example.container.dialog, true);
	var allthree = document.getElementById('threeli').getElementsByTagName('img');
	for (var i=0; i<allthree.length; i++) {
	function changeImg(e) {
		this.src = 'images/'+this.id+'-o.gif';					
	}
	function changeBackImg(e) {
		this.src = 'images/'+this.id+'.gif';
	}
	
	YuE.addListener(allthree[i], "mouseover", changeImg);
	YuE.addListener(allthree[i], "mouseout", changeBackImg);
	}
function popMenuMouseOver() {
	document.getElementById('popup').style.display = 'block';
}
function popMenuMouseOut() {
	document.getElementById('popup').style.display = 'none';
}

YuE.addListener("dropdown", "click", popMenuMouseOver);
YuE.addListener("dropdown", "mouseout", popMenuMouseOut);
YuE.addListener("popup", "mouseover", popMenuMouseOver);
YuE.addListener("popup", "mouseout", popMenuMouseOut);	


var aass = 0;

function txtd() {
	if(aass>-3){
	aass = aass-1;
	if (document.getElementById('bodybody')){
		document.getElementById('bodybody').style.lineHeight = 17+aass+'px';
		document.getElementById('bodybody').style.fontSize = 13+aass+'px';
	}
	
	/*if (YuD.getElementsByClassName('left-bottom')[0] !== undefined) {
		for (var i=0; i < YuD.getElementsByClassName('left-bottom').length; i++) {
			YuD.getElementsByClassName('left-bottom')[i].style.lineHeight = 17+aass+'px';
			YuD.getElementsByClassName('left-bottom')[i].style.fontSize = 12+aass+'px';
		}
		
	}*/
	
	
	if (document.getElementById('smp')){
		//document.getElementById('smp').style.lineHeight = 17+aass+'px';
		document.getElementById('smp').style.fontSize = 11+aass+'px';
		var allgolden = YuD.getElementsByClassName('golden');
		for  (var i=0; i<allgolden.length; i+=1) { 
		YuD.getElementsByClassName('golden')[i].style.fontSize = 12+aass+'px';
		}
	}
	
	if (document.getElementById('mpi')){
		document.getElementById('mpi').style.fontSize = 10+aass+'px';	
	}
	
	if (YuD.getElementsByClassName('evs')[0] !== undefined) {
	YuD.getElementsByClassName('evs')[0].style.lineHeight = 22+aass+'px';
	YuD.getElementsByClassName('evs')[0].style.fontSize = 11+aass+'px';
	YuD.getElementsByClassName('evs')[1].style.lineHeight = 22+aass+'px';
	YuD.getElementsByClassName('evs')[1].style.fontSize = 11+aass+'px';
	}
	if (YuD.getElementsByClassName('ruler')[0] !== undefined) {
		var allre = YuD.getElementsByClassName('ruler');
		for (var i=0; i<allre.length; i++) {
			
			if (document.getElementById('desc').innerHTML == 'Major Investments in our Portfolio') {
				allre[i].style.fontSize = 10+aass+'px';
			} else {
				allre[i].style.fontSize = 12+aass+'px';
			}
		}
		
		var allr = YuD.getElementsByClassName('first');
		for (var i=0; i<allr.length; i++) {
			if (allr[i].getElementsByTagName('span')[0] !== undefined) {
				allr[i].getElementsByTagName('span')[0].style.fontSize = 10+aass+'px';
			}
		}
	}
	}
}

function txti() {
	
	if(aass<3){
	aass = aass+1;
	if (document.getElementById('bodybody')){
		document.getElementById('bodybody').style.lineHeight = 17+aass+'px';
		document.getElementById('bodybody').style.fontSize = 13+aass+'px';
	}
	
	if (document.getElementById('mpi')){
		document.getElementById('mpi').style.fontSize = 10+aass+'px';	
	}
	
	if (document.getElementById('smp')){
		//document.getElementById('smp').style.lineHeight = 17+aass+'px';
		document.getElementById('smp').style.fontSize = 11+aass+'px';
		var allgolden = YuD.getElementsByClassName('golden');
		for  (var i=0; i<allgolden.length; i+=1) { 
		YuD.getElementsByClassName('golden')[i].style.fontSize = 12+aass+'px';
		}
	}
	
	if (YuD.getElementsByClassName('evs')[0] !== undefined) {
	YuD.getElementsByClassName('evs')[0].style.lineHeight = 22+aass+'px';
	YuD.getElementsByClassName('evs')[0].style.fontSize = 11+aass+'px';
	YuD.getElementsByClassName('evs')[1].style.lineHeight = 22+aass+'px';
	YuD.getElementsByClassName('evs')[1].style.fontSize = 11+aass+'px';
	}
	
	if (YuD.getElementsByClassName('ruler')[0] !== undefined) {
		var allre = YuD.getElementsByClassName('ruler');
		for (var i=0; i<allre.length; i++) {
			if (document.getElementById('desc').innerHTML == 'Major Investments in our Portfolio') {
				allre[i].style.fontSize = 10+aass+'px';
			} else {
				allre[i].style.fontSize = 12+aass+'px';
			}
		}
				
		var allr = YuD.getElementsByClassName('first');
		for (var i=0; i<allr.length; i++) {
			if (allr[i].getElementsByTagName('span')[0] !== undefined) {
				allr[i].getElementsByTagName('span')[0].style.fontSize = 10+aass+'px';
			}
		}			
	}
	}
}

YuE.addListener("txtd", "click", txtd);
YuE.addListener("txti", "click", txti);

function chcolor() {	
	YuD.setStyle ( YuD.getElementsByClassName('boxy')[0] , 'backgroundColor' , '#EAE6D0' );
	
}
function chbcolor() {	
	YuD.setStyle ( YuD.getElementsByClassName('boxy')[0] , 'backgroundColor' , '#FAF8E8' );
}
YuE.addListener("colla", "mouseover", chcolor);
YuE.addListener("colla", "mouseout", chbcolor);

YuD.setStyle( 'yisPrint' , 'display' , 'block' );

var mph = YuD.getElementsByClassName  ( 'hd' , 'div' , 'myPanel');
YuD.setStyle( mph[0] , 'display' , 'block' );

var mpb = YuD.getElementsByClassName  ( 'bd' , 'div' , 'myPanel');
YuD.setStyle( mpb[0] , 'display' , 'block' );

var yish = YuD.getElementsByClassName  ( 'hd' , 'div' , 'yis');
YuD.setStyle( yish[0] , 'display' , 'block' );

var yisb = YuD.getElementsByClassName  ( 'bd' , 'div' , 'yis');
YuD.setStyle( yisb[0] , 'display' , 'block' );

if (document.getElementById('closef')) {
YuD.setStyle( document.getElementById('closef') , 'display' , 'block' );
}

//yisPrint
if (document.getElementById('desc').innerHTML !== 'home') {
	var sp1 = document.createElement("div");
	sp1.setAttribute("id", "newSpan");
	//var sp1_content = document.createTextNode("<img src='images/backtotop.gif' />");
	//sp1.appendChild(sp1_content);
	sp1.innerHTML = '<a href="#top"><img src="images/backtotop.gif" /></a>';
	var sp2 = document.getElementById('footer');
	YuD.insertBefore ( sp1 , sp2);
	
	var tp1 = document.createElement("a");
	tp1.setAttribute("name", "top");
	var tp2 = document.getElementById('desc');
	YuD.insertBefore ( tp1 , tp2);
}


function changembImg(e) {
		this.src = 'images/'+this.id+'-o.gif';					
	}
	function changembBackImg(e) {
		this.src = 'images/'+this.id+'.gif';
	}
	
	YuE.addListener(document.getElementById('inside-formobiledevices'), "mouseover", changembImg);
	YuE.addListener(document.getElementById('inside-formobiledevices'), "mouseout", changembBackImg);


function changembhImg(e) {
		this.src = 'images/'+this.id+'-o.gif';					
	}
	function changembhBackImg(e) {
		this.src = 'images/'+this.id+'.gif';
	}
	
	YuE.addListener(document.getElementById('home-formobiledevices'), "mouseover", changembhImg);
	YuE.addListener(document.getElementById('home-formobiledevices'), "mouseout", changembhBackImg);
});
function printerpop() {
	var url = document.getElementById('desc').innerHTML;
	url = url+'-pf.html';
	window.open(url,'pop','height=700,width=615,left=30,top=30, scrollbars=1');
}

YuE.addListener("printerpop", "click", printerpop);
function printerspop() {
	url = 'Year in Summary-pf.html';
	window.open(url,'pop','height=700,width=615,left=30,top=30, scrollbars=1');
}
YuE.addListener("yisPrint", "click", printerspop);

var div = document.getElementById('mpiContainer');

var globalEvents = {
	start:function(type, args){
		div.innerHTML = "loading...";
	},

	complete:function(type, args){
		div.innerHTML = "complete";
	},

	success:function(type, args){
		if(args[0].responseText !== undefined) {
			div.innerHTML = args[0].responseText;
		}
	},

	failure:function(type, args){
		YAHOO.log("Custom Event *failure* fired for transaction" + args[0].tId + ".", "info", "example");
		div.innerHTML += "<li>Transaction " + args[0].tId + " " + type + " fired.</li>";
		if(args[0].responseText !== undefined){
			div.innerHTML += "<li>Transaction id: " + args[0].tId + "</li>";
			div.innerHTML += "<li>HTTP status: " + args[0].status + "</li>";
			div.innerHTML += "<li>Status code message: " + args[0].statusText + "</li>";
		}
	},

	abort:function(type, args){
		YAHOO.log("Custom Event *abort* fired for transaction" + args[0].tId + ".", "info", "example");
		div.innerHTML += "<li>Transaction " + args[0].tId + " " + type + " fired.</li>";
	}
};

YAHOO.util.Connect.startEvent.subscribe(globalEvents.start);
YAHOO.util.Connect.completeEvent.subscribe(globalEvents.complete);
YAHOO.util.Connect.successEvent.subscribe(globalEvents.success);
YAHOO.util.Connect.failureEvent.subscribe(globalEvents.failure);
YAHOO.util.Connect.abortEvent.subscribe(globalEvents.abort);

var callback = { argument:["foo","bar"] };

function makeRequest(purl){
	var sUrl = purl;
	var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
}

function mpiprinterpop(url) {
	//url = url+'-pf.html';
	//window.open(url,'pop','height=700,width=615,left=30,top=30, scrollbars=1');
alert(url);
}

function tableruler() {
	if (document.getElementById && document.createTextNode) {
		var tables=document.getElementsByTagName('table');
		for (var i=0;i<tables.length;i++) {
			if(tables[i].className=='ruler') {
				var trs=tables[i].getElementsByTagName('tr');
				for(var j=0;j<trs.length;j++) {
					
					if(trs[j].parentNode.nodeName=='TBODY') {
						
						trs[j].onmouseover=function(){
						if (this.className == "spec-row"){
							this.className='spec-ruled';	
						}  else if (this.className == "blank-row"){	
							
						} else {
							this.className='ruled';	
						}
						return false;
						
						
						//alert('<img src="images/'+this.getElementsByTagName('td')[1].innerHTML+'.gif" />');
						}
						trs[j].onmouseout=function(){
						if (this.className == "spec-ruled"){	
							this.className='spec-row';
						} else if (this.className == "blank-row"){	
							
						} else if (document.getElementById('desc').innerHTML == 'Major Investments in our Portfolio') {
							if(!this.clicked) {
								this.className='';
							}
						}
						
						else {
							
							this.className='';
							
						}
						return false;}
						trs[j].onclick = function() {
							if (document.getElementById('desc').innerHTML == 'Major Investments in our Portfolio') {
						//document.getElementById('big-holder').src = 'images/'+this.getElementsByTagName('td')[1].innerHTML+'.gif';
						if (this.getElementsByTagName('td')[1].innerHTML == 'Chartered Semiconductor<br>Manufacturing' || this.getElementsByTagName('td')[1].innerHTML == 'Chartered Semiconductor<BR>Manufacturing') {
							var newURL = 'Chartered Semiconductor Manufacturing.html';
						} else {							
							var newURL = this.getElementsByTagName('td')[1].innerHTML+'.html';
						}
						makeRequest(newURL);
						//document.getElementById('desc').innerHTML = this.getElementsByTagName('td')[1].innerHTML;
						//alert(document.getElementById('desc').innerHTML);
						//YuE.addListener("printerpop", "click", printerpop);
						var leftTbl = YuD.getElementsByClassName('ruler');
						for (var i=0; i<leftTbl.length; i++) {
							var leftTrs=leftTbl[i].getElementsByTagName('tr');
							var abcf = this.getElementsByTagName('td')[1].innerHTML;
							for(var j=0;j<leftTrs.length;j++) {
								leftTrs[j].clicked = false;
								leftTrs[j].className='';
							}
						}
						this.clicked = true;
						this.className='ruled';
						
						
						if (this.getElementsByTagName('td')[1].innerHTML == 'Chartered Semiconductor<br>Manufacturing' || this.getElementsByTagName('td')[1].innerHTML == 'Chartered Semiconductor<BR>Manufacturing') {
							
							var abcff = 'Chartered Semiconductor Manufacturing';
							
						} else {
							var abcff = this.getElementsByTagName('td')[1].innerHTML;
						}
						//alert(abcf);
						//document.getElementById('pfc').innerHTML = '<img src="images/print.gif" class="jhand" title="Print friendly page"  onClick="mpiprinterpop('+abcf+');" />';
						document.getElementById('pfp').onclick = function() {
						//alert ('hullo');
						
						url = abcff+'-pf.html';
						
						window.open(url,'pop','height=700,width=615,left=30,top=30, scrollbars=1');

}

				
						}
						}
					}
				}
			}
		}
	}
}
if (document.getElementById('desc')){
	if (document.getElementById('desc').innerHTML !== 'home') {
		tableruler();
	}
}
function bookmark(){
	var url = location.href;
	//var url = 'http://www.google.com';
	var title = document.getElementsByTagName('title')[0].innerHTML;
	 if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
	 window.external.AddFavorite(url,title);
	 } else if (navigator.appName == "Netscape") {
		window.sidebar.addPanel(title,url,"");
	  } else {
		alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
	  }
}

YuE.addListener("bookmark", "click", bookmark);

if (document.getElementById('mailtocell')){
document.getElementById('mailtocell').innerHTML = '<a href="mailto:?subject=Temasek Review 2008&body=Please click this link '+location.href+' to visit a section in the Temasek Review 2008"><img src="images/mail.gif" title="Email this page" class="jhand" /></a>';

}
//function qtest(){
//alert('hi');
//}
//YuE.addListener("qtest", "click", qtest);