ns6=document.getElementById&&!document.all?1:0
ie=document.all?1:0
NN=(document.layers ? true : false);
hideName=(NN ? 'hide' : 'hidden');
showName=(NN ? 'show' : 'visible');
zIdx=-1;

function genLayer(sName, sLeft, sTop, sWdh, sHgt, sVis, sBg, copy) {
	if (NN) {document.write('<LAYER '+((sName)?' NAME='+sName:"")+((sLeft)?' left='+sLeft:"")+((sTop)?' top='+sTop:"")+((sWdh)?' width='+sWdh:"")+((sHgt)?' height='+sHgt:"")+ ((sVis)?' visibility='+sVis:"")+((sBg)?' bgColor='+sBg:"")+' z-Index='+zIdx+'>'+((copy)?copy:"")+'</LAYER>');}
	else {document.write('<DIV '+((sName)?' id='+sName:"")+' STYLE="position:absolute;' +((sLeft)?'left:'+sLeft+';':'')+((sTop)?'top:'+sTop+';':'')+((sLeft)?'left:'+sLeft+';':'')+((sWdh)?'width:'+sWdh+';':'')+((sHgt)?'height:'+sHgt+';':'')+((sVis)?'visibility:'+sVis+';':'')+((sBg)?'background:'+sBg+';':'')+' " z-Index='+zIdx+'>'+((copy)?copy:"")+'</DIV>');}
}
function colSlide(name,newCol) {
	if (NN) {refSlide(name).bgColor=newCol}
	else{refSlide(name).background=newCol}
	}
function hideSlide(name) {
	refSlide(name).visibility = hideName;
}
function showSlide(name) {
	refSlide(name).visibility = showName;
}
function refSlide(name) {
	if (pos=="rel" && NN) { return document.ilayer1.document.layers[name]}
	if (NN) { return document.layers[name]; }
	if (ns6) {return document.getElementById(name).style}
	if(ie){ return eval('document.all.' + name + '.style'); }
}
function moveSlide(name,sLeft, sTop) {
	refSlide(name).left=sLeft ; refSlide(name).top=sTop ;
}

widImg=0
for (i=0; i<imgs.length; i++){widImg=widImg+widImgs[i]}

if(pos=="rel" && NN){document.write("<ilayer id='ilayer1'>")}
else{if(pos=="rel"){document.write("<div style='position:relative;left:0;top:0;height:"+bgh+";width:"+bgw+"'>")}}

genLayer("bg1", 0, 0, bgw, bgh, showName,"", "<a href="+addrUrl+"><img width="+bgw+" height="+bgh+" src="+bgImg+" "+altTxt+" border=0></a>")

for(i=0;i<nPix;i++){genLayer("n"+i, 0, 0, 1, 1, showName,"#000000", "<img src='"+pathImgs+"1x1.gif' width=1 height=1>")}

leftCopy=leftImgs

for (i=0; i<imgs.length; i++){genLayer("r"+i, leftImgs, topImgs, widImgs[i], heiImgs, hideName,"", "<a href="+addrUrl+"><img src='"+pathImgs+imgs[i]+".gif'"+altTxt+" border=0></a>");leftImgs=leftImgs+widImgs[i]}

function risun()
{
i=0
if(pos=="rel" && NN){ tim2=window.setInterval("risun2()",20)}
else {tim2=window.setInterval("risun2()",5)}
}

nris=0
nps=0
xris=0

function risun2()
{
  b=cod_m.substring(i,i+1)
if (b=="#"){ncolors="#"+col0}
if (b=="X"){ncolors="#"+col1}
if (b=="Y"){ncolors="#"+col2}
if (b=="Z"){ncolors="#"+col3}

  if (b=="#"||b=="X"||b=="Y"||b=="Z"){x=cod_m.substring(i+1,i+4)*1;y=cod_m.substring(i+4,i+7)*1;i=i+6}
  else{
b_=parseInt(b,36)
if (b_>0){ncolors="#"+col0}
if (b_>8){ncolors="#"+col1}
if (b_>16){ncolors="#"+col2}
if (b_>24){ncolors="#"+col3}

  if (b=="1"||b=="9"||b=="H"||b=="P"){y=y-1}
  if (b=="2"||b=="A"||b=="I"||b=="Q"){y=y-1;x=x+1}
  if (b=="3"||b=="B"||b=="J"||b=="R"){x=x+1}
  if (b=="4"||b=="C"||b=="K"||b=="S"){y=y+1;x=x+1}
  if (b=="5"||b=="D"||b=="L"||b=="T"){y=y+1}
  if (b=="6"||b=="E"||b=="M"||b=="U"){y=y+1;x=x-1}
  if (b=="7"||b=="F"||b=="N"||b=="V"){x=x-1}
  if (b=="8"||b=="G"||b=="O"||b=="W"){y=y-1;x=x-1}
  }
  i=i+1
  if(x>=widImgs[nris]+xris){xris=widImgs[nris]+xris;showSlide("r"+nris); nris=nris+1}
  colSlide("n"+nps,ncolors)
  moveSlide("n"+nps,x+leftCopy,y+topImgs);nps=nps+1
  if(nps==nPix){nps=0}
  if(i>cod_m.length-1){
clearInterval(tim2);showSlide("r"+nris);cod_m=""
if(NN){}
if(ie){
for(i=0;i<nPix;i++){document.all["n"+i].outherHTML=""}
for(i=0;i<nPix;i++){document.all["n"+i].id="n"}
}
if(ns6){
for(i=0;i<nPix;i++){document.getElementById("n"+i).outherHTML=""}
for(i=0;i<nPix;i++){document.getElementById("n"+i).id="n"}
}

varlog()

}
}

if(pos=="rel" && NN){document.write("</ilayer>")}
else {if(pos=="rel"){document.write("</div>")}}

tim3=window.setTimeout("risun()",5000)

