

function closeVideo(id) {
	var el = document.getElementById('video'+id);
	
	el.innerHTML = ""; 	
	document.getElementById('videoList'+id).style.display = 'block';
	 	
}

function showEmbed(title, url) 
{
	var titleEl = document.getElementById('videoTitle');
	titleEl.innerHTML = title;
	var el = document.getElementById('embedVideo');
	var tag ='&nbsp;'+' <object width=\"500\" height=\"375\">'
		+'<param name=\"movie\" value=\"'+url+'\"/>'
		+'<param name=\"wmode\" value=\"transparent\"/>'
		+'<embed src=\"'+url+'\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"500\" height=\"375\" />'
		
		+'</object>';
	
	el.innerHTML = tag;	
	
	
}

function showVideo(id, type, url) {

	var el = document.getElementById('video'+id);
	var format;
	var tag;
	if(type == 'flash') {
		format = '.flv';
			
			tag = 
			'<embed'
			+ ' src=\"mediaplayer.swf\"'
			+ ' width=\"500\"'
			+ ' height=\"375\"'
			+ ' allowscriptaccess=\"always\"'
			+ ' allowfullscreen=\"true\"'
			+ ' flashvars=\"height=375&width=500&file=' + url + '\"'
			+ '/>';
			
	}
	else if(type == 'qt') {
		format = '.mov';
		tag = 
			'<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"500\" height=\"375\" id=\"movie1\">' 
			+'<param name=\"bgcolor\" value=\"#161404\" />'
			+'<param name=\"enablehref\" value=\"true\" />' 
			+'<PARAM name=\"src\" value=\"'+url+'\">'
			+'<param name=\"AutoStart\" value=\"True\">'
			+'<embed width=\"500\" height=\"375\" src=\"'+url+'\" name=\"movie1\" enablejavascript=\"true\" bgColor=\"#000000\" ShowStatusBar=\"1\" loop=\"true\" enablehref=\"true\"></embed>' 
			+'</object>';
	
	}
		
	else if(type == 'wmv') {	
		format = ".wmv";
		tag = 
			'<OBJECT id=\'mediaPlayer\' width=\"500\" height=\"375\" 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\'>'
			+'<param name=\'fileName\' value=\"'+url+'\">'
			+'<param name=\"uiMode\" value=\"none\"/>'
			+'<param name=\'animationatStart\' value=\'true\'>'
			+'<param name=\'transparentatStart\' value=\'true\'>'
			+'<param name=\'autoStart\' value=\"true\">'
			+'<param name=\'showControls\' value=\"true\">'
			+'<param name=\'loop\' value=\"false\">'
			+'<EMBED type=\'application/x-mplayer2\' pluginspage=\'http://microsoft.com/windows/mediaplayer/en/download/\' id=\'mediaPlayer\' name=\'mediaPlayer\' displaysize=\'4\' autosize=\'-1\' bgcolor=\'darkblue\' showcontrols=\"1\" showtracker=\'1\' showdisplay=\'0\' showstatusbar=\'0\' videoborder3d=\'-1\' width=\"500\" height=\"375\" uiMode=none src=\"'+url+'\" autostart=\"true\" designtimesp=\'5311\' loop=\"false\"></EMBED>'
			+'</OBJECT>';
								
	}
	if (tag != null) {
		tag += '<br><span class="inner_content_small_header"><a href="javascript:closeVideo('+id+');">Close</a></span>';
				
		el.innerHTML = tag;
		
		document.getElementById('videoList'+id).style.display = 'none';
		
		ViewCounter.addView(id, 'addViewCallback');
	}
}
function downloadVideo(id, url) {
	window.location = url;
	ViewCounter.addDownload(id, 'addViewCallback');
}

function addViewCallback() {
}

