function getSongDetails() {
	var x = "cookie not set";
	//read from cookie, set the cookie name to search for
	c_name = "songDetails";
	if (document.cookie.length>0) {
  	c_start=document.cookie.indexOf(c_name + "=");
  	if (c_start!=-1) { 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		x = unescape(document.cookie.substring(c_start,c_end));
    } 
  }
	
  return x;
}

function getArtistDetails() {
	var x = "cookie not set";
	//read from cookie, set the cookie name to search for
	c_name = "artist";
	if (document.cookie.length>0) {
  	c_start=document.cookie.indexOf(c_name + "=");
  	if (c_start!=-1) { 
		c_start=c_start + c_name.length+1; 
		c_end=document.cookie.indexOf(";",c_start);
		if (c_end==-1) c_end=document.cookie.length;
		x = unescape(document.cookie.substring(c_start,c_end));
    } 
  }
	
  return x;
}


//for callin action script in js

function displayFlashInfo() {
	//movie is used because that is the name/id of the flash embed tag
	if(navigator.appName.indexOf("Microsoft") != -1) {
		flash = window.movie;
	}else {
		flash = window.document.movie	
	}
	flash.displaySongs();
}

//---------- all of above is for the flash/cookie/js variable loading and linking
function playSong(path, title, artist, songid, count) {
	var source=path+title+".mp3";
	document.cookie="songDetails="+source;
	document.cookie="artist="+artist;
	displayFlashInfo();
	if (count == "addcount") {
		playcount(songid);
	}
}
// add to the play count of the song
function playcount(songid) {
	pCOUNTxmlHttp=GetXmlHttpObject();
	//xmlHttp.onreadystatechange = stateChanged;
	
	if (pCOUNTxmlHttp==null)
  	{
  		alert ("Your browser does not support AJAX!");
  		return;
  	}
	pCOUNTxmlHttp.open('POST', 'scripts/music/addtoplaycount.php', true);
  	pCOUNTxmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	pCOUNTxmlHttp.send('songid='+songid);	
	
}

//javascript work around for removing ie7 click to activate shit -----------------

