function newImage(src) {
  if (document.images) {
    var image = new Image();
    image.src = src;
    return image;
  }
}

// preload images for navigation
  function preloadImages() {
  var home = newImage("images/navigation/home.gif");
  var home_yellow = newImage("images/navigation/home_yellow.gif");
  var companies = newImage("images/navigation/companies.gif");
  var companies_yellow = newImage("images/navigation/companies_yellow.gif");
  var locations = newImage("images/navigation/locations.gif");
  var locations_yellow = newImage("images/navigation/locations_yellow.gif");
  var lines = newImage("images/navigation/lines.gif");
  var lines_yellow = newImage("images/navigation/lines_yellow.gif");
  var contacts = newImage("images/navigation/contacts.gif");
  var contacts_yellow = newImage("images/navigation/contacts_yellow.gif");
  var support = newImage("images/navigation/support.gif");
  var support_yellow = newImage("images/navigation/support_yellow.gif");
  var history = newImage("images/navigation/history.gif");
  var history_yellow = newImage("images/navigation/history_yellow.gif");
  var events = newImage("images/navigation/events.gif");
  var events_yellow = newImage("images/navigation/events_yellow.gif");
  var careers = newImage("images/navigation/careers.gif");
  var careers_yellow = newImage("images/navigation/careers_yellow.gif");
  var people = newImage("images/navigation/people.gif");
  var people_yellow = newImage("images/navigation/people_yellow.gif");
  var news = newImage("images/navigation/news.gif");
  var news_yellow = newImage("images/navigation/news_yellow.gif");
  var testimonials = newImage("images/navigation/testimonials.gif");
  var testimonials_yellow = newImage("images/navigation/testimonials_yellow.gif");
  var testimonials = newImage("images/navigation/testimonials.gif");
  var testimonials_yellow = newImage("images/navigation/testimonials_yellow.gif");
  }

function papePopup(url)
{
	return papePopupSized(url, 600, 900);
}

function papePopOnTop(url)
{
	window.open(url, 'popupWindow', 'location=1,status=1,scrollbars=1,toolbar=1,menubar=1,resizable=1,height=500,width=800');
}

function papePopupSized(url, height, width)
{
	window.open(url, 'popupWindow', 'location=1,status=1,scrollbars=1,toolbar=1,menubar=1,resizable=1,height=' + height + ',width=' + width + '');
	return false;
}
	
function insertFlash(filename)
{
	insertFlashSized(filename, 353, 756);
}

function insertFlashSized(filename, height, width)
{
	document.write('<OBJECT><param name="height" value="' + height + '"/><param name="width" value="' + width + '"/><param name="codeBase" value="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"/><param name="classid" value="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"/><PARAM NAME="_cx" VALUE="20003"/><PARAM NAME="_cy" VALUE="9366"/><PARAM NAME="FlashVars" VALUE=""/><PARAM NAME="Movie" VALUE="flash/' + filename + '"/><PARAM NAME="Src" VALUE="flash/' + filename + '"/><PARAM NAME="WMode" VALUE="Window"/><PARAM NAME="Play" VALUE="-1"/><PARAM NAME="Loop" VALUE="-1"/><PARAM NAME="Quality" VALUE="High"/><PARAM NAME="AllowScriptAccess" VALUE=""/><PARAM NAME="Scale" VALUE="ShowAll"/><PARAM NAME="DeviceFont" VALUE="0"/><PARAM NAME="EmbedMovie" VALUE="0"/><PARAM NAME="BGColor" VALUE="FFFFFF"/><PARAM NAME="SWRemote" VALUE=""/><PARAM NAME="MovieData" VALUE=""/><PARAM NAME="SeamlessTabbing" VALUE="1"/><PARAM NAME="AllowNetworking" VALUE="all"/><PARAM NAME="AllowFullScreen" VALUE="false"/><embed width="' + width + '" height="' + height + '" align="" menu="true" loop="false" play="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="myMovieName" bgcolor="#FFFFFF" quality="high" src="flash/' + filename + '"> </embed></OBJECT>');
}

function testimonialsToggle(div_id_to_show)
{
	document.getElementById('pape_machinery').style.display = 'none';
	document.getElementById('bobcat_west').style.display = 'none';
	document.getElementById('pape_mh').style.display = 'none';
	document.getElementById('engineered').style.display = 'none';
	document.getElementById('pape_trucks').style.display = 'none';
	document.getElementById('ditch_witch').style.display = 'none';
	document.getElementById('flightcraft').style.display = 'none';
	
	div_id_to_show = document.getElementById(div_id_to_show);
	div_id_to_show.style.display = 'block';
}

function satisfactionSwitch(div_id_to_show)
{
	document.getElementById('listen_div').style.display = 'none';
	document.getElementById('get_it_right_div').style.display = 'none';
	document.getElementById('good_quick_div').style.display = 'none';
	document.getElementById('mean_it_div').style.display = 'none';
	
	div_id_to_show = document.getElementById(div_id_to_show);
	div_id_to_show.style.display = 'block';
}