if (document.images)
{
	var imagePath = 'images/';
	
	homebutton= new Image();
	homebutton.src= imagePath + "home.jpg";
	
	products= new Image();
	products.src= imagePath + "products.jpg";  
	
	news= new Image();
	news.src= imagePath + "news.jpg"; 
	
	gallery= new Image();
	gallery.src= imagePath + "gallery.jpg"; 
	
	gear= new Image();
	gear.src= imagePath + "gear.jpg"; 
	
	about= new Image();
	about.src= imagePath + "about.jpg"; 
	
	contact= new Image();
	contact.src= imagePath + "contact.jpg";
	
	links= new Image();
	links.src= imagePath + "links.jpg";
 
}
   
var opened = false;
function loadLargerImages(url,wid, hyt)
{
	checkOpenedWindow();
	imageWindow= window.open (url, "mywindow","location=0,status=0,scrollbars=0,width=" + wid +",height=" + hyt);
	imageWindow.focus();
	opened = true;

}

function checkOpenedWindow()
{
	if(opened) 
	{
		imageWindow.close();
		opened = false;
	}
}

function swapImage(obj,src,ext)
{
	
	var image_path = 'images/';
	obj.src = image_path + src + ext;
}

function setDivBackground()
{
	ranIndex= Math.round(11*Math.random()) + 1;
	document.getElementById('contentHome').style.background = 'url(images/homepage' + String(ranIndex) + '.jpg)';

}
