<!--

// Get the HTTP Object
function getHTTPObject()
{
	if (window.ActiveXObject) 
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) 
	{
		return new XMLHttpRequest();
	}
	else
	{
		alert("Your browser does not support AJAX.");
		return null;
	}
}

// Change the value of the output Textfield
/*function setVideo(vid, autoplay)
{
	var videoHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="512" height="400">'
  +'<param name="movie" value="../media/candy-video-player.swf?watch=' + vid + '&autoplay=' + autoplay + '">'
  +'<param name="quality" value="high">'
  +'<param name="allowFullScreen" value="true" />'
  +'<param name="bgcolor" value="#1A1A1A" />' 
  +'<embed src="../media/candy-video-player.swf?watch=' + vid + '&autoplay=' + autoplay + '" quality="high" allowFullScreen="true" bgcolor="#1A1A1A" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="512" height="400"></embed>'
+'</object>';
	document.getElementById('video_player').innerHTML = videoHTML;
}*/

function setVideo(vid, autoplay)
{
	var so = new SWFObject("media/candy-video-player.swf?watch=" + vid + "&autoplay=" + autoplay,"flashID","512","400","10");
	so.addParam("quality", "high");
	so.addParam("allowFullScreen", "true");
	so.addParam("allowScriptAccess", "always");
	so.write("video_player");
}

// Change the value of the output Textfield
function setMusicMenu(pageNo)
{
	httpObject = getHTTPObject();
	
	if (httpObject != null)
	{
		httpObject.open("GET", "music-page.php?page=" + pageNo, true);
		httpObject.send(null);
		httpObject.onreadystatechange = musicMenuOutput;
	}
		document.getElementById('content_col2').innerHTML = "Loading video menu...";
}

// Change the value of the output Textfields
function musicMenuOutput()
{
	if(httpObject.readyState == 4)
	{
		eval("var response = ("+httpObject.responseText+")");
		
		var match = new RegExp("~", "ig"); 
		videoMenuHTML = response.message.replace(match, "'");
		
		document.getElementById('content_col2').innerHTML = videoMenuHTML;
	}
}

// Change the value of the output Textfield
function setAudioMenu(pageNo)
{
	httpObject = getHTTPObject();
	
	if (httpObject != null)
	{
		httpObject.open("GET", "audio-page.php?page=" + pageNo, true);
		httpObject.send(null);
		httpObject.onreadystatechange = audioMenuOutput;
	}
		document.getElementById('content_col2').innerHTML = "Loading video menu...";
}

// Change the value of the output Textfields
function audioMenuOutput()
{
	if(httpObject.readyState == 4)
	{
		eval("var response = ("+httpObject.responseText+")");
		
		var match = new RegExp("~", "ig"); 
		videoMenuHTML = response.message.replace(match, "'");
		
		document.getElementById('content_col2').innerHTML = videoMenuHTML;
	}
}

//-->