function align(){
w=window.screen.width;
marg=0;
if(w>1024){marg=(w-1024)/2;}

document.getElementById("strana").style.left=marg+"px";
}

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
      	node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
        }
			}
		}
	}
}
//window.onload=startList;


function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}

function big_img(img_id){
  img= new Image();
  img.src="../getdata.php?id="+img_id;
  Controlla(img_id);
  }
function Controlla(img_id){
  if((img.width!=0)&&(img.height!=0)){
    viewFoto(img_id);
  }
  else{
    funzione="Controlla('"+img_id+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img_id){
  largh=img.width+10;
  altez=img.height+15;
  stringa="width="+largh+",height="+altez;
  finestra=window.open("../getimage.php?id="+img_id,"",stringa);
}

function gallery(img){
  info=window.open("display.htm","","width=150 height=80 left=350 top=300");
  image= new Image();
  image.src=(img);  
  Controll(img);  
  }
function Controll(img){
  if((image.width!=0)&&(image.height!=0)){
    view_Foto(img);
  }
  else{
    funzione="Controll('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function view_Foto(img){
  wid=image.width+20;
  hig=image.height+60;
  y_pos=image.height;
  x_pos=image.width;
  stringa="width="+wid+",height="+hig;
  finestra=window.open("display.htm","",stringa);
  finestra.document.write("<body bgcolor=\"#A4A4A4\">");
  finestra.document.write("<div id='popup' style=\"position:absolute;background:#A4A4A4 url("+img+") no-repeat top left; width:"+wid+";height:"+hig+";\"><br/>");
  finestra.document.write("<span style=\"position:absolute;top:"+y_pos+";width:"+x_pos+";font-size:16px;color:white;text-align:right;z-index:5\">");
  finestra.document.write("</span></div>");
  info.close();
}