// JavaScript Document
function spdf(uindex)
		{
			
			var p_width=320;
			var p_height=240;
			var autostart = 1;
			var showcontrols = 1;
			var showstatusbar = 1;
			var showdisplay = 1;
			var morewidth = 20;
			var moreheight = 30;
						
			path = document.location.pathname;
			paths = path.substring(1,path.lastIndexOf('.'));
			hpath = document.location.hostname;
			fname = media[uindex] +".wmv";
			//fname = media[uindex];
			
			if ((hpath!="localhost")&&(hpath!="www.mave4.com")) { return 0; };
				
			if (hpath=="localhost") { fpath = "http://localhost/film/"+fname; };
			
			if (hpath=="www.mave4.com") { fpath = "http://f.mave4.com/"+fname; };
						
			if (autostart > 0) { va1 = "true"; va2 = "1"; } else { va1 = "false"; va2 = "0"; };
			
			if (showcontrols > 0) { vsc1 = "true"; vsc2 = "1"; p_height = p_height + 46; } else { vsc1 = "false"; vsc2 = "0"; };
			 
			if (showstatusbar > 0) { vss1 = "true"; vss2 = "1"; p_height = p_height + 26; } else { vss1 = "false"; vss2 = "0"; };
			
			if (showdisplay > 0) { vsd1 = "true"; vsd2 = "1"; p_height = p_height + 74; } else { vsd1 = "false"; vsd2 = "0"; };
			
			var w_width = p_width + morewidth;
			var w_height= p_height + moreheight;
			 
			NewWindow=window.open('','','width='+w_width+',height='+w_height+',toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=yes,resizable=yes,fullscreen=no');
			
			NewWindow.document.writeln("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
			NewWindow.document.writeln("<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">");
			NewWindow.document.writeln("<style type=\"text/css\">\n<!--\n a {text-decoration: none; color: #000;} \n a:hover {color: #fff;}\n --> \n </style>\n");
			NewWindow.document.writeln("<title>[ mave4 ]</title>\n");
			NewWindow.document.writeln("<script type=\"text/javascript\">\n function pg_setup() { \n pg_resize(100,100); \n if (window!=top) { top.location.href=location.href; }; \n}\n");
			NewWindow.document.writeln("function pg_resize(w,h) {\n image = document.getElementById('pimg'); \n if (image.width>0 && image.height>0) { \n window.resizeTo(image.width+w, image.height+h); \n } \n } \n </script> \n </head>");
			NewWindow.document.writeln("<body leftmargin=0 topmargin=0 marginwidth=0 onload=\"pg_setup()\" style=\"font-family:Arial, Helvetica, sans-serif; font-size:11pt; background-color:#000\">");
			NewWindow.document.writeln("<div style=\"font-family:Tahoma, Helvetica, sans-serif; font-size:1em; text-align: center; background-color:#000\">");
        	NewWindow.document.writeln("<OBJECT ID=\"MediaPlayer\" WIDTH=\""+p_width+"\" HEIGHT=\""+p_height+"\" CLASSID=\"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" STANDBY=\"Loading Windows Media Player components...\" TYPE=\"application/x-oleobject\"> \n");
			NewWindow.document.writeln("<PARAM NAME=\"FileName\" VALUE=\"" +fpath+ "\">\n<PARAM name=\"autostart\" VALUE=\""+va1+"\">\n<PARAM name=\"ShowControls\" VALUE=\""+vsc1+"\">\n<param name=\"ShowStatusBar\" value=\""+vss1+"\">\n<PARAM name=\"ShowDisplay\" VALUE=\""+vsd1+"\">\n");
			NewWindow.document.writeln("<EMBED TYPE=\"application/x-mplayer2\" SRC=\"" +fpath+ "\" NAME=\"MediaPlayer\" WIDTH=\""+p_width+"\" HEIGHT=\""+p_height+"\" ShowControls=\""+vsc2+"\" ShowStatusBar=\""+vss2+"\" ShowDisplay=\""+vsd2+"\" autostart=\""+va2+"\"> </EMBED>\n");
			NewWindow.document.writeln("</OBJECT>\n");
			NewWindow.document.writeln("</div>");
			NewWindow.document.writeln("<div style=\"position: absolute; bottom: 0px; left: 0px; background-color: #fa0; color: white; text-align: center; font-weight: bold; padding-top: 0.2em; width: 100%; height: 1.5em; line-height: 1.2em;\"><a href=\"" +fpath+ "\" title=\"kliknij tutaj aby pobrac ten film\">Tutaj pobierz i zapisz plik na dysku</a></div>\n");
			NewWindow.document.writeln("</body>\n</HTML>\n");
			NewWindow.document.close(); 
			NewWindow.focus(); 
					
		}				
