theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
//Karen Added this: 2009 11 09
function setWindowTitle(){
	//Title Changed For: 2009 09 11 Hotlink Refresh
	document.title = "Hotlink";
}
setWindowTitle();

//Karen Added this: 2009 11 09 
//To overwrite stuff in footer
var newselection="";
newselection+="<select name='othersite' id='othersite' onChange='toggleChangeSite(this)'>";
newselection+="<option value='#'>Other maxis Sites</option>";
newselection+="<option value='http://www.maxis.com.my'>Maxis Corporate</option>";
newselection+="<option value='http://www.maxis.com.my/3g'>Maxis 3G</option>";
newselection+="<option value='http://store.maxis.com.my'>Maxis Store</option>";
newselection+="<option value='http://www.maxis.com.my/moc_new/moc_highlight.asp'>Maxis One Club</option>";
newselection+="<option value='http://unifun.maxis.com.my'>UniFun</option>";
newselection+="<option value='http://mms.maxis.net.my/mms/index_frames.jsp'>MMS Gallery</option>";
newselection+="<option value='http://www.mblog.com.my/'>MBlog</option>";
newselection+="<option value='http://www.musicunlimited.com.my'>Music Unlimited</option>";
newselection+="<option value='http://www.maxis.com.my/islamic/'>Islamic Services </option>";
newselection+="<option value='http://mdp.maxis.com.my/index.jsp'>Maxis Developer Programme</option>";
newselection+="</select>";
var copyrightdate=new Date();
var copyrightyear=copyrightdate.getFullYear();
var newcopyright="";
newcopyright+="Copyright &copy; "+copyrightyear+" Maxis Mobile Services Sdn Bhd (73315-V) [fka Malaysian Mobile Services Sdn Bhd (73315-V)]";
newcopyright+="<br>";
newcopyright+="All rights reserved. All other trademarks and copyright used herein are the property of their respective owners.";
newcopyright+="<br>";
newcopyright+="Best viewed with Internet Explorer 7.0, Firefox 1.5 and Flash Player 8 and above.";
function toggleChangeSite(theURL)
{	
	//This function will replace 'changeSite' because the links are to open in new browser. Not within the same tab.
	var URL = theURL.options[theURL.selectedIndex].value;
	var OpenNewBrowers = true;
	if (URL == "http://www.maxis.com.my" )
	{   OpenNewBrowers = true; }
	else if (URL == "http://www.maxis.com.my/3g" )
	{	OpenNewBrowers = true;	}
	else if (URL == "http://store.maxis.com.my" )
	{	OpenNewBrowers = true;	}
	else if (URL == "http://www.maxis.com.my/moc_new/moc_highlight.asp" )
	{	OpenNewBrowers = true;	}
	else if (URL == "http://unifun.maxis.com.my" )
	{	OpenNewBrowers = true;	}	
	if (OpenNewBrowers)
	{
		window.open(URL,"sites");
	}
	else
	{
		window.location=URL;
	}	
}
	 

function overwriteFooterStuff(){
	if(document.getElementById("selection")){
		var footerselection = document.getElementById("selection");
		footerselection.innerHTML = newselection;
	}
	if(document.getElementById("copyright")){
		var copyrightID = document.getElementById("copyright");
		copyrightID.innerHTML = newcopyright;
	}
}
overwriteFooterStuff();
//Added modifySideNav on 30 09 2009 to overwrite the stupid side navigation backend script
//This will link directly to external sites
function modifySideNav(id, newlink, tgt){
	 
	document.getElementById(id).href = newlink;
	document.getElementById(id).target = tgt;
	 
}
function modifySubSideNav(keyword, newlink, tgt){
	var arr = new Array();
	arr = document.getElementsByTagName("a");

		for(var i=0; i<arr.length; i++){
			var o = document.getElementsByTagName("a").item(i);
			var olink = o.href;
			if (olink.indexOf(keyword) >=0){
				if(newlink == "feedbackpopup"){

					if (document.getElementById('sign-up').action.indexOf('login') >= 0){
							
						o.href = "javascript:alert('Sorry, you are required to login to MY HOTLINK with your username and password to access the Feedback Form. Thank you.');";
					}
					
				} else {
					o.href = newlink;
					o.target = tgt;
				}
			}
		}
	 
}
modifySubSideNav("keyword","newlink","tg");
//How to use
//@id : Get the element ID of the side nav
//@newlink : What's the new link it should go to
//@tgt : Open in new window or self
modifySubSideNav('Youth_Club_SA_en', 'http://www.hotlinkyouthclub.com.my', '_blank');
modifySideNav('Music_Unlimited_SA_en', 'http://www.musicunlimited.com.my', '_blank');
modifySideNav('Games_Unlimited_SA_en', 'http://www.gamesunlimited.com.my', '_blank');
modifySubSideNav('Feedback_SA_en', 'feedbackpopup', '');
//