function launcht2s(){
	var pageUrlWOExt = location.href.split(".html")[0]; //eg. "http://om2test.asia1.com.sg/News/World%2BNews/Story/OMYStory200812081914-26499/2"
	var pageName = pageUrlWOExt.substr(pageUrlWOExt.lastIndexOf("/")+1); //eg. "OMYStory200812081914-26499" or "2"
	if (!isNaN(pageName)) pageUrlWOExt = pageUrlWOExt.substr(0, pageUrlWOExt.lastIndexOf("/")); //if pageName is a number then this is a pagination - redirect to main page t2s link
	pageUrlWOExt = pageUrlWOExt.replace(window.location.host, window.location.host+"/t2s");
	
	var t2sUrl = pageUrlWOExt+"_t2s.html?t2s=y";
	
	var width = 600; var height = 600;
	var t2sPopup = window.open(t2sUrl, "t2sPopup", "height="+height+",width="+width+",left="+getPopupLeft(width)+",top="+getPopupTop(height)+"channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0", ""); 
	t2sPopup.focus();
}

function showHideT2s(audio, spanId){;
	//change the style of the source element
	var spanTag = document.getElementById(spanId);
	spanTag.className = (spanTag.className=='showLink')?'hideLink':'showLink';
	
	//get id of trg el from src el's id
	//var spanTag = e; //(e.target) ? e.target : e.srcElement; //the span tag that was clicked, eg. "link_id_t2s1"
	var aryName = spanTag.id.split("_");
	var trgElName = aryName[1]+"_"+aryName[2]; //corresponding id for the div tag, eg. "id_t2s1"
	
	//toggle the visibility of the target element
	var trgEl=document.getElementById(trgElName);
	trgEl.className=(trgEl.className=='hidden') ? "t2svisible" : "hidden2";
	
	//embed/remove the audio player
	//audio = "20070626_001_lms02_pod1.mp3";
	if (trgEl.className=='t2svisible') embedT2sFlash(audio, trgEl.id); //front folder name for audio determined in flash
	else trgEl.innerHTML = ""; //stopThisSound("mediaObj"+trgEl.id, trgEl);
	
	//link_id_t2s
	if (trgEl.className=='t2svisible') { //trying to open this audio player
		//collapse all other audio players
		var aryAudioDiv = document.getElementsByTagName("DIV");
		for (var i=0; i<aryAudioDiv.length; i++) {
			if (aryAudioDiv[i].id.substr(0,6)=="id_t2s" && aryAudioDiv[i].id!=trgEl.id) { //eg. id="id_t2s5" - this is an audio player div AND not the audio player that user was trying to open
				aryAudioDiv[i].innerHTML = ''; //remove the flash player
				aryAudioDiv[i].className = 'hidden'; //hide the div holder
				if (document.getElementById("link_"+aryAudioDiv[i].id))
					document.getElementById("link_"+aryAudioDiv[i].id).className = 'showLink'; //change the style of the btn
			}
		}
	}
}

//"mediaType" param is optional - only if NOT called via loadmedia() - eg. for t2s embedding
function embedT2sFlash(media_src, trgId) {
	var so = new SWFObject("/global/common/media/swf/t2s.swf", "mediaObj"+trgId, "227", "43", "8", "");
	so.addParam("wmode", "transparent");
	so.addVariable("t2sFilename", media_src);
	so.addVariable("autoPlayMedia", true);
	so.useExpressInstall('/global/common/swf/expressinstall.swf');
	so.write(trgId);
}

//not used: no point calling the flash again to stop sound since removing the flash obj will stop sound
//also in FF the sound stop() lags anyway.
//the function that calls the AS function "stopSound()"
/*function stopThisSound(flashObj, divEl) {
	document.getElementById(flashObj).stopFlashSound(); //stop the sound (for IE)
	//divEl.innerHTML = ''; //remove the flash
}*/
