function flash(w, h, path)
{ 
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">'
	+'<param name="movie" value="'+path+'" />'
	+'<param name="quality" value="high" />'
	+'<param name="menu" value="0" />'
	+'<param name="wmode" value="transparent" />'
	+'<param name="allowScriptAccess" value="sameDomain" />'
	+'<embed src="'+path+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="0" wmode="transparent" allowScriptAccess="sameDomain"></embed>'
	+'</object>');
}
function showPhoto(id, foto, lang)
{
	switch(lang)
	{
		case 'pl': var loadtext = 'Wczytywanie zdjęcia'; break;
		case 'en': var loadtext = 'Loading photo'; break;
		case 'de': var loadtext = 'Ladenfoto'; break;
		default: var loadtext = 'Wczytywanie zdjęcia'; break;
	}
	
	advAJAX.setDefaultParameters({
              onInitialization : function(obj) { document.getElementById(obj.tag).innerHTML = "Preparing..."; },
              onLoading : function(obj) { document.getElementById(obj.tag).innerHTML = '<div class=\"ajax_loader\"><img src="templates/stolplyt/images/loader.gif"><br>'+loadtext+'</div>'; },
              onSuccess : function(obj) { 
			  
			  	//var re = new RegExp('[^<]*<!', "gi");
	//var atxt = obj.responseText.match(re);
	//var conv = atxt.substring(0,-2);
	//var temp = new Array();
	//temp = atxt.split('@');
	//alert(temp[0]);
			  
			  //document.getElementById(obj.tag).innerHTML = '<img src="?mod=prod&act=generate&f='+foto+'_midi.jpg" border="0" style="padding: 2px; border: 1px solid #ffffff;"><br><br>';
			  document.getElementById(obj.tag).innerHTML = obj.responseText;
			  },
              onError : function(obj) { document.getElementById(obj.tag).innerHTML = "Error..."; }
            });
            advAJAX.get({ url: "?mod=prod&lang="+lang+"&id="+id+"&photo="+foto, tag: "PhotoBox" });
            advAJAX.setDefaultParameters({});
}

doPrint = function(co)
{
    toPrint("WÓJCIK", document.getElementById(co).innerHTML);
}

toPrint = function(title, content)
{
    
    content = content.replace('display: block','display: none');
    
    NewWindow=window.open("", "","width=800,height=600,toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=yes,resizable=no,fullscreen=no");
    NewWindow.document.open();

    NewWindow.document.writeln("<html>\n<head>\n</head>");
    NewWindow.document.writeln("<body leftmargin=\"10\" topmargin=\"10\" scroll=\"yes\" style=\"background-color:#ffffff; font-family: verdana; font-size: 11px;\" onload=\"print();\">");
    NewWindow.document.writeln("<title>Stolpłyt</title>");
    NewWindow.document.writeln("<style>");
    NewWindow.document.writeln("img { border: none; } table { font-family: arial; font-size: 11px; }");
    NewWindow.document.writeln("</style>");
    NewWindow.document.writeln("<table width=\"100%\"><tr><td><img src=\"templates/stolplyt/images/logo.gif\"></td></tr><tr><td>&nbsp;</td></tr><tr><td style=\"text-align: justify;\">");
    NewWindow.document.writeln(content);    
    NewWindow.document.writeln("</td></tr></table>");
    NewWindow.document.writeln("<br><br><hr size=\"1\" color=\"#e0e0e0\" style=\"background-color: #e0e0e0; width: 100%; height: 1px;\">");
    NewWindow.document.writeln("<table width=\"100%\"><tr><td>&copy; Stolpłyt. tel. +48 55 235 94 00</td></tr></table>");
    NewWindow.document.writeln("</body>\n</HTML>\n");
    NewWindow.document.close();
    NewWindow.focus();
}
