//DEFINE ALL IMAGE PATHS IN THE IMAGE POOL
var imagepool=new Array()
imagepool[0]="grafica/foto_home1.jpg";
imagepool[1]="grafica/foto_home2.jpg";
imagepool[2]="grafica/foto_home3.jpg";
imagepool[3]="grafica/foto_home4.jpg";
imagepool[4]="grafica/foto_home5.jpg";
imagepool[5]="grafica/foto_home7.jpg";
imagepool[6]="grafica/foto_home8.jpg";
imagepool[7]="grafica/foto_home10.jpg";
imagepool[8]="grafica/foto_home11.jpg";
imagepool[9]="grafica/foto_home12.jpg";
imagepool[10]="grafica/foto_home13.jpg";
imagepool[11]="grafica/foto_home14.jpg";
imagepool[12]="grafica/foto_home15.jpg";
imagepool[13]="grafica/foto_home16.jpg";
imagepool[14]="grafica/foto_home17.jpg";
imagepool[15]="grafica/foto_home18.jpg";
imagepool[16]="grafica/foto_home19.jpg";
imagepool[17]="grafica/foto_home20.jpg";
imagepool[18]="grafica/foto_home21.jpg";
imagepool[19]="grafica/foto_home22.jpg";
imagepool[20]="grafica/foto_home23.jpg";
imagepool[21]="grafica/foto_home24.jpg";
imagepool[22]="grafica/foto_home25.jpg";
imagepool[23]="grafica/foto_home26.jpg";
imagepool[24]="grafica/foto_home27.jpg";
imagepool[25]="grafica/foto_home28.jpg";
imagepool[26]="grafica/foto_home29.jpg";
imagepool[27]="grafica/foto_home30.jpg";
imagepool[28]="grafica/foto_home31.jpg";
imagepool[29]="grafica/foto_home32.jpg";
imagepool[30]="grafica/foto_home33.jpg";
imagepool[31]="grafica/foto_home34.jpg";
imagepool[32]="grafica/foto_home35.jpg";
imagepool[33]="grafica/foto_home36.jpg";
imagepool[34]="grafica/foto_home37.jpg";
imagepool[35]="grafica/foto_home38.jpg";
imagepool[36]="grafica/foto_home39.jpg";
imagepool[37]="grafica/foto_home40.jpg";
imagepool[38]="grafica/foto_home41.jpg";
imagepool[39]="grafica/foto_home42.jpg";
imagepool[40]="grafica/foto_home43.jpg";
imagepool[41]="grafica/foto_home44.jpg";
imagepool[42]="grafica/foto_home45.jpg";
imagepool[43]="grafica/foto_home46.jpg";
imagepool[44]="grafica/foto_home47.jpg";
imagepool[45]="grafica/foto_home48.jpg";
imagepool[46]="grafica/foto_home49.jpg";
imagepool[47]="grafica/foto_home50.jpg";
imagepool[48]="grafica/foto_home51.jpg";
imagepool[49]="grafica/foto_home52.jpg";
imagepool[50]="grafica/foto_home53.jpg";
imagepool[51]="grafica/foto_home54.jpg";
imagepool[52]="grafica/foto_home55.jpg";
imagepool[53]="grafica/foto_home56.jpg";
imagepool[54]="grafica/foto_home57.jpg";
imagepool[55]="grafica/foto_home58.jpg";
imagepool[56]="grafica/foto_home59.jpg";
imagepool[57]="grafica/foto_home60.jpg";
imagepool[58]="grafica/foto_home61.jpg";
imagepool[59]="grafica/foto_home62.jpg";
imagepool[60]="grafica/foto_home63.jpg";
imagepool[61]="grafica/foto_home64.jpg";
imagepool[62]="grafica/foto_home65.jpg";
imagepool[63]="grafica/foto_home66.jpg";
imagepool[64]="grafica/foto_home67.jpg";
imagepool[65]="grafica/foto_home68.jpg";
imagepool[66]="grafica/foto_home69.jpg";
imagepool[67]="grafica/foto_home70.jpg";
imagepool[68]="grafica/foto_home71.jpg";
imagepool[69]="grafica/foto_home72.jpg";
imagepool[70]="grafica/foto_home73.jpg";
imagepool[71]="grafica/foto_home74.jpg";
imagepool[72]="grafica/foto_home75.jpg";
imagepool[73]="grafica/foto_home76.jpg";
imagepool[74]="grafica/foto_home77.jpg";
imagepool[75]="grafica/foto_home78.jpg";
imagepool[76]="grafica/foto_home79.jpg";
imagepool[77]="grafica/foto_home80.jpg";
imagepool[78]="grafica/foto_home81.jpg";
imagepool[79]="grafica/foto_home82.jpg";
imagepool[80]="grafica/foto_home83.jpg";
imagepool[81]="grafica/foto_home84.jpg";
imagepool[82]="grafica/foto_home85.jpg";
imagepool[83]="grafica/foto_home86.jpg";
imagepool[84]="grafica/foto_home87.jpg";
imagepool[85]="grafica/foto_home88.jpg";
imagepool[86]="grafica/foto_home89.jpg";
imagepool[87]="grafica/foto_home90.jpg";
imagepool[88]="grafica/foto_home91.jpg";
imagepool[89]="grafica/foto_home92.jpg";
imagepool[90]="grafica/foto_home93.jpg";
imagepool[91]="grafica/foto_home94.jpg";
imagepool[92]="grafica/foto_home95.jpg";
imagepool[93]="grafica/foto_home96.jpg";
imagepool[94]="grafica/foto_home97.jpg";
imagepool[95]="grafica/foto_home98.jpg";
imagepool[96]="grafica/foto_home99.jpg";
imagepool[97]="grafica/foto_home100.jpg";
imagepool[98]="grafica/foto_home101.jpg";
imagepool[99]="grafica/foto_home102.jpg";
imagepool[100]="grafica/foto_home103.jpg";
imagepool[101]="grafica/foto_home104.jpg";
imagepool[102]="grafica/foto_home105.jpg";
imagepool[103]="grafica/foto_home106.jpg";
imagepool[104]="grafica/foto_home107.jpg";
imagepool[105]="grafica/foto_home108.jpg";
imagepool[106]="grafica/foto_home109.jpg";
imagepool[107]="grafica/foto_home110.jpg";
imagepool[108]="grafica/foto_home111.jpg";
imagepool[109]="grafica/foto_home112.jpg";
imagepool[110]="grafica/foto_home113.jpg";
imagepool[111]="grafica/foto_home114.jpg";
imagepool[112]="grafica/foto_home115.jpg";
imagepool[113]="grafica/foto_home116.jpg";
imagepool[114]="grafica/foto_home117.jpg";
imagepool[115]="grafica/foto_home118.jpg";
imagepool[116]="grafica/foto_home119.jpg";
imagepool[117]="grafica/foto_home120.jpg";
imagepool[118]="grafica/foto_home121.jpg";
imagepool[119]="grafica/foto_home122.jpg";
imagepool[120]="grafica/foto_home123.jpg";
imagepool[121]="grafica/foto_home124.jpg";
imagepool[122]="grafica/foto_home125.jpg";
imagepool[123]="grafica/foto_home126.jpg";
imagepool[124]="grafica/foto_home127.jpg";
imagepool[125]="grafica/foto_home128.jpg";
imagepool[126]="grafica/foto_home129.jpg";
imagepool[127]="grafica/foto_home130.jpg";
imagepool[128]="grafica/foto_home131.jpg";
imagepool[129]="grafica/foto_home132.jpg";
imagepool[130]="grafica/foto_home133.jpg";
imagepool[131]="grafica/foto_home134.jpg";
imagepool[132]="grafica/foto_home135.jpg";
imagepool[133]="grafica/foto_home136.jpg";
imagepool[134]="grafica/foto_home137.jpg";
imagepool[135]="grafica/foto_home138.jpg";
imagepool[136]="grafica/foto_home139.jpg";
imagepool[137]="grafica/foto_home140.jpg";
imagepool[138]="grafica/foto_home141.jpg";
imagepool[139]="grafica/foto_home142.jpg";
imagepool[140]="grafica/foto_home143.jpg";
imagepool[141]="grafica/foto_home144.jpg";
imagepool[142]="grafica/foto_home145.jpg";
imagepool[143]="grafica/foto_home146.jpg";
imagepool[144]="grafica/foto_home147.jpg";
imagepool[145]="grafica/foto_home148.jpg";
imagepool[146]="grafica/foto_home149.jpg";
imagepool[147]="grafica/foto_home150.jpg";
imagepool[148]="grafica/foto_home151.jpg";
imagepool[149]="grafica/foto_home152.jpg";
imagepool[150]="grafica/foto_home153.jpg";
imagepool[151]="grafica/foto_home154.jpg";
imagepool[152]="grafica/foto_home155.jpg";
imagepool[153]="grafica/foto_home156.jpg";
imagepool[154]="grafica/foto_home157.jpg";
imagepool[155]="grafica/foto_home158.jpg";
imagepool[156]="grafica/foto_home159.jpg";
imagepool[157]="grafica/foto_home160.jpg";
imagepool[158]="grafica/foto_home161.jpg";
imagepool[159]="grafica/foto_home162.jpg";
imagepool[160]="grafica/foto_home163.jpg";
imagepool[161]="grafica/foto_home164.jpg";
imagepool[162]="grafica/foto_home165.jpg";
imagepool[163]="grafica/foto_home166.jpg";
imagepool[164]="grafica/foto_home167.jpg";
imagepool[165]="grafica/foto_home168.jpg";
imagepool[166]="grafica/foto_home169.jpg";
imagepool[167]="grafica/foto_home170.jpg";
imagepool[168]="grafica/foto_home171.jpg";
imagepool[169]="grafica/foto_home172.jpg";
imagepool[170]="grafica/foto_home173.jpg";
imagepool[171]="grafica/foto_home174.jpg";
imagepool[172]="grafica/foto_home175.jpg";
imagepool[173]="grafica/foto_home176.jpg";
imagepool[174]="grafica/foto_home177.jpg";
imagepool[175]="grafica/foto_home178.jpg";
imagepool[176]="grafica/foto_home179.jpg";
imagepool[177]="grafica/foto_home180.jpg";
imagepool[178]="grafica/foto_home181.jpg";
imagepool[179]="grafica/foto_home182.jpg";
imagepool[180]="grafica/foto_home183.jpg";
imagepool[181]="grafica/foto_home184.jpg";
imagepool[182]="grafica/foto_home185.jpg";
imagepool[183]="grafica/foto_home186.jpg";
imagepool[184]="grafica/foto_home187.jpg";
imagepool[185]="grafica/foto_home188.jpg";
imagepool[186]="grafica/foto_home189.jpg";
imagepool[187]="grafica/foto_home190.jpg";
imagepool[188]="grafica/foto_home191.jpg";
imagepool[189]="grafica/foto_home192.jpg";
imagepool[190]="grafica/foto_home193.jpg";
imagepool[191]="grafica/foto_home194.jpg";
imagepool[192]="grafica/foto_home195.jpg";
imagepool[193]="grafica/foto_home196.jpg";
imagepool[194]="grafica/foto_home197.jpg";
imagepool[195]="grafica/foto_home198.jpg";
imagepool[196]="grafica/foto_home199.jpg";
imagepool[197]="grafica/foto_home200.jpg";
imagepool[198]="grafica/foto_home201.jpg";
imagepool[199]="grafica/foto_home202.jpg";
imagepool[200]="grafica/foto_home203.jpg";
imagepool[201]="grafica/foto_home204.jpg";
imagepool[202]="grafica/foto_home205.jpg";
imagepool[203]="grafica/foto_home206.jpg";
imagepool[204]="grafica/foto_home207.jpg";
imagepool[205]="grafica/foto_home208.jpg";
imagepool[206]="grafica/foto_home209.jpg";
imagepool[207]="grafica/foto_home210.jpg";
imagepool[208]="grafica/foto_home211.jpg";
imagepool[209]="grafica/foto_home212.jpg";
imagepool[210]="grafica/foto_home213.jpg";
imagepool[211]="grafica/foto_home214.jpg";
imagepool[212]="grafica/foto_home215.jpg";
imagepool[213]="grafica/foto_home216.jpg";
imagepool[214]="grafica/foto_home217.jpg";

//GET THE TOTAL NUMBER OF IMAGES IN THE IMAGE POOL
var quantity = imagepool.length;

//SELECT TEN UNIQUE RANDOM IMAGE PATHS
var randomimage1=Math.round(Math.random()*(quantity-1));

do {
var randomimage2=Math.round(Math.random()*(quantity-1))
}
while (randomimage2==randomimage1);

do {
var randomimage3=Math.round(Math.random()*(quantity-1))
}
while (randomimage3==randomimage1 || randomimage3==randomimage2);

do {
var randomimage4=Math.round(Math.random()*(quantity-1))
}
while (randomimage4==randomimage1 || randomimage4==randomimage2 || randomimage4==randomimage3);

do {
var randomimage5=Math.round(Math.random()*(quantity-1))
}
while (randomimage5==randomimage1 || randomimage5==randomimage2 || randomimage5==randomimage3 || randomimage5==randomimage4);

do {
var randomimage6=Math.round(Math.random()*(quantity-1))
}
while (randomimage6==randomimage1 || randomimage6==randomimage2 || randomimage6==randomimage3 || randomimage6==randomimage4 || randomimage6==randomimage5);

do {
var randomimage7=Math.round(Math.random()*(quantity-1))
}
while (randomimage7==randomimage1 || randomimage7==randomimage2 || randomimage7==randomimage3 || randomimage7==randomimage4 || randomimage7==randomimage5 || randomimage7==randomimage6);

do {
var randomimage8=Math.round(Math.random()*(quantity-1))
}
while (randomimage8==randomimage1 || randomimage8==randomimage2 || randomimage8==randomimage3 || randomimage8==randomimage4 || randomimage8==randomimage5 || randomimage8==randomimage6 || randomimage8==randomimage7);

do {
var randomimage9=Math.round(Math.random()*(quantity-1))
}
while (randomimage9==randomimage1 || randomimage9==randomimage2 || randomimage9==randomimage3 || randomimage9==randomimage4 || randomimage9==randomimage5 || randomimage9==randomimage6 || randomimage9==randomimage7 || randomimage9==randomimage8);

do {
var randomimage10=Math.round(Math.random()*(quantity-1))
}
while (randomimage10==randomimage1 || randomimage10==randomimage2 || randomimage10==randomimage3 || randomimage10==randomimage4 || randomimage10==randomimage5 || randomimage10==randomimage6 || randomimage10==randomimage7 || randomimage10==randomimage8 || randomimage10==randomimage9);

var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
//ASSIGN THE RANDOMLY GENERATED IMAGE PATHS TO THE FADEIMAGES ARRAY
fadeimages[0]=[imagepool[randomimage1], "", ""] //plain image syntax
fadeimages[1]=[imagepool[randomimage2], "", ""] //plain image syntax
fadeimages[2]=[imagepool[randomimage3], "", ""] //plain image syntax
fadeimages[3]=[imagepool[randomimage4], "", ""] //plain image syntax
fadeimages[4]=[imagepool[randomimage5], "", ""] //plain image syntax
fadeimages[5]=[imagepool[randomimage6], "", ""] //plain image syntax
fadeimages[6]=[imagepool[randomimage7], "", ""] //plain image syntax
fadeimages[7]=[imagepool[randomimage8], "", ""] //plain image syntax
fadeimages[8]=[imagepool[randomimage9], "", ""] //plain image syntax
fadeimages[9]=[imagepool[randomimage10], "", ""] //plain image syntax

var fadebgcolor="white"

////NO need to edit beyond here/////////////
 
var fadearray=new Array() //array to cache fadeshow instances
var fadeclear=new Array() //array to cache corresponding clearinterval pointers
 
var dom=(document.getElementById) //modern dom browsers
var iebrowser=document.all
 
function fadeshow(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder){
this.pausecheck=pause
this.mouseovercheck=0
this.delay=delay
this.degree=10 //initial opacity degree (10%)
this.curimageindex=0
this.nextimageindex=1
fadearray[fadearray.length]=this
this.slideshowid=fadearray.length-1
this.canvasbase="canvas"+this.slideshowid
this.curcanvas=this.canvasbase+"_0"
if (typeof displayorder!="undefined")
theimages.sort(function() {return 0.5 - Math.random();}) //thanks to Mike (aka Mwinter) :)
this.theimages=theimages
this.imageborder=parseInt(borderwidth)
this.postimages=new Array() //preload images
for (p=0;p<theimages.length;p++){
this.postimages[p]=new Image()
this.postimages[p].src=theimages[p][0]
}
 
var fadewidth=fadewidth+this.imageborder*2
var fadeheight=fadeheight+this.imageborder*2
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers (ie: Firefox)
document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
else
document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'"></div>')
 
if (iebrowser&&dom||dom) //if IE5+ or modern browsers such as Firefox
this.startit()
else{
this.curimageindex++
setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
}
}

function fadepic(obj){
if (obj.degree<100){
obj.degree+=10
if (obj.tempobj.filters&&obj.tempobj.filters[0]){
if (typeof obj.tempobj.filters[0].opacity=="number") //if IE6+
obj.tempobj.filters[0].opacity=obj.degree
else //else if IE5.5-
obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
}
else if (obj.tempobj.style.MozOpacity)
obj.tempobj.style.MozOpacity=obj.degree/101
else if (obj.tempobj.style.KhtmlOpacity)
obj.tempobj.style.KhtmlOpacity=obj.degree/100
else if (obj.tempobj.style.opacity&&!obj.tempobj.filters)
obj.tempobj.style.opacity=obj.degree/101
}
else{
clearInterval(fadeclear[obj.slideshowid])
obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
obj.populateslide(obj.tempobj, obj.nextimageindex)
obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
}
}
 
fadeshow.prototype.populateslide=function(picobj, picindex){
var slideHTML=""
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'
slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px">'
if (this.theimages[picindex][1]!="") //if associated link exists for image
slideHTML+='</a>'
picobj.innerHTML=slideHTML
}
 
 
fadeshow.prototype.rotateimage=function(){
if (this.pausecheck==1) //if pause onMouseover enabled, cache object
var cacheobj=this
if (this.mouseovercheck==1)
setTimeout(function(){cacheobj.rotateimage()}, 100)
else if (iebrowser&&dom||dom){
this.resetit()
var crossobj=this.tempobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
crossobj.style.zIndex++
fadeclear[this.slideshowid]=setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
this.curcanvas=(this.curcanvas==this.canvasbase+"_0")? this.canvasbase+"_1" : this.canvasbase+"_0"
}
else{
var ns4imgobj=document.images['defaultslide'+this.slideshowid]
ns4imgobj.src=this.postimages[this.curimageindex].src
}
this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}
 
fadeshow.prototype.resetit=function(){
this.degree=10
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
if (crossobj.filters&&crossobj.filters[0]){
if (typeof crossobj.filters[0].opacity=="number") //if IE6+
crossobj.filters(0).opacity=this.degree
else //else if IE5.5-
crossobj.style.filter="alpha(opacity="+this.degree+")"
}
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=this.degree/101
else if (crossobj.style.KhtmlOpacity)
crossobj.style.KhtmlOpacity=this.degree/100
else if (crossobj.style.opacity&&!crossobj.filters)
crossobj.style.opacity=this.degree/101
}
 
 
fadeshow.prototype.startit=function(){
var crossobj=iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
this.populateslide(crossobj, this.curimageindex)
if (this.pausecheck==1){ //IF SLIDESHOW SHOULD PAUSE ONMOUSEOVER
var cacheobj=this
var crossobjcontainer=iebrowser? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)
crossobjcontainer.onmouseover=function(){cacheobj.mouseovercheck=1}
crossobjcontainer.onmouseout=function(){cacheobj.mouseovercheck=0}
}
this.rotateimage()
}