﻿function mediaplay(files,titlevideo,w,h,p){
	if(files.lastIndexOf(".mp3")!=-1){	
		files=files;//+'&image=/Portals/0/Audio/10.swf';
		mp3audio(files,titlevideo,w,h,p);	
	}
	if(files.lastIndexOf(".flv")!=-1){		
		ViewVideo(files,titlevideo,w,h,p);	
	}
}
function ViewVideo(files,titlevideo,w,h,p){
	if (w<=0) w=480;
	if (h<=0) h=380;
	//w=217;
	//h=200;
	var sFPVideo = new SWFObject("/js/mediaplayer.swf","playlist",''+ w +'',''+ h +'',"7");
	sFPVideo.addParam("allowfullscreen","true");
	sFPVideo.addParam("wmode","opaque");
	sFPVideo.addVariable("file",'' + files + '');
	sFPVideo.addVariable("displayheight",''+ h-20 +'');
	sFPVideo.addVariable("width",''+ w +'');
	sFPVideo.addVariable("height",''+ h +'');
	sFPVideo.addVariable("backcolor","0x000000");	
	sFPVideo.addVariable("frontcolor","0xCCCCCC");
	sFPVideo.addVariable("lightcolor","0x557722");
	sFPVideo.addVariable("shuffle","false");
	sFPVideo.addVariable("repeat","list");
	sFPVideo.addVariable('autostart',''+ p +'');
	sFPVideo.write("viewvideofile");
}
function youtube(files,titlevideo,w,h,p){
	if (w<=0) w=480;
	if (h<=0) h=380;
	var sYoutubeVideo = '<iframe height="'+ h +'" frameborder="0" width="'+ w +'" allowfullscreen ="" src="'+ files +'" title="'+ titlevideo +'"></iframe>';
	document.getElementById("viewvideofile").innerHTML=sYoutubeVideo;
}

