(function(){

if (!document.getElementById) return;

//Script For Change Image
	var initRollovers = function() {
	
		var tags = ["img","input"];
		var p_images = new Array();
		var p_cnt = 0;
		var a_src;
		
		for(var i = 0; i < tags.length ; i++) {
			var elms = document.getElementsByTagName(tags[i]);
			for(var j = 0; j < elms.length;j++) {
				if(elms[j].className && String(elms[j].className).indexOf("imgover") >= 0) {
					var src = elms[j].getAttribute('src');
					var ftype = src.substring(src.lastIndexOf('.'), src.length);
					var hsrc = src.replace(ftype, '_on'+ftype);
		
					elms[j].setAttribute('hsrc', hsrc);
					
					p_images[p_cnt] = new Image();
					p_images[p_cnt].src = hsrc;
					p_cnt++;
					
					elms[j].onmouseover = function() {
						a_src = this.getAttribute('src');
						this.setAttribute('src', this.getAttribute('hsrc'));
					}	
					
					elms[j].onmouseout = function() {
						if (!a_src) a_src = this.getAttribute('src').replace('_on'+ftype, ftype);
						this.setAttribute('src', a_src);
					}
				}
			}
		}
	}

//Script For Change NaviImage
var navRollovers = function() {

	 var group = ['mypage-naiv-top,mypage-naiv-record'];
	
	if(document.getElementById) {
		for (var i=0;i<group.length; i++){
		var elm = group[i].split(',');
			for (var j=0; j<elm.length; j++){
			var el = document.getElementById(elm[j]);
				if(el){
					el.onmouseover = (function(nav,cname){return function(){setHoverClassName(nav,cname);};})(i,'over');
					el.onmouseout = (function(nav,cname){return function(){setHoverClassName(nav,cname);};})(i,'');
				}
			}
		}
	}
	
	function setHoverClassName(g,cname){
	if(document.getElementById) {
		var elm = group[g].split(',');
			for (var i=0; i<elm.length; i++){
				var el = document.getElementById(elm[i]);
					if(el){
						document.getElementById(elm[i]).firstChild.className = cname;
					}
				}
			}  
		}
	}

//addEvent
	try{
		window.addEventListener("load",initRollovers,false);
		window.addEventListener("load",navRollovers,false);
	} catch(e){
		try {
			window.attachEvent('onload',initRollovers);
			window.attachEvent('onload',navRollovers);
		} catch(e){
			return;
		}
	}
	
})();
