YAHOO.namespace("example.container");

var Dom = YAHOO.util.Dom,Event = YAHOO.util.Event;
//var so = "";

function showvideo(filename,descr) 
{
	//document.getElementById('player').innerHTML="";

	YAHOO.example.container.panel2 = new YAHOO.widget.Panel("panel2", { width:"auto", visible:false, draggable:true, close:true,fixedcenter:true,modal:false,zindex:20 } );
	/*
	if (navigator.appName.indexOf('Microsoft') != -1)
        {
		//alert('jao');
		var width = '320';
		var height = '240';
	}
	else
	{
		//alert('jao1');
		var width = 'auto';
		var height = 'auto';
	}
*/

var width = '320';
var height = '240';
	YAHOO.example.container.panel2.setHeader(descr);
	YAHOO.example.container.panel2.setBody("<div id=\"player\"><embed src=\"swf/player.swf\" width=\""+width+"\" height=\""+height+"\" bgcolor=\"undefined\" allowscriptaccess=\"always\" allowfullscreen=\"true\" flashvars=\"file=http://www.simonselement.fi/upload/"+filename+"&backcolor=8F9FB6&frontcolor=FFFFFF&lightcolor=FFFFFF&screencolor=ffffff&autostart=true&resizing=false&controlbar=over\" /></div>");

	YAHOO.example.container.panel2.render("container");
			
	YAHOO.example.container.panel2.show();
	
	

	YAHOO.example.container.panel2.hideEvent.subscribe(helloworld);
}

function helloworld()
{
	document.getElementById('player').innerHTML="";
	document.getElementById('container').innerHTML="";
	//so = "";
}


var Lst;



function show(id,menuid)
{
		//document.getElementById(menuid).className="menu_active";
		document.getElementById("submenu1").style.display = "block";
		var a = document.getElementById(id).scrollHeight;
			
		
		if(document.getElementById(id).offsetHeight==0)
		{
			//document.getElementById(id).style.display =""
			
			var attributes = { height: { from:0,to:a},opacity: {from: 0, to: 1 }};
			var anim = new YAHOO.util.Anim(id, attributes, 0.4, YAHOO.util.Easing.easeOut);
			anim.animate();
		}
		else
		{
			/*
			var attributes = { height: { from:a,to:0},opacity: {from: 1, to: 0 }};
			
			var anim = new YAHOO.util.Anim(id, attributes, 0.4, YAHOO.util.Easing.easeOut);
			anim.animate();
			*/
		}
		
		return false;
}




function CngClass(obj){
 if (Lst) Lst.className='';
 obj.className='selected';
 Lst=obj;
}


function initmenu()
{
	show('submenu1','menuid');
}


