
var imageSwaps = new Array()

imageSwaps[0] = ""
imageSwaps[1] = ""
imageSwaps[2] = ""
imageSwaps[3] = ""







function checkForImageSwap() {

	/* check the browser is capable of recognising the DOM objects
	   we need to implement the script - otherwise return false and allow the normal link to be executed */
	if(!document.getElementsByTagName) return false;
	//if(!document.getElementById) return false;
	//if(!document.getElementById("menuSlide")) return false;

	
	/* get the reference to the menuSlide object and then create an array 
	   of all the <a> tags found in the array. To each tag assign a function to
	   the onclick method - which calls the showPic function. */
	   
	//var gallery = document.getElementById("menuSlide");
	var links = document.getElementsByTagName("img");

	for(i = 0; i < links.length; i++) {
	

				
				
				
			if(links[i].className == "swapBackground") {
			//alert(links[i].className)
		
				links[i].onmouseover = function() {
			
				return swapBackground(this)		
					
				}	
			
			
				links[i].onmouseout = function() {
			
				return noSwapBackground(this)		
					
				}	
			

			}				
				
				
			if(links[i].className == "swapMeJpg") {
			//alert(links[i].className)
		
				links[i].onmouseover = function() {
			
				return swapImageJpg(this)		
					
				}	
			
			
				links[i].onmouseout = function() {
			
				return noSwapImageJpg(this)		
					
				}	
			

			}					
				
				
				
			if(links[i].className == "swapMeGif") {
			//alert(links[i].className)
		
				links[i].onmouseover = function() {
			
				return swapImage(this)		
					
				}	
			
			
				links[i].onmouseout = function() {
			
				return noSwapImage(this)		
					
				}	
			

			}				
				
				
		
		}
		
	
}

	
	


function swapImage(obj) {
	
		obj.src = "images/" + obj.id + "_on.gif"	 
		//alert(obj.src)
	
	
}


function noSwapImage(obj) {
	
		//alert(obj.id)
	
		obj.src = "images/" + obj.id + "_off.gif"	 
	
	
}



function swapImageJpg(obj) {
	
		obj.src = "images/" + obj.id + "_on.jpg"	 
		//alert(obj.src)
	
	
}


function noSwapImageJpg(obj) {
	
		//alert(obj.id)
	
		obj.src = "images/" + obj.id + "_off.jpg"	 
	
	
}

function swapBackground(obj) {
	
		//obj.parentNode.parentNode.style.backgroundImage = "url(images/portfolioBackground.jpg)"	 
		//alert(obj.style.backgroundImage = "url(images/" + obj.id + "_off.jpg)")
		obj.style.backgroundImage = "url(images/" + obj.id + "_on.jpg)"	 
	
	
}


function noSwapBackground(obj) {
	
		//alert(obj.id)
	
		obj.style.backgroundImage = "url(images/" + obj.id + "_off.jpg)"	 
	
	
}