<html>
<head>
<script language="javascript>
//Media Link
function playmedia(strID,strType,strURL,intWidth,intHeight) {
var objDiv=document.getElementById(strID);
if (!objDiv) return false;
if (objDiv.style.display!='none') {
objDiv.innerHTML='';
objDiv.style.display='none';
} else {
objDiv.innerHTML=makemedia(strType,strURL,intWidth,intHeight);
objDiv.style.display='block';
}
}
//Media Build
function makemedia (strType,strURL,intWidth,intHeight) {
var strHtml;
switch(strType) {
case 'wmp':
strHtml="<object width='"+intWidth+"' height='"+intHeight+"' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'><param name='url' value='"+strURL+"'/><embed width='"+intWidth+"' height='"+intHeight+"' type='application/x-mplayer2' src='"+strURL+"'></embed></object>";
break;
case 'swf':
strHtml="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='"+intWidth+"' height='"+intHeight+"'><param name='movie' value='"+strURL+"'/><param name='quality' value='high' /><embed src='"+strURL+"' quality='high' type='application/x-shockwave-flash' width='"+intWidth+"' height='"+intHeight+"'></embed></object>";
break;
case 'flv':
strHtml="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+intWidth+"' height='"+(parseInt(intHeight)+20)+"' id='FLVPlayer'><param name='movie' value='images/others/flv.swf?autostart=true&repeat=false&file="+strURL+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><embed src='images/others/flv.swf?autostart=true&repeat=false&file="+strURL+"' quality='high' type='application/x-shockwave-flash' width='"+intWidth+"' height='"+(parseInt(intHeight)+20)+"' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent'></embed></object>";
break;
case 'real':
strHtml="<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='"+intWidth+"' height='"+intHeight+"'><param name='src' value='"+absbaseurl+"inc/realplay.php?link="+strURL+"' /><param name='controls' value='Imagewindow' /><param name='console' value='clip1' /><param name='autostart' value='true' /><embed src='"+absbaseurl+"inc/realplay.php?link="+strURL+"' type='audio/x-pn-realaudio-plugin' autostart='true' console='clip1' controls='Imagewindow' width='"+intWidth+"' height='"+intHeight+"'></embed></object><br/><object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='"+intWidth+"' height='44'><param name='src' value='"+absbaseurl+"inc/realplay.php?link="+strURL+"' /><param name='controls' value='ControlPanel' /><param name='console' value='clip1' /><param name='autostart' value='true' /><embed src='"+absbaseurl+"inc/realplay.php?link="+strURL+"' type='audio/x-pn-realaudio-plugin' autostart='true' console='clip1' controls='ControlPanel' width='"+intWidth+"' height='44'></embed></object>";
break;
}
return strHtml;
}
</script>
</head>
<body>
<div id="media1></div>
<a href="javascript:void(0)" onclick="playmedia('media1', 'wmp', 'http://www30.websamba.com/DoanDuy8x/Thienduongvangem-dangkhoi.wma', '400', '300');">Open/Close Media</a>
</body>
</html>