doPrint = function(co)
{
    toPrint("KRISMAR", document.getElementById(co).innerHTML);
}

toPrint = function(title, content)
{
    content = content.replace('display: none','display: block');
    
    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: arial; font-size: 12px; line-height: 150%;\" onload=\"print();\">");
    NewWindow.document.writeln("<title>"+ title +"</title>");
    NewWindow.document.writeln("<style>");
    NewWindow.document.writeln("img { border: none; } table { font-family: arial; font-size: 12px; line-height: 150%; }");
    NewWindow.document.writeln("</style>");
    NewWindow.document.writeln("<table width=\"100%\"><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=\"#666666\" style=\"background-color: #e0e0e0; width: 100%; height: 1px;\">");
    NewWindow.document.writeln("<table width=\"100%\"><tr><td>&copy; KRISMAR.</td></tr></table>");
    NewWindow.document.writeln("</body>\n</html>\n");
    NewWindow.document.close();
    NewWindow.focus();
}

function jsGET(type)
{
	if(location.href.match(type))
	{
		return location.href.split(type+'=')[1].split('&')[0];
	}
}

function loadTxt()
{
	var lang = jsGET('lang');
				
	switch(lang)
	{
		case 'pl': return 'Wczytywanie zdjęcia'; break;
		case 'en': return 'Loading photo'; break;
		case 'de': return 'Ladenfoto'; break;
		case 'ru': return 'Фотоий нагрузки'; break;
		default: return 'Wczytywanie zdjęcia'; break;
	}
}

function flash(path, w, h)
{ 
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">'
	+'<param name="allowScriptAccess" value="sameDomain" />'
	+'<param name="movie" value="'+path+'" />'
	+'<param name="menu" value="false" />'
	+'<param name="quality" value="best" />'
	+'<param name="wmode" value="opaque" />'
	+'<embed src="'+path+'" menu="false" quality="best" wmode="opaque" width="'+w+'" height="'+h+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
	+'</object>');
}

function showPhoto(id, foto)
{
	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/default/image/loader.gif"><br>'+loadTxt()+'</div>';			  
			  },
              onSuccess : function(obj) { 
			  document.getElementById(obj.tag).innerHTML = obj.responseText;
			  },
              onError : function(obj) { document.getElementById(obj.tag).innerHTML = "Error..."; }
            });
            advAJAX.get({ url: "?mod=prod&id="+id+"&photo="+foto+"&lang="+jsGET('lang'), tag: "PhotoBox" });
            advAJAX.setDefaultParameters({});
}

function SwitchBlock(x)
{
	with(document.getElementById(x).style)
	{
		display=display=='none'?'block':'none';
	}
}

function ToogleList(x)
{
	with(document.getElementById(x).style)
	{
		display=display=='none'?'block':'none';
	}
}