// JavaScript Document
function display_mm(video_link,type, extension, title) {
	switch(type) {
		case "audio":
			display_audio(video_link, type, extension, title);
		break;
		case "video":
			display_video(video_link, type, extension, title);
		break;
		case "flash":
			display_flash(video_link, type, extension, title);
		break;
		case "images":
		case "image":
			display_image(video_link, type, extension, title);
		break;
	}
}

function display_video(video_link, type, extension, title) {
	window2 = window.open('','','width=400,height=400,left=300,top=300');
	text = "<OBJECT id='mediaPlayer' width=\"400\" height=\"400\" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>\n<param name='fileName' value=\""+video_link+"\">\n<param name='animationatStart' value='true'>\n<param name='transparentatStart' value='true'>\n <param name='autoStart' value=\"true\">\n<param name='showControls' value=\"true\">\n<param name='loop' value=\"true\">\n<EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='1' bgcolor='darkblue' showcontrols=\"true\" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width=\"400\" height=\"400\" src=\""+video_link+"\" autostart=\"true\" designtimesp='5311' loop=\"true\">\n</EMBED></OBJECT>"
	window2.document.writeln('<html><head>');
	window2.document.writeln('<title>Anews.net - Multimedia Window - '+unescape(title)+'</title>');
	window2.document.writeln('</head><body topmargin=0 leftmargin=0 bgcolor="#e2e4e5">');
	window2.document.writeln('<table width="100%" border="0" height="100%" cellspacing="3" cellpadding="0">');
	window2.document.writeln('<tr>');
	window2.document.writeln('<td align="center" valign="middle">'+text+'</td>');
	window2.document.writeln('</tr>');
	window2.document.writeln('</table>');
	window2.document.writeln('</body></html>');
	window2.focus();
}

function display_audio(audio_link, type, extension, title) {
	window2 = window.open('','','width=400,height=300,left=300,top=300');
	text ="<object classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' id='WindowsMediaPlayer1' width='240' height='64'>\n<param name='URL' value='"+audio_link+"'><param name='rate' value='1'><param name='balance' value='0'><param name='currentPosition' value='0'><param name='defaultFrame' value><param name='playCount' value='1'><param name='autoStart' value='-1'><param name='currentMarker' value='0'><param name='invokeURLs' value='-1'><param name='baseURL' value><param name='volume' value='50'><param name='mute' value='0'><param name='uiMode' value='full'><param name='stretchToFit' value='0'><param name='windowlessVideo' value='0'><param name='enabled' value='-1'><param name='enableContextMenu' value='-1'><param name='fullScreen' value='0'><param name='SAMIStyle' value><param name='SAMILang' value><param name='SAMIFilename' value><param name='captioningID' value><param name='enableErrorDialogs' value='0'><param name='_cx' value='6350'><param name='_cy' value='6482'></object>";
	window2.document.writeln('<html><head>');
	window2.document.writeln('<title>Anews.net - Multimedia Window - '+unescape(title)+'</title>');
	window2.document.writeln('</head><body topmargin=0 leftmargin=0 bgcolor="#e2e4e5">');
	window2.document.writeln('<table width="100%" border="0" height="100%" cellspacing="3" cellpadding="0">');
	window2.document.writeln('<tr>');
	window2.document.writeln('<td align="center" valign="middle">'+text+'</td>');
	window2.document.writeln('</tr>');
	window2.document.writeln('</table>');
	window2.document.writeln('</body></html>');
	window2.focus();
}

function display_image(image_link, type, extension, title) {
	window2 = window.open('','','width=400,height=250,left=300,top=300');
	text ="<img src=\""+image_link+"\">";
	window2.document.writeln('<html><head>');
	window2.document.writeln('<title>Anews.net - Multimedia Window - '+unescape(title)+'</title>');
	window2.document.writeln('</head><body topmargin=0 leftmargin=0 bgcolor="#e2e4e5">');
	window2.document.writeln('<table width="100%" height="100%" border="0" cellspacing="3" cellpadding="0">');
	window2.document.writeln('<tr>');
	window2.document.writeln('<td align="center" valign="middle">'+text+'</td>');
	window2.document.writeln('</tr>');
	window2.document.writeln('</table>');
	window2.document.writeln('</body></html>');
	window2.focus();
}

function display_flash(flash, type, extension, title) {
	flash_link = flash+"/main.swf";
	window2 = window.open('','','width=500,height=350,left=300,top=300');
	text ="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"500\" height=\"350\"><param name=\"movie\" value=\""+flash_link+"\"><param name=\"quality\" value=\"high\"><embed src=\""+flash_link+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"350\"></embed></object>";
	window2.document.writeln('<html><head>');
	window2.document.writeln('<title>Anews.net - Multimedia Window - '+unescape(title)+'</title>');
	window2.document.writeln('</head><body topmargin=0 leftmargin=0 bgcolor="#e2e4e5">');
	window2.document.writeln('<table width="100%"  height="100%" border="0" cellspacing="3" cellpadding="0">');
	window2.document.writeln('<tr>');
	window2.document.writeln('<td align="center" valign="middle">'+text+'</td>');
	window2.document.writeln('</tr>');
	window2.document.writeln('</table>');
	window2.document.writeln('</body></html>');
	window2.focus();
}