// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;


doPrint = function(co)
{
    toPrint("POSTĘP", 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: Arial, Helvetica, sans-serif; font-size: 12px;\" onload=\"print();\">");
    NewWindow.document.writeln("<title>Spółdzielnia Inwalidów \""+ title +"\"</title>");
    NewWindow.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"templates/default/style/style.css\">")
    NewWindow.document.writeln("<style>");
    NewWindow.document.writeln("img { border: none; } table { font-family: arial; font-size: 12px; }");
    NewWindow.document.writeln("</style>");
    NewWindow.document.writeln("<table width=\"100%\" cellspacing=\"0\"><tr><td><img src=\"templates/default/image/print_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=\"#825c0d\" style=\"background-color: #825c0d; width: 100%; height: 1px;\">");
    NewWindow.document.writeln("<table width=\"100%\"><tr><td>&copy; Spółdzielnia Inwalidów \"POSTĘP\", tel. 055 234 07 56.</td></tr></table>");
    NewWindow.document.writeln("</body>\n</html>\n");
    NewWindow.document.close();
    NewWindow.focus();
}

showPhoto = function(opis, foto, w, h)
{
    getPhoto("POSTĘP", document.getElementById(opis).innerHTML, document.getElementById(foto).innerHTML, w, h);
}

	var d = 0;
	var fota;

	function wstecz(arg){
	if (d > 0){
	d--
	arg.src = fota[d];
	}
	}

	function dalej(arg, ile){
	if (d < ile-1){
	d++
	arg.src = fota[d];
	//alert(d);
	}
	}

getPhoto = function(title, opis, foto, w, h)
{
    
	fota = foto.split(',');
	var ile = fota.length;
	

    NewWindow=window.open("", "","width="+w+",height="+h+",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=\"0\" topmargin=\"0\" scroll=\"yes\" style=\"background-color:#fff8e9; font-family: Arial, Helvetica, sans-serif; font-size: 12px;\">");
    NewWindow.document.writeln("<title>Spółdzielnia Inwalidów \""+ title +"\"</title>");
    NewWindow.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"templates/default/style/style.css\">")
    NewWindow.document.writeln("<style>");
    NewWindow.document.writeln("img { border: none; } table { font-family: arial; font-size: 12px; }");
    NewWindow.document.writeln("</style>");
    NewWindow.document.writeln("<table width=\"100%\" cellspacing=\"10\" align=\"center\"><tr><td align=\"center\">");
    NewWindow.document.writeln("<img id=\"obraz\" src=\""+fota[0]+"\"><br><br>");
	
	if(ile > 1 && (fota[1] != '' || fota[2] != '')) {
	
	NewWindow.document.writeln("<br><br><a href=\"javascript:window.opener.wstecz(document.getElementById('obraz'));\">&laquo; Poprzednie</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:window.opener.dalej(document.getElementById('obraz'), 3);\">Następne &raquo;</a>");
	
	} else {
	
	NewWindow.document.writeln("<br><br>");
	
	}
    NewWindow.document.writeln("</td></tr>");
	NewWindow.document.writeln("<tr><td>&nbsp;</td></tr>");
	NewWindow.document.writeln("<tr><td>"+opis+"</td></tr>");
	NewWindow.document.writeln("</table>");
    NewWindow.document.writeln("</body>\n</html>\n");
    NewWindow.document.close();
    NewWindow.focus();
}

PopUp = function(file,w,h)
{
var leftt = (screen.width-w)/2;
var topp = (screen.height-h)/2;
window.open(file, 'POSTĘP', 'width='+w+',height='+h+',top='+topp+',left='+leftt+',toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0');

}



Flash = function(w, h, path, alternate)
{
    
	if(!alternate) {
	var alternate = 'templates/default/image/no.gif';
	}
	
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {  // if we've detected an acceptable version
    var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="'+w+'" height="'+h+'"'
    + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="'+path+'">'
	+ '<param name="menu" value="false">'
	+ '<param name="quality" value="best">'
    + '<embed src="'+path+'" menu="false" quality="best" '
    + 'width="'+w+'" height="'+h+'" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';
    document.write(oeTags);   // embed the flash movie
  } else {  // flash is too old or we can't detect the plugin
    var alternateContent = '<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" target="_blank"><img src="'+alternate+'" width="'+w+'" height="'+h+'" title="Pobierz Flash Player" border="0"></a>';
    document.write(alternateContent);  // insert non-flash content
  }

}


Show_Layer = function(name)
{

/*with(divlayer){
display=display=='block'?'none':'block';
}*/

if(document.getElementById(name).style.display == 'none')
{
	document.getElementById(name).style.display = 'block';
} else {
	document.getElementById(name).style.display = 'none';
}

}



<!-- // Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 
// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 7r14 returns 7.14
// If called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}


function pokaz_submenu(x){
with(document.getElementById(x).style){
display=display=='none'?'block':'none';
}
}
