function stopError()
{
	return true;
}
window.onerror = stopError;

var imagePath="images/";
var goodToGo=false;
var max_slides = 7
var slide_show1 = new Array(max_slides);
var slide_show2 = new Array(max_slides);
var slide_show3 = new Array(max_slides);
var slide_keys = new Array(4, 5, 9, 8, 6, 1, 7);

if ( document.images )
{
	// Images
	harkins_builders = new Image();
	harkins_builders.src = imagePath + "harkins_builders.gif";
	
	// top photos
	top_photos = new Array(5);
	for  ( i = 1; i <= 5; i ++ )
	{
		file = imagePath + i + '.jpg';
		top_photos[i -1] = new Image();
		top_photos[i -1].src = file;
	}
	
	_1 = new Image();
	_1.src = imagePath + '1.gif';
	
	co = new Image();
	co.src = imagePath + 'corporate_overview.gif';
	co2 = new Image();
	co2.src = imagePath + 'corporate_overview-2.gif';
	
	pj = new Image();
	pj.src = imagePath + 'projects.gif';
	pj2 = new Image();
	pj2.src = imagePath + 'projects-2.gif';
	
	cs = new Image();
	cs.src = imagePath + 'client_services.gif';
	cs2 = new Image();
	cs2.src = imagePath + 'client_services-2.gif';
	
	ca = new Image();
	ca.src = imagePath + 'careers.gif';
	ca2 = new Image();
	ca2.src = imagePath + 'careers-2.gif';
	
	cu = new Image();
	cu.src = imagePath + 'contact_us.gif';
	cu2 = new Image();
	cu2.src = imagePath + 'contact_us-2.gif';
	
	pr = new Image();
	pr.src = imagePath + 'press_releases.gif';
	pr2 = new Image();
	pr2.src = imagePath + 'press_releases-2.gif';
	
	bb = new Image();
	bb.src = imagePath + 'bid_board.gif';
	bb2 = new Image();
	bb2.src = imagePath + 'bid_board-2.gif';

	he = new Image();
	he.src = imagePath + 'intranet.gif';
	he2 = new Image();
	he2.src = imagePath + 'intranet-2.gif';

	sp = new Image();
	sp.src = imagePath + 'special.gif';
	sp2 = new Image();
	sp2.src = imagePath + 'special-2.gif';
	
	_10 = new Image();
	_10.src = imagePath + '10.gif';
	
	// start photos 
	photo1 = new Image();
	photo1.src = imagePath + 'home/1.jpg';
	photo2 = new Image();
	photo2.src = imagePath + 'home/2.jpg';
	photo3 = new Image();
	photo3.src = imagePath + 'home/3.jpg';
	
	// slide show
	for  ( i = 1; i <= max_slides; i ++ )
	{
		file = imagePath + 'home/' + slide_keys[i - 1] + '/1.jpg';
		slide_show1[i - 1] = new Image();
		slide_show1[i - 1].src = file;
		
		file = imagePath + 'home/' + slide_keys[i - 1] + '/2.jpg';
		slide_show2[i - 1] = new Image();
		slide_show2[i - 1].src = file;
		
		file = imagePath + 'home/' + slide_keys[i - 1] + '/3.jpg';
		slide_show3[i - 1] = new Image();
		slide_show3[i - 1].src = file;
	}	

	// special slide
	special1 = new Image();
	special1.src = imagePath + 'home/1.jpg';
	special2 = new Image();
	special2.src = imagePath + 'home/2.jpg';
	special3 = new Image();
	special3.src = imagePath + 'home/3.jpg';
}

function loaded()
{
  	if (document.images)
	{
		goodToGo=true;
	}
	return true;
}

function over(buttonName)
{
  	var prompt = "";
	if (document.images)
  	{
		if ( ! goodToGo )
			return true;
		
		document[buttonName].src = eval(buttonName + "2").src;		

		if ( buttonName == "sp" )
		{
			document['photo1'].src = special1.src;		
			document['photo2'].src = special2.src;		
			document['photo3'].src = special3.src;
			prompt = "Harkins Builders at Waverly Woods";
		}
		
		if ( buttonName == "co" )
		{
			document['photo1'].src = slide_show1[0].src;		
			document['photo2'].src = slide_show2[0].src;		
			document['photo3'].src = slide_show3[0].src;		
			prompt = "About Harkins Builders";
		}
		if ( buttonName == "pj" )
		{
			document['photo1'].src = slide_show1[1].src;		
			document['photo2'].src = slide_show2[1].src;		
			document['photo3'].src = slide_show3[1].src;		
			prompt = "Project Experience";
		}
		if ( buttonName == "cs" )
		{
			document['photo1'].src = slide_show1[2].src;		
			document['photo2'].src = slide_show2[2].src;		
			document['photo3'].src = slide_show3[2].src;		
			prompt = "Working with Harkins";
		}
		if ( buttonName == "ca" )
		{
			document['photo1'].src = slide_show1[3].src;		
			document['photo2'].src = slide_show2[3].src;		
			document['photo3'].src = slide_show3[3].src;		
			prompt = "Careers at Harkins";
		}
		if ( buttonName == "cu" )
		{
			document['photo1'].src = slide_show1[4].src;		
			document['photo2'].src = slide_show2[4].src;		
			document['photo3'].src = slide_show3[4].src;		
			prompt = "Contact Harkins";
		}
		if ( buttonName == "pr" )
		{
			document['photo1'].src = slide_show1[5].src;		
			document['photo2'].src = slide_show2[5].src;		
			document['photo3'].src = slide_show3[5].src;		
			prompt = "Press Releases";
		}
		if ( buttonName == "bb" )
		{
			document['photo1'].src = slide_show1[6].src;		
			document['photo2'].src = slide_show2[6].src;		
			document['photo3'].src = slide_show3[6].src;		
			prompt = "Bid Board";
		}
		if ( buttonName == "he" )
		{
			document['photo1'].src = slide_show1[1].src;		
			document['photo2'].src = slide_show2[1].src;		
			document['photo3'].src = slide_show3[1].src;		
			prompt = "Harkins Employees";
		}
	}
	window.status = prompt;
	
	return true;
}

function out(buttonName)
{
	var timeOut = 100;
	
	if (document.images)
 	{
		if ( ! goodToGo )
			return true;
		
		document['photo1'].src = photo1.src;		
		document['photo2'].src = photo2.src;		
		document['photo3'].src = photo3.src;		
		
		document[buttonName].src = eval(buttonName).src;		
		
		window.status="";
	}
	return true;
}

