var slide_index = 0;
var max_count = 2;
var data_ob = {};

data_ob.titles = ['vision', 'place', 'process', 'people', 'performance', 'promise'];
data_ob.urls = [
					'vision_iframe?keepThis=true&TB_iframe=true&height=410&width=630',
					'place_iframe?keepThis=true&TB_iframe=true&height=410&width=630',
					'process_iframe?keepThis=true&TB_iframe=true&height=410&width=630',
					'people_iframe?keepThis=true&TB_iframe=true&height=410&width=630',
					'performance_iframe?keepThis=true&TB_iframe=true&height=410&width=630',
					'promise_iframe?keepThis=true&TB_iframe=true&height=410&width=630'
				];
data_ob.copy = [
				"Sterling has a proud tradition of providing high-quality service to ensure that the car you get back from us is as good as or better.",
				"From the way we treat you, your vehicle and the environment, you’ll know that Sterling is the right place.",
				"Our refined process of assessing, scheduling and completing your autobody repair minimizes surprises and maximizes quality.",
				"Our most valuable assets are the trained and dedicated specialists who strive for perfection every day.",
				"The most important measure of our performance is your total satisfaction. Anything less is just not Sterling.",
				"Our dedicated customer service program helps ensure that we set the bar in terms of customer service. "
				];				
				
function shift_slides(i){
	var n = slide_index;
	slide_index = Math.max(Math.min(max_count, slide_index + i), 0);
	if(n != slide_index)
	{
		log("update slides - " + slide_index);
		update_slides();
	}
}

function update_slides(){
	document.getElementById('left_slider').className = "left_slider";
	document.getElementById('right_slider').className = "right_slider";
	if(slide_index == 0){document.getElementById('left_slider').className = "left_slider_off";}
	if(slide_index == max_count){document.getElementById('right_slider').className = "right_slider_off";}

	for(i = 0; i < 4; i++)
	{
		document.getElementById('icon_' + i).className = data_ob.titles[i+slide_index];
		document.getElementById('icon_' + i + '_href').title = data_ob.titles[i+slide_index];
		document.getElementById('icon_' + i + '_href').href = data_ob.urls[i+slide_index];

		document.getElementById('label_' + i).innerHTML = data_ob.titles[i+slide_index];
		document.getElementById('label_' + i).title = data_ob.titles[i+slide_index];
		document.getElementById('label_' + i).href = data_ob.urls[i+slide_index];
		
		document.getElementById('copy_' + i).innerHTML = data_ob.copy[i+slide_index];
	}
}




function log(message){
	if(typeof console == "object"){
		console.log(message);
	}
}

function show(show_ref)
{
	state01 = 'block';
	if (document.all) { 
		//IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + show_ref + ".style.display = state01");
	} 
	if (document.layers) { 
		//IS NETSCAPE 4 or below 
		document.layers[show_ref].display = state01; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(show_ref); 
		hza.style.display = state01; 
	}
}

function hide(hide_ref)
{
	state00 = 'none'; 
	if (document.all) { 
		//IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + hide_ref + ".style.display = state00"); 
	} 
	if (document.layers) { 
		//IS NETSCAPE 4 or below 
		document.layers[hide_ref].display = state00; 
	} 
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(hide_ref); 
		hza.style.display = state00;
	}
}
