var preload_images = [];
function preload_image(path){
	var img = new Element('img');
	img.src = path;
	preload_images.push(img);
}

Event.observe(window,'load',function(){

// PRELOAD IMAGES
["images/btn_business_hover.gif","images/btn_education_hover.gif","images/btn_entertainment_hover.gif","images/btn_experience_hover.gif","images/btn_life_hover.gif","images/btn_products_hover.gif","images/btn_stories_hover.gif","images/scrollie-arrow-down-over.gif","images/scrollie-arrow-up-over.gif"].each(function(path){preload_image(path);});

	/*
	try{
		if(window.details.ieVersion()!=6){
			$('nav_ribbon_dealer').observe('mouseover',function(){dealer_locator_nav_hover = true;show_dealer_menu();},true);
			$('nav_ribbon_dealer').observe('mouseout',function(){dealer_locator_nav_hover = false;hide_dealer_menu();},true);
			$('dealer_locator').observe('mouseover',function(){dealer_locator_menu_hover = true;show_dealer_menu();},true);
			$('dealer_locator').observe('mouseout',function(){dealer_locator_menu_hover = false;hide_dealer_menu();},true);
			$('zip_code_nav').observe('focus',function(){if(this.value=='zip code') this.value = '';});
			$('zip_code_nav').observe('blur',function(){if(!this.value) this.value = 'zip code';});
			if($('zip_code_tab')){
				$('zip_code_tab').observe('focus',function(){if(this.value=='zip code') this.value = '';});
				$('zip_code_tab').observe('blur',function(){if(!this.value) this.value = 'zip code';});
			}
		}
		$$('a').each(
			function(elt){
				Event.observe(elt,'focus',function(){this.blur();});
			}
		);
	}catch(err){}
	*/
});
document.observe('dom:loaded',function(){
	// IE6 PROVISION
	if($('form_container_overlay')) $('form_container_overlay').style.height = $('form_container_confirmation').style.height = $('form_container').clientHeight + 'px';

	if(navigator.userAgent.indexOf('Safari')>-1&&navigator.userAgent.indexOf('Mac')>-1) $('dealer_locator').style.backgroundColor = '#444';
});

function validate_email(txt){
	return (txt.search(/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/)==0);
}
function validate_phone(txt){
	return (txt.search(/\d{3}\-\d{3}\-\d{4}/)==0);
}
function validate_zip(txt){
	return (txt.search(/\d{5}/)==0);
}