$(document).ready(function(){	
	//initRollOverImage();
	divHover();
});	
function initRollOverImage() {
	
		
	//RollOver for all img that has _n in src str
	$("img").hover(
		function() {
			this.keepOver = false;
			var src = $(this).attr('src');			
			if (src && src.lastIndexOf('_n.') != -1){			
				src = src.replace(/_n./, "_o.");			
				$(this).attr('src', src);							
			}
			else{
				this.keepOver = true;
			}
		},
		
		function() {			
			if(this.keepOver) return;
			var src = $(this).attr('src');							
			if (src && src.lastIndexOf('_o.') != -1){						
				src = src.replace(/_o./, "_n.");
				$(this).attr('src', src);			
			}
		}
	);
	
	//RollOver for all input that has _n in src str	
	$("input").hover(
		function() {	
			this.keepOver = false;	
			var src = $(this).attr('src');			
			if (src && src.lastIndexOf('_n.') != -1){			
				src = src.replace(/_n./, "_o.");			
				$(this).attr('src', src);							
			}	
			else{
				this.keepOver = true;
			}
		},
		
		function() {			
			if(this.keepOver) return;			
			var src = $(this).attr('src');							
			if (src && src.lastIndexOf('_o.') != -1){						
				src = src.replace(/_o./, "_n.");
				$(this).attr('src', src);			
			}
		}
	);
}

function divHover(){
	$("div.infoType").hover(
		function() {
			this.keepOver = false;	
			var image = $(this).children('img:first');
			var imageSrc = image.attr('src');
			if (imageSrc && imageSrc.lastIndexOf('_n.') != -1){			
				imageSrc = imageSrc.replace(/_n./, '_o.');			
				image.attr('src', imageSrc);							
			}	
			else{
				this.keepOver = true;
			}	
		},
		
		function() {		
			if(this.keepOver) return;
			var image = $(this).children('img:first');
			var imageSrc = image.attr('src');
			if (imageSrc && imageSrc.lastIndexOf('_o.') != -1){			
				imageSrc = imageSrc.replace(/_o./, '_n.');			
				image.attr('src', imageSrc);							
			}			
		}
	);
}
			