tireToRandom = function(){}
tiresToRandomTop = new Array()
tiresToRandomBottom = new Array()

//to add new tires to arrays just increment n or m variable one more time before intializing array element

n=0
tiresToRandomTop[n] = new tireToRandom()
tiresToRandomTop[n].image = '/img/random_wrangler_adventure_tcm1092-141489.jpg'
tiresToRandomTop[n].title = 'Goodyear Wrangler Adventure'
tiresToRandomTop[n].description = 'El nuevo Goodyear Wrangler Adventure nacido para recorrer diferentes tipos de terreno gracias a su exclusiva Durawall Technollogy™.'
tiresToRandomTop[n].link = '/LATireCatalog/action/subCategories?tiretype=2&locale=AR&header=inc_AR/tpl/hd-tirecat-auto.txt&footer=inc_AR/tpl/ft-tirecat-auto.txt'
tiresToRandomTop[n].target = '_top'

m=0
tiresToRandomBottom[m] = new tireToRandom()
tiresToRandomBottom[m].image = '/img/eagle_excellence_random_tcm1092-143510.jpg'
tiresToRandomBottom[m].title = 'Eagle Excellence'
tiresToRandomBottom[m].description = 'La nueva línea Excellence combina desempeño, seguridad y comfort.'
tiresToRandomBottom[m].link = '/LATireCatalog/action/subCategories?tiretype=2&locale=AR&header=inc_AR/tpl/hd-tirecat-auto.txt&footer=inc_AR/tpl/ft-tirecat-auto.txt'
tiresToRandomBottom[m].target = '_top'

homeRandomTire = ''
for(i=1;i<=1;i++){
	j = parseInt(Math.random()*2+1)
	randPos = (j==1)?'Top':'Bottom'
	maxRand = this['tiresToRandom'+randPos].length
	tireRanded = parseInt(Math.random()*maxRand)	
	//homeRandomTire +='<p>'+tireRanded+'</p>'
	homeRandomTire +='<a href="'+this['tiresToRandom'+randPos][tireRanded].link+'" class="item" target="'+this['tiresToRandom'+randPos][tireRanded].target+'">'
	homeRandomTire +='	<img src="'+this['tiresToRandom'+randPos][tireRanded].image+'" width="85" height="120" alt="'+this['tiresToRandom'+randPos][tireRanded].title+'" border="0">'
	homeRandomTire +='	<span class="title">'+this['tiresToRandom'+randPos][tireRanded].title+'</span>'
	homeRandomTire +=	this['tiresToRandom'+randPos][tireRanded].description
             	homeRandomTire +='</a> '
}
document.write(homeRandomTire)