hex = new Array(8)
set = new Array(19)
set1 = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

hex[0] = "225CAB"      // Cor inicial
hex[1] = "356AB2"
hex[2] = "4878B9"
hex[3] = "5B86C0"
hex[4] = "6E94C7"
hex[5] = "81A2CE"
hex[6] = "94B0D5"
hex[7] = "A7BEDC"
hex[8] = "A7BEDD"      // Cor Final

function rollon(n)
{
   if (n==1){set[1]=1}
   if (n==2){set[2]=1}
   if (n==3){set[3]=1}
   if (n==4){set[4]=1}
   if (n==5){set[5]=1}
   if (n==6){set[6]=1}
   if (n==7){set[7]=1}
   if (n==8){set[8]=1}
   if (n==9){set[9]=1}
   if (n==10){set[10]=1}
   if (n==11){set[11]=1}
   if (n==12){set[12]=1}
   if (n==13){set[13]=1}
   if (n==14){set[14]=1}
   if (n==15){set[15]=1}
   if (n==16){set[16]=1}
   if (n==17){set[17]=1}
}

function rolloff(n)
{
   if (n==1){set[1]=0}
   if (n==2){set[2]=0}
   if (n==3){set[3]=0}
   if (n==4){set[4]=0}
   if (n==5){set[5]=0}
   if (n==6){set[6]=0}
   if (n==7){set[7]=0}
   if (n==8){set[8]=0}
   if (n==9){set[9]=0}
   if (n==10){set[10]=0}
   if (n==11){set[11]=0}
   if (n==12){set[12]=0}
   if (n==13){set[13]=0}
   if (n==14){set[14]=0}
   if (n==15){set[15]=0}
   if (n==16){set[16]=0}
   if (n==17){set[17]=0}
}

function color()
{
   if (set[1]==1)
   {
      if (set1[1]==8){} else{set1[1]++ ;item1.style.background = hex[set1[1]] }
   }
   else
   {
      if (set1[1]==0){} else{set1[1]=set1[1]-1 ;item1.style.background = hex[set1[1]] }
   }

   if (set[2]==1)
   {
      if (set1[2]==8){} else{set1[2]++ ;item2.style.background = hex[set1[2]] }
   }
   else
   {
      if (set1[2]==0){} else{set1[2]=set1[2]-1 ;item2.style.background = hex[set1[2]] }
   }

   if (set[3]==1)
   {
      if (set1[3]==8){} else{set1[3]++ ;item3.style.background = hex[set1[3]] }
   }
   else
   {
      if (set1[3]==0){} else{set1[3]=set1[3]-1 ;item3.style.background = hex[set1[3]] }
   }

   if (set[4]==1)
   {
      if (set1[4]==8){} else{set1[4]++ ;item4.style.background = hex[set1[4]] }
   }
   else
   {
      if (set1[4]==0){} else{set1[4]=set1[4]-1 ;item4.style.background = hex[set1[4]] }
   }

   if (set[5]==1)
   {
      if (set1[5]==8){} else{set1[5]++ ;item5.style.background = hex[set1[5]] }
   }
   else
   {
      if (set1[5]==0){} else{set1[5]=set1[5]-1 ;item5.style.background = hex[set1[5]] }
   }

   if (set[6]==1)
   {
      if (set1[6]==8){} else{set1[6]++ ;item6.style.background = hex[set1[6]] }
   }
   else
   {
      if (set1[6]==0){} else{set1[6]=set1[6]-1 ;item6.style.background = hex[set1[6]] }
   }

   if (set[7]==1)
   {
      if (set1[7]==8){} else{set1[7]++ ;item7.style.background = hex[set1[7]] }
   }
   else
   {
      if (set1[7]==0){} else{set1[7]=set1[7]-1 ;item7.style.background = hex[set1[7]] }
   }

   if (set[8]==1)
   {
      if (set1[8]==8){} else{set1[8]++ ;item8.style.background = hex[set1[8]] }
   }
   else
   {
      if (set1[8]==0){} else{set1[8]=set1[8]-1 ;item8.style.background = hex[set1[8]] }
   }

   if (set[9]==1)
   {
      if (set1[9]==8){} else{set1[9]++ ;item9.style.background = hex[set1[9]] }
   }
   else
   {
      if (set1[9]==0){} else{set1[9]=set1[9]-1 ;item9.style.background = hex[set1[9]] }
   }

   if (set[10]==1)
   {
      if (set1[10]==8){} else{set1[10]++ ;item10.style.background = hex[set1[10]] }
   }
   else
   {
      if (set1[10]==0){} else{set1[10]=set1[10]-1 ;item10.style.background = hex[set1[10]] }
   }

   if (set[11]==1)
   {
      if (set1[11]==8){} else{set1[11]++ ;item11.style.background = hex[set1[11]] }
   }
   else
   {
      if (set1[11]==0){} else{set1[11]=set1[11]-1 ;item11.style.background = hex[set1[11]] }
   }

   if (set[12]==1)
   {
      if (set1[12]==8){} else{set1[12]++ ;item12.style.background = hex[set1[12]] }
   }
   else
   {
      if (set1[12]==0){} else{set1[12]=set1[12]-1 ;item12.style.background = hex[set1[12]] }
   }

   if (set[13]==1)
   {
      if (set1[13]==8){} else{set1[13]++ ;item13.style.background = hex[set1[13]] }
   }
   else
   {
      if (set1[13]==0){} else{set1[13]=set1[13]-1 ;item13.style.background = hex[set1[13]] }
   }

   if (set[14]==1)
   {
      if (set1[14]==8){} else{set1[14]++ ;item14.style.background = hex[set1[14]] }
   }
   else
   {
      if (set1[14]==0){} else{set1[14]=set1[14]-1 ;item14.style.background = hex[set1[14]] }
   }

   if (set[15]==1)
   {
      if (set1[15]==8){} else{set1[15]++ ;item15.style.background = hex[set1[15]] }
   }
   else
   {
      if (set1[15]==0){} else{set1[15]=set1[15]-1 ;item15.style.background = hex[set1[15]] }
   }

   if (set[16]==1)
   {
      if (set1[16]==8){} else{set1[16]++ ;item16.style.background = hex[set1[16]] }
   }
   else
   {
      if (set1[16]==0){} else{set1[16]=set1[16]-1 ;item16.style.background = hex[set1[16]] }
   }

   if (set[17]==1)
   {
      if (set1[17]==8){} else{set1[17]++ ;item17.style.background = hex[set1[17]] }
   }
   else
   {
      if (set1[17]==0){} else{set1[17]=set1[17]-1 ;item17.style.background = hex[set1[17]] }
   }

   setTimeout("color()",50)
}

function ChangeLang (lang)
{
   var sURL, sCurrURL, sNewURL, Pos;

   sURL = window.location.href;

   // Verifica se a língua escolhida é a que está a ser visualizada
   sNewURL = '/' + lang + '/';
   Pos = sURL.lastIndexOf (sNewURL);
   if (Pos > 0)
       return;
   else
   {
      sCurrURL = '/pt/';
      Pos = sURL.lastIndexOf (sCurrURL);
      if (Pos > 0)
          sNewURL = sURL.replace (sCurrURL, sNewURL);

      sNewURL = '/en/';
      Pos = sURL.lastIndexOf (sNewURL);
      if (Pos > 0)
          sNewURL = sURL.replace (sNewURL, lang);

      window.navigate (sNewURL);
      return;
   }
}

function pmail(name, domain, display)
{
   displayed=(typeof(display)=="undefined") ? name+"@"+domain : display

   document.write('<a href=mailto:' + name + '@' + domain + '>' + displayed + '</a>');
}


// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '../images/visualpuc/thumb0_visualpuc.jpg'
Pic[1] = '../images/visualpuc/thumb1_visualpuc.jpg'
Pic[2] = '../images/visualpuc/thumb2_visualpuc.jpg'
Pic[3] = '../images/visualpuc/thumb3_visualpuc.jpg'
Pic[4] = '../images/visualpuc/thumb4_visualpuc.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

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)
}
