// rollover


function PI_initImgRollOver() {
	if (!document.getElementById) return false;
	var ImgList = document.getElementsByTagName('img');
	for (var i = 0; i < ImgList.length; i++) {
		if (ImgList[i].className != 'piimgover') { continue; }
		var src = ImgList[i].getAttribute('src');
		var ext = src.substring(src.lastIndexOf('.'), src.length);
		var ovsrc = src.replace(ext, '_o'+ext);
		ImgList[i].setAttribute('ousrc', src);
		ImgList[i].setAttribute('ovsrc', ovsrc);
		ImgList[i].onmouseout = function() {
			this.setAttribute('src', this.getAttribute('ousrc'));
		}
		ImgList[i].onmouseover = function() {
			this.setAttribute('src', this.getAttribute('ovsrc'));
		}
	}
	var ImgList = document.getElementsByTagName('input');
	for (var i = 0; i < ImgList.length; i++) {
		if (ImgList[i].className != 'piimgover') { continue; }
		var src = ImgList[i].getAttribute('src');
		var ext = src.substring(src.lastIndexOf('.'), src.length);
		var ovsrc = src.replace(ext, '_o'+ext);
		ImgList[i].setAttribute('ousrc', src);
		ImgList[i].setAttribute('ovsrc', ovsrc);
		ImgList[i].onmouseout = function() {
			this.setAttribute('src', this.getAttribute('ousrc'));
		}
		ImgList[i].onmouseover = function() {
			this.setAttribute('src', this.getAttribute('ovsrc'));
		}
	}
}




// height


new function(){
	WJS__SET_BASE_CLASS('wjsheight');

	var wjsheight_class = '';
	function WJS__SET_BASE_CLASS(name){ this.wjsheight_class = name; }
	function WJS__GET_BASE_CLASS(){ return this.wjsheight_class; }
	function __wjs__height_uniform_(){
		if (!document.getElementById) return false;
		var objAll = document.getElementsByTagName("*");
		var base_class = WJS__GET_BASE_CLASS();
		var reg = new RegExp(base_class, 'i');
		for(var i = 0; i < objAll.length; i++) {
			if(objAll[i].className.match(reg)){
				__wjs__set_height_(objAll[i]);
			}
		}
	}
	function __wjs__set_height_(obj){
		max_height=0;
		chobj_list = obj.childNodes;
		for(var j = 0; j < chobj_list.length; j++){
			if(!chobj_list[j] || chobj_list[j].nodeType != 1){ continue; }
			chobj_list[j].style.height = 'auto';
			if(max_height < chobj_list[j].offsetHeight){
				max_height = chobj_list[j].offsetHeight;
			}
		}
		for(var j = 0; j < chobj_list.length; j++){
			if(!chobj_list[j].style){ continue; }
			var check_style;
			if(chobj_list[j].currentStyle){
				check_style = chobj_list[j].currentStyle;
			}else if(document.defaultView.getComputedStyle(chobj_list[j], '')){
				check_style = document.defaultView.getComputedStyle(chobj_list[j], '');
			}
			var new_height = max_height;
			if(check_style.paddingTop > 0){ new_height -= check_style.paddingTop.replace("px",""); }
			if(check_style.paddingBottom > 0){ new_height -= check_style.paddingBottom.replace("px",""); }
			if(check_style.borderTopWidth != 'medium'){
	 			if(check_style.borderTopWidth > 0){ new_height-= stylea.borderTopWidth.replace("px",""); }
			}
			if(check_style.borderBottomWidth != 'medium'){
	 			if(check_style.borderBottomWidth > 0){ new_height-= stylea.borderBottomWidth.replace("px",""); }
			}
			chobj_list[j].style.height =new_height+"px";
		}
	}
	function __wjs__add_event_(obj,event_name,func){
		try{
			obj.addEventListener(event_name,func,false);
		}catch(e){
			obj.attachEvent('on'+event_name,func);
		}
	}
	__wjs__add_event_(window, 'load', __wjs__height_uniform_);
	__wjs__add_event_(window, 'resize', __wjs__height_uniform_);
}

