var myid = 0;
/*==================================================================
window open 
================================================================== */
function winopen(url,winname,option){
	window.open(url,winname,option)
}

/*==================================================================
addEvent
================================================================== */

function addEvent(elm, evType, func, useCapture) {
	if (elm.addEventListener) {
		elm.addEventListener(evType, func, useCapture);
		return true;
	} else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, func);
		return r;
	} else {
		elm['on' + evType] = func;
	}
}

/*==================================================================
rollover 
================================================================== */
function initRollovers() {
	if (!document.getElementById) return;
	
	var overPath = "_on";	
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	
	/*
	var abody = document.getElementsByTagName('body');
	
	for(var i = 0; i< abody.length; i++){
		var pageId = abody[i].getAttribute('id');
		var pagenum = pageId.substr(6);
	}*/

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, overPath+ftype);
			//hsrc = 'over' + hsrc;

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				if(sTempSrc.split("_on")[1] != ".gif"){
					this.setAttribute('src', this.getAttribute('hsrc'));
				}
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace(overPath+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

addEvent(window, 'load', initRollovers, false);

/*==================================================================
submenu
================================================================== */
function init(key,flowid){
	if(key){
		var onpath = $(eval("'#side li:nth-child("+key+") img'")).attr("src").split(".gif");
		var newpath = onpath[0]+"_on.gif";
		$(eval("'#side li:nth-child("+key+") img'")).attr("src", newpath);
	}
	
	
	//flow
	if(flowid){
		if($(".flow li").length != 0){
			path = $(eval("'.flow li:nth-child("+flowid+") img'")).attr('src');
			newpath = path.split(".")[0]+"_on.gif";
			$(eval("'.flow li:nth-child("+flowid+") img'")).attr('src',newpath);
			//$(eval("'.flow li#solsnavi"+id+"'")).addClass('selected');
		}
		
	}
	if(navigator.userAgent.indexOf("Safari") == -1){
		if($("table.listTbl").length != 0){
			cnt = $("table.listTbl").length;
			for(var i=0; i<cnt; i++){
				tblH = $("table.listTbl").eq(i).height();
				tdH = tblH / 2;
				$(".btnTbl").eq(i).height(tblH);
			}
				/*path = $(eval("'.listTbl:nth-child("+flowid+") img'")).attr('src');
				newpath = path.split(".")[0]+"_on.gif";
				$(eval("'.flow li:nth-child("+flowid+") img'")).attr('src',newpath);
				*///$(eval("'.flow li#solsnavi"+id+"'")).addClass('selected');
		}
	}
	
}


