function OnPlay()
{
	if(WMPlay.playstate != 2)
	{
		WMPlay.play();
	}
}

function OnPause()
{
	if(WMPlay.playstate == 2)
	{
		WMPlay.pause();
	}
}

function OnStop()
{
		WMPlay.stop();
		WMPlay.currentposition=0;
}

function VolumeUpDown(UpDown)
{
    var AUDIOSTEP = 300;
    var curVol = document.WMPlay.Volume;

  if (UpDown == "up")
  {
    curVol = curVol + AUDIOSTEP;
     if (curVol > 0)
    {
      curVol = 0;
    }
  }
  else
  {
    curVol = curVol - AUDIOSTEP;
    if (curVol < -2000)
    {
      curVol = -2000;
    }
  }

  curVol = Math.floor(curVol);
  document.WMPlay.Volume = curVol;
}

function SoundMute(aa)
{
	if(aa=="0")
	{
		Player.mute =1;
		Player.Play();
	}
	else
	{
		Player.mute = 0;
		Player.Play();
	}
}


// JavaScript Document
/*
  Func. Name : Remote Flash Write

  ex)
  window.onload = function()
  {
    document.getElementById("ID Value").innerHTML = flashWrite2(url, w, h, vars, win, alt);
  }
*/
function flashWrite2(url, w, h, vars, win, alt)
{

  var id = url.split("/")[url.split("/").length-1].split(".")[0];
  if(vars == null) vars='';
  if(win == null) win='opaque';

  var objStr = "     <object ";

  if(navigator.appName.match("Internet Explorer")){
      objStr += "classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'";
  } else {
      objStr += "type='application/x-shockwave-flash' data='"+url+"' ";
  }
      objStr +="     id='"+id+"' style='width:"+w+"; height:"+h+";'>";
      objStr +="    <param name='base' value='.' />";
      objStr+= "    <param name='showLiveConnect' value='true' />";
      objStr +="    <param name='allowScriptAccess' value='always' />";
      objStr +="    <param name='movie' value='"+url+"' />";
      objStr +="    <param name='FlashVars' value='"+vars+"' />";
      objStr +="    <param name='wmode' value='"+win+"' />";
      objStr +="    <param name='menu' value='false' />";
      objStr +="    <param name='quality' value='high' />";
      objStr +="    <p>"+alt+"</p>";
      objStr +="  </object>";

  return objStr;
}

function flashWrite3(url, w, h){
	var objStr = "     <embed  wmode=transparent width="+w+" height="+h+" src="+url+" ></embed>";
	return objStr;
}


// PNG ÆÐÄ¡

/*
ex)
<img src="/images/img.png" class="png24">
*/

function setPng24(obj) {
    obj.width=obj.height=1;
    obj.className=obj.className.replace(/\bpng24\b/i,'');
    obj.style.filter =
    "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
    obj.src='';
    return '';
}