// JavaScript Document
// Code originally from 
// Pop-Up Audio Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com
// Khiewchanta note: Note this is changed from the original, grab the original code from http://digitalmedia.oreilly.com
var UniqueID = 314 // Make each link open in a new window.
function AudioPop(soundfilepath) {
var soundfiledesc = "Appon's Thai Food";
PlayerWin = window.open('',UniqueID,'width=486,height=304,top=0,left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayerWin.focus(); 
var winContent = "<html><head><title>" + soundfiledesc + "</title></head><body bgcolor='#ff9900'>";
winContent += "<b style='font-size:18px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</b>";
winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;line-height:1.5'>You may need Quicktime from Apple installed to play this file, or click the download link and it will play in your media player.</p>";

winContent += "<object width='468' height='42'>";
winContent += "<param name='src' value='" +  soundfilepath + "'>";
winContent += "<param name='autoplay' value='true'>";
winContent += "<param name='controller' value='true'>";
winContent += "<param name='bgcolor' value='#ff9900'>";
winContent += "<embed src='" + soundfilepath + "' autostart='true' loop='false' width='468' height='42' controller='true' bgcolor='#ff9900'></embed>";
winContent += "</object>";

winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='"+soundfilepath+"'>Download this file</a> <span style='font-size:10px'>(right-click or Option-click)</span></p>";

winContent += "<form><div align='center'><input type='button' value='close this window' onclick='javascript:window.close();'></div></form>";
winContent += "<img src=\"/cgi-bin/axs/ax.pl?trans.gif\" height=\"1\" width=\"1\" alt=\"\" >"
winContent += "</body></html>";
PlayerWin.document.write(winContent);
PlayerWin.document.close(); // "Finalizes" new window
UniqueID = UniqueID + 1
}


