//  izmotools.js created on April 4th , 2008 to run  the Featured/ Pre-Owned Vehicles Image with their Year, Make, Model to display on Home Page 

var izmo1 = {
	rotate: function(imgId, yearId, makeId, modelId, priceId, detailpageurl) {
	this.currentRec = this.currentRec || 0 ; 
	//alert(this.currentRec);
	this.imageTag=document.getElementById(imgId);
	this.yearTag=document.getElementById(yearId);
	this.makeTag=document.getElementById(makeId);
	this.modelTag=document.getElementById(modelId);	 
	this.priceTag=document.getElementById(priceId);		
	this.detailpageurl = document.getElementById(detailpageurl);
	this.totRec = izmo1.osbBean.length;
	this.setOneRec();
	},
	hide: function(imgId) {
	this.imageTag=document.getElementById(imgId);
	(this.imageTag)? (this.imageTag.visibility ='hidden') : '';
	},
	setOneRec : function() {
    this.currentRec = ( this.currentRec == this.totRec ) ? 0 : this.currentRec;
	
	(this.imageTag)? ( this.imageTag.src = izmo1.osbBean[this.currentRec].imag) :(this.imageTag.src='http://espassets.izmocars.com/inventory/02/images/coming_soon_160x120.jpg');
	
	
	(this.yearTag)? (this.yearTag.innerHTML = izmo1.osbBean[this.currentRec].year):'';
	(this.makeTag)? (this.makeTag.innerHTML = izmo1.osbBean[this.currentRec].make):'';
	(this.detailpageurl)? (this.detailpageurl.href = izmo1.osbBean[this.currentRec].detailpageurl):'';
	///alert(izmo1.osbBean[this.currentRec].model);
	////////////////////////////////////////////////


	
	if(izmo1.osbBean[this.currentRec].model == 'N/A')
	{
		(this.modelTag)? (this.modelTag.innerHTML = '') :'';
	}
	else
	{
	(this.modelTag)? (this.modelTag.innerHTML = izmo1.osbBean[this.currentRec].model) :'';
	}

	////////////////////////////////////////
	if(izmo1.osbBean[this.currentRec].year == 'N/A' || izmo1.osbBean[this.currentRec].year == '-')
	{
		(this.yearTag)? (this.yearTag.innerHTML = '') :'';
	}
	else
	{
	(this.yearTag)? (this.yearTag.innerHTML = izmo1.osbBean[this.currentRec].year) :'';
	}
	////////////////////////////////////////
	if(izmo1.osbBean[this.currentRec].make == 'N/A')
	{
		(this.makeTag)? (this.makeTag.innerHTML = '') :'';
	}
	else
	{
	(this.makeTag)? (this.makeTag.innerHTML = izmo1.osbBean[this.currentRec].make) :'';
	}
	////////////////////////////////////////
	if(izmo1.osbBean[this.currentRec].price == 'N/A' || izmo1.osbBean[this.currentRec].price == '-')
	{
		(this.priceTag)? (this.priceTag.innerHTML = '') :'';
	}
	else
	{
	//(this.priceTag)? (this.priceTag.innerHTML = '$'+izmo1.osbBean[this.currentRec].price) :'';
	(this.priceTag)? (this.priceTag.innerHTML = izmo1.osbBean[this.currentRec].price) :'';
	}
	//(this.priceTag)? (this.priceTag.innerHTML = izmo1.osbBean[this.currentRec].price) :'';	
	this.currentRec++;	
	setTimeout("izmo1.setOneRec()",5000);
	}	
} ;
izmo1.osbBean=[];
	
	
	
	var izmo2 = {
	rotate: function(imgId, yearId, makeId, modelId, priceId, detailpageurl) {
	this.currentRec = this.currentRec || 0 ; 
	//alert(this.currentRec);
	this.imageTag=document.getElementById(imgId);
	this.yearTag=document.getElementById(yearId);
	this.makeTag=document.getElementById(makeId);
	this.modelTag=document.getElementById(modelId);	
	this.priceTag=document.getElementById(priceId);	
    this.detailpageurl = document.getElementById(detailpageurl);	
	this.totRec = izmo2.osbBean.length;
	this.setOneRec();
	},
	hide: function(imgId) {
	this.imageTag=document.getElementById(imgId);
	(this.imageTag)? (this.imageTag.visibility ='hidden') : '';
	},
	setOneRec : function() {
    this.currentRec = ( this.currentRec == this.totRec ) ? 0 : this.currentRec; 
	(this.imageTag)? ( this.imageTag.src = izmo2.osbBean[this.currentRec].imag) :(this.imageTag.src='http://espassets.izmocars.com/inventory/02/images/coming_soon_160x120.jpg');
	
	
	(this.yearTag)? (this.yearTag.innerHTML = izmo2.osbBean[this.currentRec].year):'';
	(this.makeTag)? (this.makeTag.innerHTML = izmo2.osbBean[this.currentRec].make):'';
	(this.detailpageurl)? (this.detailpageurl.href = izmo2.osbBean[this.currentRec].detailpageurl):'';

	///alert(izmo2.osbBean[this.currentRec].model);
	////////////////////////////////////////////////


	
	if(izmo2.osbBean[this.currentRec].model == 'N/A')
	{
		(this.modelTag)? (this.modelTag.innerHTML = '') :'';
	}
	else
	{
	(this.modelTag)? (this.modelTag.innerHTML = izmo2.osbBean[this.currentRec].model) :'';
	}

	////////////////////////////////////////
	if(izmo2.osbBean[this.currentRec].year == 'N/A' || izmo2.osbBean[this.currentRec].year == '-')
	{
		(this.yearTag)? (this.yearTag.innerHTML = '') :'';
	}
	else
	{
	(this.yearTag)? (this.yearTag.innerHTML = izmo2.osbBean[this.currentRec].year) :'';
	}
	////////////////////////////////////////
	if(izmo2.osbBean[this.currentRec].make == 'N/A')
	{
		(this.makeTag)? (this.makeTag.innerHTML = '') :'';
	}
	else
	{
	(this.makeTag)? (this.makeTag.innerHTML = izmo2.osbBean[this.currentRec].make) :'';
	}
	////////////////////////////////////////
	if(izmo2.osbBean[this.currentRec].price == 'N/A' || izmo2.osbBean[this.currentRec].price == '-')
	{
		(this.priceTag)? (this.priceTag.innerHTML = '') :'';
	}
	else
	{
	//(this.priceTag)? (this.priceTag.innerHTML = '$'+izmo2.osbBean[this.currentRec].price) :'';
	(this.priceTag)? (this.priceTag.innerHTML = izmo2.osbBean[this.currentRec].price) :'';
	}
	//(this.priceTag)? (this.priceTag.innerHTML = izmo2.osbBean[this.currentRec].price) :'';	
	this.currentRec++;	
	setTimeout("izmo2.setOneRec()",5000);
	}	
} ;
izmo2.osbBean=[];
