// JavaScript Document

function loadRandomImage()
	{
	var images = [];
	
	images.push({imgSrc: '/images/homebanners/Efficiency.gif', linkHref: '/tech-support/resources/component-efficiency-application.cfm', alt: 'Efficiency'});
	images.push({imgSrc: '/images/homebanners/Mini_Motors.gif', linkHref: '/tech-support/resources/miniature-motors.cfm', alt:'Mini Motors'});
	images.push({imgSrc: '/images/homebanners/Optimal_Design.gif', linkHref: '/tech-support/resources/your-optimal-design.cfm', alt: 'Optimal Design'});
	images.push({imgSrc: '/images/homebanners/Simulation.gif', linkHref: '/tech-support/resources/simulation-to-the-next-level.cfm', alt: 'Simulation'});
	images.push({imgSrc: '/images/homebanners/Software.gif', linkHref: '/tech-support/resources/custom-sizing-software.cfm', alt: 'Software'});
	images.push({imgSrc: '/images/homebanners/Solar_Energy.gif', linkHref: '/tech-support/resources/face-the-sun.cfm', alt: 'Solar Energy'});
	images.push({imgSrc: '/images/homebanners/Wind_Energy.gif', linkHref: '/tech-support/resources/winds-of-change.cfm', alt: 'Wind Energy'});
	images.push({imgSrc: '/images/homebanners/Muscle.gif', linkHref: '/tech-support/resources/muscle.cfm', alt: 'Muscle'});
	images.push({imgSrc: '/images/homebanners/Sweet_Motion.gif', linkHref: '/tech-support/resources/sweet-motion.cfm', alt: 'Sweet Motion'});
	images.push({imgSrc: '/images/homebanners/Medical_Technology.gif', linkHref: '/tech-support/resources/packaging-without-surprises.cfm', alt: 'Medical Technology'});
	
	/*
	images.push({imgSrc: '/images/homebanners/Wittenstein_Aerospace.jpg', linkHref: '#', alt: 'Aerospace'});
	images.push({imgSrc: '/images/homebanners/Wittenstein_Energy.jpg', linkHref: '#', alt: 'Energy'});
	images.push({imgSrc: '/images/homebanners/Wittenstein_Semiconductor.jpg', linkHref: '#', alt: 'Semiconductor'});
	images.push({imgSrc: '/images/homebanners/Wittenstein_Sensor_Tech.jpg', linkHref: '#', alt: 'Sensor Technology'});
	images.push({imgSrc: '/images/homebanners/Wittenstein_Shipping.jpg', linkHref: '#', alt: 'Shipping'});
	images.push({imgSrc: '/images/homebanners/Wittenstein_Packaging.jpg', linkHref: '#', alt: 'Packaging'});
	*/
	
	var index = Math.floor(Math.random() * images.length);
	
	var img = document.createElement('img');
	img.src = images[index].imgSrc;
	img.alt = images[index].alt;
	
	var link  = document.createElement('a');
	link.href = images[index].linkHref;
	
	link.appendChild(img);
	document.getElementById('home_photo_swap').appendChild(link);
	}