function showVideo( url, color ) {
	showVideoJSP( url );
}
function showReal( url, color ) {
	window.top.navigate( url );
}
function showFlash( url ) {	
	if ( typeof(window.videoWindow)!="undefined" )
		window.videoWindow.close();
	
	window.status = url;

	var width = 320, height = 264;
	if ( url.indexOf( "width=" )>=0 )
		width = parseInt( url.substring(url.indexOf( "width=" )+6) );
	if ( url.indexOf( "height=" )>=0 )
		height = parseInt( url.substring(url.indexOf( "height=" )+7) );
	var ix = url.indexOf( '?' );
	if( ix>=0 )
		url = url.substring( 0, ix );
	window.videoWindow = window.open( "/data/pages/flash.jsp?url="+url,"video","width="+width+",height="+height );
}

function showVideoDiv( url, color ) {
	var width = 352;
	var height = 400;

	var oPopBody = oPopup.document.body;

	divHeader="<div style='font-family:verdana;background:#"+color+";text-align:right'>";
	divHeader+="video <img style='cursor:hand;margin:2 2 2 2' onClick='parent.oPopup.hide()' src='%codebase%/close.gif'> </div>";

	divHTML="<div><embed width='"+width+"' height='"+height+"' src='"+url+"'></div>";
	
    oPopBody.innerHTML = divHeader+divHTML;
    oPopup.show(100, 100, width, height, document.body);

}

function closeWindow() {
	oPopup.hide();
}

function showVideoJSP( url ) {
	if ( typeof(window.videoWindow)!="undefined" )
		window.open( "about:blank", "video", "width=640,height=480,menubar=0,resizable=1,status=0,toolbar=0" ).close();
		
	window.videoWindow = window.open( "/data/pages/video.jsp?url="+url,"video","width=320,height=264" );
}

function showVideoNewWindow( url ) {
	var controlPanelHeight=46;

	var videoWindow = window.open( "","video","width=320,height=264" );
	var doc = videoWindow.document;
	doc.open( "text/html" );
	doc.writeln( '<html><head><title>Prezentacja video</title>' );
	doc.writeln( '<SCRIPT LANGUAGE=javascript >' );
	doc.writeln( 'function loaded() {');
	doc.writeln( 'amResize();');
	doc.writeln( 'ActiveMovie1.open("'+url+'");');
	doc.writeln( '}');
	doc.writeln( '</SCRIPT>' );
	doc.writeln( '<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>' );
	doc.writeln( 'function amResize()' );
	doc.writeln( '{' );
	doc.writeln( '	var w = ActiveMovie1.offsetWidth;' );
	doc.writeln( '	var h = ActiveMovie1.offsetHeight;' );

	doc.writeln( '	var diffW = 10;' );
	doc.writeln( 'var diffH = 30;' );

	doc.writeln( 'window.resizeTo( w+diffW, h+diffH );' );
	doc.writeln( '}' );

	doc.writeln( '</script>' );
	
	doc.writeln( '<SCRIPT LANGUAGE=javascript FOR=ActiveMovie1 EVENT=onresize>' );

	doc.writeln( ' amResize()' );

	doc.writeln( '</SCRIPT>' );
	

	doc.writeln( '</head><body topmargin="0" leftmargin="0">' );
/*
7.1: 6BF52A52-394A-11d3-B153-00C04F79FAA6
6.4: 22D6f312-B0F6-11D0-94AB-0080C74C7E95
*/

	doc.writeln( '<div>');
	doc.writeln( '<object classid="clsid:22D6f312-B0F6-11D0-94AB-0080C74C7E95" id="ActiveMovie1">');

	doc.writeln( '<param name="url" value="'+url+'">');

	doc.writeln( '</object>' );
	doc.writeln( '</div>');

	doc.writeln( '</body></html>');
	doc.close();
}
