//set height for SideMenuDiv
$(document).ready(function(){
	var contentH = $("#content").height();
	var sideH = $("#side").height();
	if(sideH<contentH){
		$("#side p.text").css("position","absolute");
		$("#side").height(contentH);
	}

	//add Link in Global Menu
	var filePath = {"01":"./","02":"./","03":"./","04":"./","05":"./","06":"./contact.html"};//{fileNameNum:Path}
	$("ul#menu li img").each(function(){
		var fileName = $(this).attr("src");
		var chkFile = fileName.indexOf("_o",0);
		if(chkFile>0){
			var filePathNum = fileName.match(/[0-9]+/);
			var tagImg = $(this).parent().html();
			var htmlStr = '<a href="'+filePath[filePathNum]+'">'+tagImg+'</a>';
			$(this).parent().html(htmlStr);
		}
	});
	
	//add BCP Award
	var bcpHTML = '<li class="bcp"><a href="/crisis_management.html#bcp"><img src="/images/common/banner_bcp.jpg" alt="BCP" class="imgover" /></a></li>';
	$('ul.banner-unit').append(bcpHTML);
	
	if($("#content-side").length){
		adjustHeight();
	}
	
});


// Height Adjustment
function adjustHeight(){
	var sideH = $("#content-side").height();
	var bodyH = $("#content-body-double").height();
	if(sideH<bodyH){
		$("#content-side").height(bodyH);
	}else{
		$("#content-body").height(sideH);
	}
}

// Jump Menu
function jumpMenu(objId,targ,restore){ //v9.0
	//alert(objId+":"+targ+":"+restore);
  var selObj = null;  with (document) { 
  if (getElementById) selObj = getElementById(objId);
		var valStr = encodeURI(selObj.options[selObj.selectedIndex].value);
	if(valStr){
		if (selObj) eval(targ+".location='"+'archive/?'+objId+'='+valStr+"'");
		if (restore) selObj.selectedIndex=0; }
	}
}

// only using for TopPage
function forTop(){
	var customerH = new Array();
	customerH[0] = $("li.customer1 span").height();
	customerH[1] = $("li.customer2 span").height();
	customerH[2] = $("li.customer3 span").height();
	var maxH = customerH.sort().pop();
	$("ul.customer-list li span").height(maxH);
}

// only using for RecruitPage
function forRecruit(){
	var customerH = new Array();
	customerH[0] = $("li.job01").height();
	customerH[1] = $("li.job02").height();
	customerH[2] = $("li.job03").height();
	customerH[3] = $("li.job04").height();
	var maxH = customerH.sort().pop();
	$("div.job ul li").height(maxH);
}

function popUpWin(winFile,winW,winH){
		var winOption = 'width='+winW+', height='+winH+', menubar=no, toolbar=no, scrollbars=yes';
		window.open(winFile,'',winOption);
}
