var ua = navigator.userAgent.toLowerCase(); 
var ns4 = (parseInt(ua.substring(ua.lastIndexOf('/')+1)) == 4 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var ns6 = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var ns7 = (parseInt(ua.substring(ua.lastIndexOf('/')+1)) == 7 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var ie4 = (document.all) ? 1 : 0;
var isMac = (navigator.appVersion.indexOf("Mac") != -1);
var aListed = 0
//
function hideLayer(name) {
 var layer = getLayer(name);
 if (document.layers)
  layer.visibility = "hide";
 if (document.all || ns6)
  layer.visibility = "hidden";
}
//
function clearLayer() {
 parent.bot_frame.layerWrite('Inf1',null,'') 
 if (parent.bot_frame.pMode==1) {
  parent.bot_frame.pMode=0
  parent.bot_frame.centraBotLayer(); 
 }
 parent.bot_frame.layerWrite('Inf1',null,'') 
 parent.bot_frame.layerWrite('dLyr',null,'<div id="eTab">...</div>') 
 parent.bot_frame.layerWrite('Img1',null,'') 

}
//
function Prev(ndx) {
 nArt=parent.bot_frame.nArt
 cArt=parent.bot_frame.cArt
 pCur=parent.bot_frame.pCur
 nPag=parent.bot_frame.nPag
 aListed=parent.bot_frame.aListed

 pCur = pCur-1
 if (pCur > 0) {
  parent.bot_frame.pCur=pCur;
  cArt=(eval(10*pCur)-10);
  setTimeout("dAlist(cArt)", 100 ) 
 }
 else { pCur=1; parent.bot_frame.pCur=1 }
}
//
function Next(ndx) {
 nArt=parent.bot_frame.nArt
 cArt=parent.bot_frame.cArt
 pCur=parent.bot_frame.pCur
 nPag=parent.bot_frame.nPag

 if ((cArt)<nArt) {
  parent.bot_frame.pCur=parent.bot_frame.pCur+1
  if (parent.bot_frame.pCur>nPag){parent.bot_frame.pCur=nPag}
  setTimeout("dAlist(cArt)", 100 );
 }
}
//
function chgGall(nImg,ndx,aPos) {
 iPath=parent.bot_frame.iPath
 sName=parent.bot_frame.sName
 parent.bot_frame.iName=nImg
 var pImg=iPath
 if (ndx==1){pImg=iPath+'galleria%5C'+iName}
 if (ndx==2){pImg=unescape(iPath+'mostre%5C'+sName+'%5C'+nImg)}
 iW=400; iH=400; resMode=5
 setTimeout("parent.bot_frame.layerWrite('Inf2',null,'<center>Attendere caricamento in corso...</center>')", 50 );
 if (screen.width < 850) {iW=335; iH=335; resMode=6;}
 hCd1=''
 hCd1=hCd1 + '<table cellspacing="0" cellpadding="0"><tr><td width="' + iW + '" height="' + iH + '" align="center" valign="middle" nowrap >'
 hCd1=hCd1 + '<A href="#" onclick="enlargeImage(0,' + ndx + '); return false" onfocus="blur()"><img src="sendbinary.asp?path='
 hCd1=hCd1 + pImg + '&resMode=' + resMode + '" border="0" alt="click to enlarge image" ></a></td></tr></table>'
 setTimeout("parent.bot_frame.layerWrite('Img1',null,hCd1)",200);

 if (aPos>0) {
  sList = parent.bot_frame.sList
  i=aPos
  infTxt=unescape('<div align=' + '%22' + 'center' + '%22' + '>' + sList[0][i] + '</div>')
  setTimeout("parent.bot_frame.layerWrite('Inf2',null,infTxt)", 400 );  
 }

}
//
function to_Artist(idArt, aPos) {
 nArt=parent.bot_frame.nArt; parent.bot_frame.pMode=1; aList=parent.bot_frame.aList
 setTimeout("parent.bot_frame.layerWrite('Inf2',null,'<center>Attendere caricamento in corso...</center>')", 50 );
 setTimeout("parent.bot_frame.repos_lAut(-10000)", 100 );
 tW=130; cSpac=3;  if (screen.width < 850 ) {tW=100; cSpac=2}
 hCd= '<table id="tItem" width="' + tW + '" border="0" cellspacing="0" cellpadding="' + cSpac + '">'
 if (lMovd==0) {
 parent.bot_frame.lMovd=1
 parent.bot_frame.iMenu=1

 setTimeout("parent.bot_frame.layerWrite('Inf2',null,'<center>Attendere caricamento in corso...</center>')", 50 );
 setTimeout("parent.bot_frame.layerWrite('Inf1',null,'')", 100 );
  setTimeout("parent.bot_frame.spostaBotLayer()",200);
 //setTimeout("parent.bot_frame.display_Scroll()",250);
 setTimeout("parent.top_frame.spostaTopLayer()",300);


  for (i = 0; i < aList.length; i++) {
   hCd=hCd+'<tr><td align="right"  valign="top">'
   hCd=hCd+'<a class="L3" href="" onclick="to_Artist(' + aList[i][2] + ',' +  i  + '); return false" onfocus="blur()">' + aList[i][4] + '</a><br>'
   hCd=hCd+'<a class="L2" href="" onclick="to_Artist(' + aList[i][2] + ',' +  i  + '); return false" onfocus="blur()">' + aList[i][0] + '</a></td>' 
   hCd=hCd+'<td width="12" align="right" valign="middle" nowrap>'
   hCd=hCd+'<a href="" onclick="to_Artist(' + aList[i][2] + ',' + i + '); return false" onfocus="blur()"><img src="images/dot3_off.gif" border="0" align="absmiddle" /></a>'
   hCd=hCd+'</td></tr>'
  }
  //
  hCd=hCd+'</table>'

  var delay=0
  if (ie4) { if (isMac){delay=700}}
  delay = 500 + delay
  setTimeout("parent.bot_frame.layerWrite('tAut', 'Auth', hCd) ",delay); 
  setTimeout("parent.bot_frame.initLyrs(1)",1500);
 }

 iArt=idArt
 parent.bot_frame.iArt=iArt
 parent.bot_frame.aPos=aPos

 param = '?iArt=' + iArt + '&aPos=' + aPos 

 
 var delay=0
 if (ie4) { if (isMac){delay=500}}
 delay = 1000 + delay
 setTimeout("parent.exe_frame.location='dArt_ita.asp' + param ",delay);

}
//
function display_aInfo(ndx){
 i=ndx
 parent.top_frame.to_aInfo(i)
}
//
function maxImg() {
 iW = 700; iH = 700
 if (screen.width < 850 ) {iW = 540; iH = 540}
 iPath=parent.bot_frame.iPath
 iName=parent.bot_frame.iName

 URL = 'imgFull.asp?iName=' + iPath + iName + '&iW=' + iW + '&iH=' + iH
 sPos='width='+iW+',height='+iH+',left=0,top=0,toolbar=no,status=no,resizable=no,scrollbars=no'
 remote = open(URL, "remote", sPos);
}
