function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Show ( do_show, nazwa) {
  if (document.getElementById) {

        for (var ii = 1; ii < 30; ii++) {
  	       if (document.getElementById("strona_"+ii) != null) document.getElementById("strona_"+ii).style.display="none";
	       if (document.getElementById("strona_TD"+ii) != null) document.getElementById("strona_TD"+ii).className="ic-grey";
  	       if (document.getElementById("stron2_"+ii) != null) document.getElementById("stron2_"+ii).style.display="none";
	       if (document.getElementById("stron2_TD"+ii) != null) document.getElementById("stron2_TD"+ii).className="ic-grey";
  	       if (document.getElementById("stron3_"+ii) != null) document.getElementById("stron3_"+ii).style.display="none";
	       if (document.getElementById("stron3_TD"+ii) != null) document.getElementById("stron3_TD"+ii).className="ic-grey";
        }

//        for (var ii = 1; ii < 30; ii++) {
//	    if (document.getElementById(nazwa+ii) != null) document.getElementById(nazwa+ii).style.display="none";
//	    if (document.getElementById(nazwa+"TD"+ii) != null) document.getElementById(nazwa+"TD"+ii).className="ic-grey";
//        }
	if (document.getElementById(do_show) != null) document.getElementById(do_show).style.display="";
	if (document.getElementById(nazwa+"TD"+do_show.substring(7,9)) != null) document.getElementById(nazwa+"TD"+do_show.substring(7,9)).className="ic-grey2";
  } else {
        for (var ii = 1; ii < 30; ii++) {
            if (document.document.all["strona_"+ii] != null) document.all["strona_"+ii].style.display="none";
     	    if (document.document.all["strona_TD"+ii] != null) document.all["strona_TD"+ii].className="ic-grey";
            if (document.document.all["stron2_"+ii] != null) document.all["stron2_"+ii].style.display="none";
     	    if (document.document.all["stron2_TD"+ii] != null) document.all["stron2_TD"+ii].className="ic-grey";
            if (document.document.all["stron3_"+ii] != null) document.all["stron3_"+ii].style.display="none";
     	    if (document.document.all["stron3_TD"+ii] != null) document.all["stron3_TD"+ii].className="ic-grey";
        }
        if (document.document.all[do_show] != null) document.all[do_show].style.display="";
        if (document.document.all[nazwa+"TD"+do_show.substring(7,9)] != null) document.all[nazwa+"TD"+do_show.substring(7,9)].className="ic-grey2";
  };
// if ( navigator.userAgent.toLowerCase().indexOf("mozilla") != -1) {
}

function ShowSmall ( do_show, nazwa) {
  if (document.getElementById) {

    for (var ii = 1; ii < 15; ii++) {
	    if (document.getElementById(nazwa+ii) != null) document.getElementById(nazwa+ii).style.display="none";
    }
	if (document.getElementById(do_show) != null) document.getElementById(do_show).style.display="";
  } else {
        for (var ii = 1; ii < 15; ii++) {
            if (document.document.all[nazwa+ii] != null) document.all[nazwa+ii].style.display="none";
        }
        if (document.document.all[do_show] != null) document.all[do_show].style.display="";
  };
// if ( navigator.userAgent.toLowerCase().indexOf("mozilla") != -1) {
}


function Restart ( nazwa) {

  var param=""+window.location.search; // force to string
  if (param.length!=0) {param=param.substring(5);} 
  else { param="1" }// omit the leading "?"

//  eval("var "+param);
  if (document.getElementById) {
	    if (document.getElementById(nazwa+param) != null) document.getElementById(nazwa+param).style.display="";
	    if (document.getElementById(nazwa+"TD"+param) != null) document.getElementById(nazwa+"TD"+param).className="ic-grey2";
  } else {
        if (document.document.all[nazwa+param] != null) document.all[nazwa+param].style.display="";
        if (document.document.all[nazwa+"TD"+param] != null) document.all[nazwa+"TD"+param].className="ic-grey2";
  };
}

function test_set( nazwa, nazwa_szukana) {
                   var ile = 0;
                   for (var ii = 0; ii < document.tabelka.elements.length-1; ii++) {
                     if (document.tabelka.elements[ii].name.indexOf( nazwa_szukana) >= 0 ) {
//&& document.tabelka.elements[ii].checked
                         ile++;
                     }
                   }
alert(ile+'ssssssssss'+document.tabelka.elements.length);
/*
                   if (ile==0) {
                       for (var i = 0; i < document.tabelka.elements.length-1; i++) {
                            if (document.tabelka.elements[i].name.indexOf( nazwa) >= 0) {
                                document.tabelka.elements[i].checked = true;
                            };
                       };
                   };
*/
         return;
}

function filename1()
{
var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
var period = location.href.lastIndexOf('.');
var file = location.href.substring(dir.length,period);
return file;
}

function photo()
{
document.write('<img class="photo" src="../images/prod/'+filename1()+'.jpg">')
}

function datshe()
{
document.write('Data sheets')
}

var base= "images/graphics/"
var nrm = new Array();
var omo = new Array();
var stuff = new Array('left','right');
// Pre-load part
if (document.images)
{
	for (i=0;i<stuff.length;i++)
	{
		nrm[i] = new Image;
		nrm[i].src = base + stuff[i] + ".gif"
		omo[i] = new Image;
		omo[i].src = base + stuff[i] + "_mo.gif";
	}
}
// The functions: first mouseover, then mouseout
function over(no)
{
	if (document.images)
	{
		document.images[stuff[no]].src = omo[no].src
	}
}
function out(no)
{
	if (document.images)
	{
		document.images[stuff[no]].src = nrm[no].src
	}
}

function popup(MyURL,H,W,scroll) {
windowprops = "width="+W+",height="+H+",dependent=yes,scrollbars="+scroll+",resizable=yes";
window.open(MyURL,'popup',windowprops);
}
