// JavaScript Document

<!--
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/***********************************************
* Ultimate Fade-In Slideshow (v1.51): © Dynamic Drive (http://www.dynamicdrive.com)
* http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var fadeimages=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimages[0]=["produtos/foto_destaque_01.jpg","std_inicio.html","_self"] 
fadeimages[1]=["produtos/foto_destaque_02.jpg","std_prod_bscorpion.html","_self"] 
fadeimages[2]=["produtos/foto_destaque_03.jpg","std_prod_bmc.html","_self"] 
fadeimages[3]=["produtos/foto_destaque_04.jpg","std_inicio.html","_self"] 
fadeimages[4]=["produtos/foto_destaque_05.jpg","std_prod_omp.html","_self"] 
fadeimages[5]=["produtos/foto_destaque_06.jpg","std_prod_bscorpion.html","_self"] 
fadeimages[6]=["produtos/foto_destaque_07.jpg","std_prod_sparco.html","_self"] 
fadeimages[7]=["produtos/foto_destaque_08.jpg","std_inicio.html","_self"] 
fadeimages[8]=["produtos/foto_destaque_09.jpg","std_prod_maxxis.html","_self"] 
fadeimages[9]=["produtos/foto_destaque_10.jpg","std_prod_omp.html","_self"] 
 
var fadeimageskarts=new Array() //2nd array set example. Remove or add more sets as needed.
//SET IMAGE PATHS. Extend or contract array as needed
fadeimageskarts[0]=["produtos/black scorpion/kbscorpion_01.jpg", "", ""] //plain image syntax
fadeimageskarts[1]=["produtos/black scorpion/kbscorpion_02.jpg", "", ""] //plain image syntax
fadeimageskarts[2]=["produtos/black scorpion/kbscorpion_03.jpg", "", ""] //plain image syntax
fadeimageskarts[3]=["produtos/black scorpion/kbscorpion_04.jpg", "", ""] //plain image syntax
fadeimageskarts[4]=["produtos/black scorpion/kbscorpion_05.jpg", "", ""] //plain image syntax
fadeimageskarts[5]=["produtos/black scorpion/kbscorpion_06.jpg", "", ""] //plain image syntax
fadeimageskarts[6]=["produtos/black scorpion/kbscorpion_07.jpg", "", ""] //plain image syntax
fadeimageskarts[7]=["produtos/black scorpion/kbscorpion_08.jpg", "", ""] //plain image syntax
fadeimageskarts[8]=["produtos/black scorpion/kbscorpion_09.jpg", "", ""] //plain image syntax
fadeimageskarts[9]=["produtos/black scorpion/kbscorpion_10.jpg", "", ""] //plain image syntax
fadeimageskarts[10]=["produtos/black scorpion/kbscorpion_11.jpg", "", ""] //plain image syntax
fadeimageskarts[11]=["produtos/black scorpion/kbscorpion_12.jpg", "", ""] //plain image syntax
fadeimageskarts[12]=["produtos/black scorpion/kbscorpion_13.jpg", "", ""] //plain image syntax
fadeimageskarts[13]=["produtos/black scorpion/kbscorpion_14.jpg", "", ""] //plain image syntax
fadeimageskarts[14]=["produtos/black scorpion/kbscorpion_15.jpg", "", ""] //plain image syntax
fadeimageskarts[15]=["produtos/black scorpion/kbscorpion_16.jpg", "", ""] //plain image syntax
fadeimageskarts[16]=["produtos/black scorpion/kbscorpion_17.jpg", "", ""] //plain image syntax
fadeimageskarts[17]=["produtos/black scorpion/kbscorpion_18.jpg", "", ""] //plain image syntax
fadeimageskarts[18]=["produtos/black scorpion/kbscorpion_19.jpg", "", ""] //plain image syntax
fadeimageskarts[19]=["produtos/black scorpion/kbscorpion_20.jpg", "", ""] //plain image syntax
fadeimageskarts[20]=["produtos/black scorpion/kbscorpion_21.jpg", "", ""] //plain image syntax
fadeimageskarts[21]=["produtos/black scorpion/kbscorpion_22.jpg", "", ""] //plain image syntax
fadeimageskarts[22]=["produtos/black scorpion/kbscorpion_23.jpg", "", ""] //plain image syntax
fadeimageskarts[23]=["produtos/black scorpion/kbscorpion_24.jpg", "", ""] //plain image syntax
fadeimageskarts[24]=["produtos/black scorpion/kbscorpion_25.jpg", "", ""] //plain image syntax
fadeimageskarts[25]=["produtos/black scorpion/kbscorpion_26.jpg", "", ""] //plain image syntax
fadeimageskarts[26]=["produtos/black scorpion/kbscorpion_27.jpg", "", ""] //plain image syntax
fadeimageskarts[27]=["produtos/black scorpion/kbscorpion_28.jpg", "", ""] //plain image syntax
fadeimageskarts[28]=["produtos/black scorpion/kbscorpion_29.jpg", "", ""] //plain image syntax

var fadeimagesbanner=new Array()
//SET IMAGE PATHS. Extend or contract array as needed
fadeimagesbanner[0]=["imagens/Banner-1.jpg","http://www.kartfun.com/eventos/2009%2003%20Volta%20a%20Portugal/std_resumoevento.html","_self"] 
fadeimagesbanner[1]=["imagens/Banner-2.jpg","http://www.kartfun.com/eventos/2009%2003%20Volta%20a%20Portugal/std_resumoevento.html","_self"] 
fadeimagesbanner[2]=["imagens/Banner-3.jpg","http://www.kartfun.com/eventos/2009%2003%20Volta%20a%20Portugal/std_resumoevento.html","_self"] 
var fadebgcolor="black"

////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()
}
//--!>


<!--
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Dynamic Images by Kaosweaver
// Copyright 2007, All rights reserved
var rI = {
	init:function(o,t) {rI.obj=o;rI.rT=t;},
	addImg:function() {
		var a=arguments;rI.imgList.push(a[0]);rI.altList.push((a[1]?a[1]:''));
		rI.linkList.push((a[2]?a[2]:''));rI.tgtList.push((a[3]?a[3]:''));},
	showImg:function() {
		if (rI.rT==0){var j=parseInt(Math.random()*rI.imgList.length);
		j=(isNaN(j))?0:j;}else{var oneDay=60*60*24*1000, d=new Date();
		jk=d.getTimezoneOffset()*60*1000;
		j=(parseInt((d.getTime()-jk)/oneDay))%rI.imgList.length;}
		d=document;	newImg=d.createElement("img");
		newImg.src=rI.imgList[j];newImg.alt=rI.altList[j];
		tO=d.getElementById(rI.obj);if (tO) {if (rI.linkList[j]!='') {
		newLink=d.createElement("a");newLink.href=rI.linkList[j];
		newLink.target=rI.tgtList[j];newLink.appendChild(newImg);
		tO.appendChild(newLink);} else {tO.appendChild(newImg);}}},
	addEvent: function(o,evt, fn) {
		if (o.addEventListener) {o.addEventListener(evt, fn, false);
		} else if (o.attachEvent) {o.attachEvent('on'+evt, fn);
		} else {o['on'+evt]=fn;}},
	imgList:[],altList:[],linkList:[],tgtList:[],obj:"",rT:0
}
rI.init("randomImage",0);
rI.addImg("produtos/foto_destaque.jpg","","std_prod_gopro.html","_self");
rI.addImg("produtos/foto_destaque_maxxis.jpg","","std_prod_maxxis.html","_self");
rI.addImg("produtos/foto_destaque_omp.jpg","","std_prod_omp.html","_self");
rI.addImg("produtos/foto_destaque_eibach.jpg","","std_acessorios.html","_self");
rI.addImg("produtos/foto_destaque_bardahl.jpg","","std_prod_bardahl.html","_self");
rI.addImg("produtos/foto_destaque_filtermag.jpg","","std_prod_filtermag.html","_self");
rI.addImg("produtos/foto_destaque_hella.jpg","","std_prod_hella.html","_self");
rI.addImg("produtos/foto_destaque_kenlowe.jpg","","std_prod_kenlowe.html","_self");
rI.addEvent(window,'load',rI.showImg);
//--!>


<!--
///////////////////////////////////////////////////////////////////////////////////////////
// Links Fade by Kaos Plugin
function KW_s(r, g, b, el) {
    d=document;hr=r.toString(16);hg=g.toString(16);hb=b.toString(16);
	hr=(hr.length==1)?"0"+hr:hr;hg=(hg.length==1)?"0"+hg:hg;hb=(hb.length==1)?"0"+hb:hb;
	if (d.getElementById) d.getElementById(el).style.color="#"+hr+hg+hb;
}

function KW_c(a,b,s,i) { return Math.floor(a*((s-i)/s)+b*(i/s)) }

function KW_fade(r,g,b,e,n,l,s,o){
    for(i=0;i<=s;i++)setTimeout("KW_s("+KW_c(r,e,s,i)+","+KW_c(g,n,s,i)+","+KW_c(b,l,s,i)+",'"+o+"');",i*s);
}
//--!>


<!--
///////////////////////////////////////////////////////////////////////////////////////////
/*
Verifica os campos requeridos num formulario
Check required form elements script-
By JavaScript Kit (http://javascriptkit.com)
Over 200+ free scripts here!
*/
function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
if (tempobj.name.substring(0,8)=="required"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("Por favor, preencha todos os campos assinalados com (*)")
return false
}
else
return true
}
//--!>


<!--
///////////////////////////////////////////////////////////////////////////////////////////
/*
Links intermitentes
To apply the effect to multiple links on the page,  increment the ID attribute of each link from "flashlink0" to "flashlink1" etc, depending on the number of flashing links.
<a href="test.htm" id="flashlink0" flashtype=0 flashcolor="green">Example 1</a>
<a href="test.htm" id="flashlink1" flashtype=1 flashcolor="lime">Example 2</a>
*/

var flashlinks=new Array()
function changelinkcolor(){
for (i=0; i< flashlinks.length; i++){
var flashtype=document.getElementById? flashlinks[i].getAttribute("flashtype")*1 : flashlinks[i].flashtype*1
var flashcolor=document.getElementById? flashlinks[i].getAttribute("flashcolor") : flashlinks[i].flashcolor
if (flashtype==0){
if (flashlinks[i].style.color!=flashcolor)
flashlinks[i].style.color=flashcolor
else
flashlinks[i].style.color=''
}
else if (flashtype==1){
if (flashlinks[i].style.backgroundColor!=flashcolor)
flashlinks[i].style.backgroundColor=flashcolor
else
flashlinks[i].style.backgroundColor=''
}
}
}

function init(){
var i=0
if (document.all){
while (eval("document.all.flashlink"+i)!=null){
flashlinks[i]= eval("document.all.flashlink"+i)
i++
} 
}
else if (document.getElementById){
while (document.getElementById("flashlink"+i)!=null){
flashlinks[i]= document.getElementById("flashlink"+i)
i++
}
}
setInterval("changelinkcolor()", 1000)
}

if (window.addEventListener)
window.addEventListener("load", init, false)
else if (window.attachEvent)
window.attachEvent("onload", init)
else if (document.all)
window.onload=init
//--!>


