NS6 = ( document.getElementById && !document.all );
IE  = ( document.all );
NS  = ( navigator.appName == "Netscape" && navigator.appVersion.charAt(0) == "4" );

moving = setTimeout('null',1);

function moveOut() {
if (( NS6 && parseInt(ssm.left) < 0 ) || ( IE && ssm.style.pixelLeft < 0 ) || ( NS && document.ssm.left < 0 )) {
clearTimeout(moving);
moving = setTimeout('moveOut()', slideSpeed);

if ( NS6 ) {
ssm.left = parseInt(ssm.left) + 10 +"px";
}

if ( IE ) {
ssm.style.pixelLeft += 10;
}

if ( NS ) {
document.ssm.left += 10;
}
} else {
clearTimeout(moving);
moving = setTimeout('null', 1);
}
}

function moveBack() {
clearTimeout(moving);
moving = setTimeout('moveBack1()', waitTime);
}

function moveBack1() {
if (( NS6 && parseInt( ssm.left ) > ( -menuWidth )) || ( IE && ssm.style.pixelLeft > ( -menuWidth )) || ( NS && document.ssm.left > ( -menuWidth ))) {
clearTimeout(moving);
moving = setTimeout('moveBack1()', slideSpeed);

if ( NS6 ) {
ssm.left = parseInt(ssm.left) - 10 +"px";
}

if ( IE ) {
ssm.style.pixelLeft -= 10;
}

if ( NS ) {
document.ssm.left -= 10;
}
} else {
clearTimeout(moving);
moving = setTimeout('null', 1);
}
}

lastY = 0;
function makeStatic() {
if ( NS6 ) {
winY = window.pageYOffset;
}

if ( IE ) {
winY = document.body.scrollTop;
var NM = document.all('ssm').style;
}

if ( NS ) {
winY = window.pageYOffset;
var NM = document.ssm;
}

if ( NS6 || IE || NS ) {
if ( winY != lastY&&winY > YOffset - staticYOffset ) {
smooth = .2 * ( winY - lastY - YOffset + staticYOffset );
} else if ( YOffset - staticYOffset + lastY > YOffset - staticYOffset ) {
smooth = .2 * ( winY - lastY );
} else {
smooth = 0;
}

if ( smooth > 0 ) {
smooth = Math.ceil(smooth);
} else {
smooth = Math.floor(smooth);
}

if ( NS6 ) {
ssm.top = parseInt(ssm.top) + smooth +"px";
}

if ( IE ) {
NM.pixelTop += smooth;
}

if ( NS ) {
NM.top += smooth;
}

lastY = lastY+smooth;
setTimeout('makeStatic()', 1);
}
}

function init() {
if ( NS6 ) {
ssm = document.getElementById("ssm").style;
ssm.visibility = "visible";
ssm.left = -menuWidth;
} else if ( IE ) {
ssm.style.visibility = "visible";
ssm.style.pixelLeft = -menuWidth;
} else if ( NS ) {
document.ssm.left = -menuWidth;
document.ssm.visibility = "show";
}
if ( menuIsStatic == "yes") {
makeStatic();
}
}

function startMenu() {
if ( IE || NS6 ) {
document.write('<div id="ssm" style="visibility: hidden; position: absolute; top: '+ YOffset +'; left: 0px; z-index: 20; width: 1px" onmouseover="moveOut()" onmouseout="moveBack()">');
}
if ( NS ) {
document.write('<layer name="ssm" visibility="hide" top="'+ YOffset +'" left="0" onmouseover="moveOut()" onmouseout="moveBack()">');
}

document.write('<table border="0" cellspacing="0" cellpadding="0">'
// gorna krawedz grafiki
+ ' <tr>'
+ '    <td><img src="images/menupicu.gif" border="0" width="'+ menuWidth +'" height="12"></td>'
+ '    <td><img src="images/menupicur.gif" border="0" width="31" height="12"></td>'
+ ' </tr>'
+ '  <tr>'
+ '    <td bgcolor="'+ hdrBGColor +'" valign="top">'
// poczatek tabeli z linkami
+ '<table border="0" cellspacing="3" cellpadding="0" width="'+ menuWidth +'">');
}

function addItem(text, link, target) {
if ( !target ) {
target = linkTarget;
}
document.write('  <tr>'
+ '    <td align="center" bgcolor="'+ linkBGColor +'" onmouseover="bgColor=\''+ linkOverBGColor +'\'" onmouseout="bgColor=\''+ linkBGColor +'\'"><ilayer><layer width="100%" onmouseover="bgColor=\''+ linkOverBGColor +'\'" onmouseout="bgColor=\''+ linkBGColor +'\'"><tt>&nbsp;</tt><a href="'+ link +'" target="'+ target +'" onfocus="this.blur\(\)"><font style="font-family: Tahoma, Arial, Helvetica, sans-serif;text-decoration: none; font-size: 12px; font-weight: normal; color: white;">'+ text +'</font></a></layer></ilayer></td>'
+ '  </tr>');
}

function addHdr(text) {
document.write('  <tr align="center">'
+ '    <td height="'+ hdrHeight +'"><font color="white" style="font-size:12px;">'+ text +'</font></td>'
+ '  </tr>');
}
function endMenu() {
document.write('</td>'
+ '  </tr>'
+ '</table>'

// grafika na zakladke
// 
+ '</td>'
+ '    <td bgcolor="'+ hdrBGColor +'" valign="top"><img src="images/menupicm.gif" border="0" width="31" height="151"><br><img src="images/menupicm1t.gif" width="31" height="99" border="0" alt=""></td>'
+ '  </tr>'

// dolna krawedz grafiki
+ '  <tr>'
+ '    <td bgcolor="'+ hdrBGColor +'"><img src="images/menupicl.gif" border="0" width="'+ menuWidth +'" height="12"></td>'
+ '    <td><img src="images/menupiclr.gif" border="0" width="31" height="12"></td>'
+ '  </tr>'
+ '</table>');


if ( NS ) {
document.write('</layer>');
}

if ( IE || NS6 ) {
document.write('</div>');
}
}