// JavaScript Document
// Pop-Up Embedder Script by David Battino, www.batmosphere.com; Object tag implementation by Mark Levitt, http://digitalmedia.oreilly.com


var UniqueID = 123 // Make each link open in a new window.
var newWinOffsetTop = 50// Position of first pop-up
var newWinOffsetLeft = 100// Position of first pop-up
function PlayerOpen(soundfiledesc,soundfilepath,urlpath,artistname,imgpath,track,venue,date,bio,scheduleurl) {


PlayWin = window.open('',UniqueID,'width=535,height=580,top=' + newWinOffsetTop +',left=' + newWinOffsetLeft +',resizable=yes,scrollbars=no,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
PlayWin.focus(); 
var winContent = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">";
winContent += "<HTML><HEAD><TITLE>" + artistname + "</TITLE>";
winContent += "<style><!-- body,p{font-family:Arial,Verdana,sans-serif;}a, a:visited,  a:active{color:#89A500;text-decoration:underline;}span.bottom_links a:hover{color:#666;text-decoration: none;} --></style>";

winContent += "<script language='JavaScript' type='text/JavaScript'>";
winContent += "function embedMusic()";
winContent += "{";
winContent += "document.writeln ('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"240\" height=\"15\" id=\"xspf_player\" align=\"middle\">');";
winContent += "document.writeln ('<param name=\"allowScriptAccess\" value=\"sameDomain\" />');";
winContent += "document.writeln ('<param name=\"movie\" value=\"/scripts/flash/xspf_player_slim.swf?song_url=" +  soundfilepath + "&player_title=JAZZ ASPEN MUSIC PLAYER - Press Play&song_title=" + track + "\"/>');";
winContent += "document.writeln ('<param name=\"quality\" value=\"high\" />');";
winContent += "document.writeln ('<param name=\"bgcolor\" value=\"#89A500\" />');";
winContent += "document.writeln ('<embed src=\"/scripts/flash/xspf_player_slim.swf?song_url=" +  soundfilepath + "&player_title=JAZZ ASPEN MUSIC PLAYER - Press Play&song_title=" + track + "\" quality=\"high\" bgcolor=\"#89A500\" width=\"240\" height=\"15\" name=\"xspf_player\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');";
winContent += "document.writeln ('</object>');";
winContent += "}";
winContent += "</script>";
winContent += "</HEAD>";

winContent += "<BODY style='background:#89A500;margin:0;padding:0;'>";
winContent += "<div style='margin-left:auto;margin-right:auto;margin-top:5px;text-align:center;width:490px;'>";
winContent += "<div style='width:478px;height:104px;border-top:8px solid #555;border-right:8px solid #555;border-bottom:1px solid #555;border-left:8px solid #555;padding:0px;margin:0px;text-align:center;'><img src='/images/artists-header.gif' width='446' height='100' border='0'></div>";

winContent += "<div style='width:478px;height:149px;border-left: 8px solid #555;border-right: 8px solid #555;background:transparent;'>";
winContent += "<div style='float:left;width:195px;height:149px;background:transparent;display:inline;'>";
if(imgpath){winContent +="<img src='/includes/thumb_create.php?img=/images/artists/" + imgpath + "&w=190&h=149' align='right' border='0'>";}
winContent += "</div>";
winContent += "<div style='float:left;width:240px;height:149px;margin-left:10px;display:inline;text-align:left;'><br>";
if(urlpath){winContent += "&gt; <A HREF='" + urlpath + "' target='_blank' style='color:#FFF'>OFFICIAL ARTIST WEBSITE</A><BR>";}
if(scheduleurl){winContent += "&gt; <A href='javascript:;' onclick=\"opener.location='" + scheduleurl + "';\" style='color:#FFF'>FULL SCHEDULE</A><BR><BR>";}

if(track){winContent += "<br><br><script type='text/javascript'>embedMusic()</script>";}

winContent += "</div></div>";
winContent += "<div style='clear:both;width:478px;height:260px;overflow:auto;border-left: 8px solid #555;border-right: 8px solid #555;border-top:1px solid #555;border-bottom: 8px solid #555;background:#FFF;'>";
winContent += "<div style='padding:10px;text-align:left'>";
winContent += "<B style='font-size:16px;line-height:1.5'>" + venue + "</B><br>";
winContent += "<B style='font-size:18px;line-height:1.5'>" + artistname + "</B><br>";
winContent += "<B style='font-size:14px;'>" + date + "</B>";
winContent += "<div style='font-size:12px;'>" + bio + "</div>";
winContent += "</div>";

winContent += "</div>";
winContent += "<DIV align='center' style='clear:both;width:475px;height:25px;background:transparent;padding:6px;'>";
winContent += "<FORM><INPUT type='button' value='close this window' onClick='javascript:window.close();' style='cursor:pointer;border:outset 1px #555;background:transparent;color:#555;font-weight:normal;font-size:12px;'>";
winContent += "</FORM></DIV>";
winContent += "<div style='clear:both;width:478px;height:20px;'>&nbsp;</div>";
winContent += "</div>";

winContent += "</BODY></HTML>";
PlayWin.document.write(winContent);
PlayWin.document.close(); // "Finalizes" new window
UniqueID = UniqueID + 1
// newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower.
}
