    function switchPhotos() {
        var mainPhoto=document.getElementById("photomain");
        if (mainPhoto==null)
            return;
        
        var img = document.getElementById("photos").getElementsByTagName("img");        
        var image_med = new Array();
        var image_thumb = new Array();        
        
        for (i=0;i<img.length;i++) {
            
            var file = img[i].src.replace(/.+\/(.+\.jpg)/gi, "$1");
            
            image_med[i] = new Image();
            image_med[i].src = "foto-product/med/"+file;
            
            image_thumb[i] = new Image();
            image_thumb[i].src = "foto-product/thumb/"+file;
             
            if (img[i].id=="photomain")
                continue;
            
            var anchor = img[i].parentNode;
            anchor.f=anchor.href.replace(/.+\/(.+\.jpg)/gi, "$1");
            anchor.m=mainPhoto;
            anchor.href="javascript: //nop/"
            anchor.onclick=function() {
                var file = this.m.src.replace(/.+\/(.+\.jpg)/gi, "$1");
                anchor.m.src="foto-product/med/"+this.f; 
                this.childNodes[0].src ="foto-product/thumb/"+file;
                this.childNodes[0].style.display="inline";
                this.m.style.display="inline";
                this.f = file;
            
            }
        }
    }

var myTWin = window.myTWin;

function OpenMyWin(link,winName)
{
  var retValue=true;
  if (myTWin!=null && !myTWin.closed)
  {
    myTWin.focus();
    myTWin.location.href=link.href;
  }
  else
  {
    myTWin=window.open(link.href,winName);
    if (myTWin==null || typeof(myTWin)=="undefined")
      retValue=false;
    else
    {
      link.target=winName;
      myTWin.focus();
    }
  }
  return retValue;
}
            
