/* Menu Event */
var basic_url = "/finweb/EN/";

/*function menuOver(id){
	var obj = document.getElementById("menu_btn_"+id);
	if (id != page){
		obj.className = "menu_btn_"+id+"_over";
	}
}
function menuOut(id){
	var obj = document.getElementById("menu_btn_"+id);
	if (id != page){
		obj.className = "menu_btn_"+id;
	}
}*/
function checkPage(){
//	var obj = document.getElementById("menu_btn_"+page);
//	obj.className = "menu_btn_"+page+"_select";
	//returnFlash();    //¼È®Éª`ÄÀ±¼
	renderResize();
}


/* Generate Flash */
var intervalID = 0;
var scene = null;
function returnFlash(){
//	var now 		= new Date();
//	var hour        = now.getHours();
//	var minute      = now.getMinutes();
	var changeScene;

	changeScene = finWeb.getTimeVersion(true);
	
	if (scene != changeScene){
		swfobject.embedSWF( basic_url + "/__eng__img__images/" + changeScene + ".swf", "flash_div", "100%", "1013", "8.0.0", false , false ,{wmode:"transparent", quality:"middle"});		
		clearInterval(intervalID);
		//intervalID = setTimeout(returnFlash, 10000);
		scene = changeScene;
	}
}
function renderResize(){
	var windowWidth = returnWidth();
	var absWidth;
	absWidth = (windowWidth < 1150) ? 1150 : windowWidth;

	var container = document.getElementById('container');
	container.style.width = absWidth+"px";

	//var flash_div = document.getElementById('flash_div');
	//flash_div.style.width = absWidth+"px";
	
	var header_top = document.getElementById('header_top');
	header_top.style.width = absWidth+"px";
	
	var header_menu = document.getElementById('header_menu');
	header_menu.style.width = (absWidth-57)+"px";
	
	var footer = document.getElementById('footer');
	footer.style.width = absWidth+"px";

	reloc();
}

function returnWidth() {
  var myWidth;
  if( typeof( window.innerWidth ) == 'number' ) {
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

function returnY(){
	if (typeof window.pageYOffset != 'undefined') { 
	  return window.pageYOffset; 
	} 
	else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { 
	  return document.documentElement.scrollTop; 
	} 
	else if (typeof document.body != 'undefined') { 
	  return document.body.scrollTop; 
	}
}
function returnX(){
	if (typeof window.pageXOffset != 'undefined') { 
	  return window.pageXOffset + window.innerWidth - 16;
	} 
	else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { 
	  return (document.documentElement.scrollLeft + document.documentElement.clientWidth); 
	} 
	else if (typeof document.body != 'undefined') { 
	  return (document.body.scrollLeft + document.body.clientWidth); 
	}
}

/* Float Box */
function reloc(){
//floatbox
	var objfloatbox = document.getElementById('floatbox');
	var x = returnX();
	var y = returnY();
	if (objfloatbox && x != "undefined")
	{
		objfloatbox.style.left = x - 137 + "px";
	}
	if (objfloatbox && y != "undefined")
	{
		objfloatbox.style.top = y + 200 + "px";
	}
	if( objfloatbox )
	{
		objfloatbox.style.display = "block";
	}
//logonfast
    var objlogonfast = document.getElementById('divlogonfast');
	if( objlogonfast )
	{
		objlogonfast.style.left = "0px";
	}	
	if (objlogonfast && y != "undefined")
	{
		objlogonfast.style.top = y + 125 + "px";
	}
	if( objlogonfast )
	{
		objlogonfast.style.display = "block";
	}
}
//document.onmousemove = reloc;


/* Mouse Event */
function mEvent(id, classname)
{
	var obj = document.getElementById(id);
	obj.className = classname;
}


/* DIV Effect */
function display(id, type)
{
	var obj = document.getElementById(id);
	obj.style.display = (obj.style.display == "none") ? "block" : "none";
}

/* Individal Function */
function research_menu(parentDivID, childDivID)
{
	var target = document.getElementById(childDivID);
	var obj = document.getElementById(parentDivID);
	//obj.className = (target.style.display == "block") ? childDivID + "_s" : childDivID;
	if (obj == null) return;
    var oldName = obj.className;
    var newName = (target.style.display == "block") ? childDivID + "_s" : childDivID;
    if (oldName != newName) {
        obj.className = newName;
    }
}

function research_quicklogin(parentDivID,childDivID)
{
    var target = document.getElementById(childDivID);
    var obj = document.getElementById(parentDivID);
    var oldName = obj.className;
    var newName = (target.style.display == "block") ? parentDivID + "_s" : parentDivID;
    if (oldName != newName) {
        obj.className = newName;
    }
}

/* Dreamweaver Behavior */
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}






/* Scroll */
var scrollTimer = 0;
function startScroll(id, direction)
{
	if (direction == "next")
	{
		scrollDown(id);
	}
	else if (direction == "prev")
	{
		scrollUp(id);
	}
}
function scrollDown(id)
{
	var obj = document.getElementById(id);
	obj.scrollTop += 10;
	scrollTimer = setTimeout("scrollDown('"+id+"')", 100);
}
function scrollUp(id)
{
	var obj = document.getElementById(id);
	obj.scrollTop -= 10;
	scrollTimer = setTimeout("scrollUp('"+id+"')", 100);
}
function stopScroll()
{
	clearTimeout(scrollTimer);
}




