
var restoreimgsrc="";

function MMon(p){
restoreimgsrc = document.images[p].src;
document.images[p].src=restoreimgsrc.substring(0,restoreimgsrc.length-4)+"_on.gif";
}
function MMof(p){
 document.images[p].src=restoreimgsrc;
}

function Pagelocation(page) {
 if (page.indexOf("/")>=0 ) document.location = page;
}

function openwind(page,wdparms) {
 //wdparms = 'width=500,height=500,scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes';
 window.open( page,'',wdparms );
}

function newwin(page,theWidth, theHeight) {
 var page=page;
 new_window = open(page,"displayWindow","width="+theWidth+", height="+theHeight+", scrollbars=yes, resizable=no");

// Text of the new document
// Replace your " with ' or \" or your document.write statements will fail

}

function foto(page,dir,theWidth, theHeight) {
 var index=page;
 var path=dir;
 new_window = open("foto.php?index="+page+"&path="+dir,"displayWindow","width="+theWidth+", height="+theHeight+", resizable=no");

// Text of the new document
// Replace your " with ' or \" or your document.write statements will fail

}


Brname=navigator.appName;
Brver=parseFloat(navigator.appVersion);
changes=false;
if(Brname=="Netscape" && Brver >= 6) changes= true;
if(Brname=="Microsoft Internet Explorer" && Brver >= 4) changes= true;

this.ver=navigator.appVersion;
ver5 =document.getElementById?1:0;
ie =(this.ver.indexOf("MSIE")>-1 )?1:0;

function OnMouse(id) {
  OffMouse();
  xMousePos = window.event.x;
  yMousePos = window.event.y;
  if (ver5){
     obj= document.getElementById(id);
     if (obj){
                 document.getElementById(id).style.left = xMousePos;
                document.getElementById(id).style.top = yMousePos;
        document.getElementById(id).style.visibility = "visible";
     }
  }
  else {
    if (ie){
           document.all[id].style.left = xMousePos;
           document.all[id].style.top = yMousePos;
           document.all[id].style.visibility = "visible";
           }
    else {
                        document.layers[id].left= xMousePos;
            document.layers[id].top= yMousePos;
            document.layers[id].visibility = "show";
    }
  }
}

function OffMouse() {
  var all= new Array("pils_3","pils_4","sav_1","sav_2");
    for(i=0; i<4; i++) {
        id=all[i];
  if (ver5){
     obj= document.getElementById(id);
     if (obj){
        document.getElementById(id).style.visibility = "hidden";
     }
  }
  else {
    if (ie){
       document.all[id].style.visibility = "hidden";
           }
    else {
            document.layers[id].visibility = "hide";
    }
  }
  }
}
 function showimagenew(dir, nr) {
     document.getElementById('big').src = 'image/upload/pilsetas-majas-2008/'+dir+'/'+nr+'st.JPG';
 }
