/**************************
	¸µÅ©ºÎºÐ ¼±ÅÃÇ¥½Ã ¾ø¾Ö±â
**************************/
function allBlur() {
	for (i = 0; i < document.links.length; i++){
		document.links[i].onfocus = document.links[i].blur;
	}
}

/**************************
	Right Wing Start
**************************/
var stmnBASE = -200;
var stmnGAP = 115;
var stmnRIGHT = -200;
var stmnBTTM = 500;
var stmnActivateSpeed = 100;
var stmnScrollSpeed = 2;
var stmnTimer;
var bMove = 1;


function RefreshRightWing() {

	if (!bMove) return

	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
	stmnStartPoint = parseInt(rightWing.style.top, 10);
	stmnEndPoint = document.body.scrollTop + stmnGAP;

	if (stmnEndPoint < stmnBASE) stmnEndPoint = stmnBASE;
	stmnRefreshTimer = stmnActivateSpeed;
	if ( stmnStartPoint != stmnEndPoint && stmnEndPoint <= (document.body.scrollHeight - stmnBTTM) ) {
		stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
		rightWing.style.top = parseInt(rightWing.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		stmnRefreshTimer = stmnScrollSpeed;
	}
	stmnTimer = setTimeout ("RefreshRightWing();", stmnRefreshTimer);
}


function InitializerightWing() {
	if ( document.body.scrollHeight < 500 ) return;
	rightWing.style.display = "inline";
	if ( stmnBASE = -200 ) stmnBASE = rightWing.offsetTop;
	if ( stmnBASE <= 0 ) stmnBASE = 115;
	rightWing.style.top = stmnBASE;
	rightWing.style.RIGHT = stmnRIGHT;
	RefreshRightWing();
}

/**************************
	Å¾¸Þ´º_¼­ºê¸Þ´º
**************************/
if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.topSubmenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
        if(document.getElementById){
        var el = document.getElementById(obj);
        var ar = document.getElementById("topMenu").getElementsByTagName("span");
                if(el.style.display != "block"){
                        for (var i=0; i<ar.length; i++){
                                if (ar[i].className=="topSubmenu")
                                ar[i].style.display = "none";
                        }
                        el.style.display = "block";
                }else{
                        el.style.display = "none";
                }
        }
}

/**************************
	topmenu function start
**************************/
function MM_findObj(n, d) { //v3.0
  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); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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];}
}

/**************************
	Ã¢´Ý±â
**************************/
function closing() {
	self.close();
}

/**************************
	ÇÁ¸°Æ®
**************************/
function printing() {
	self.print();
}

/**************************
	ÆË¾÷Ã¢ ¶ç¿ì±â
**************************/
function OpenWin(url,w,h) {
	window.open (url,"win",'toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + w +',height=' + h + "'");
}
function OpenWin2(url,w,h) {
	window.open (url,"win",'toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + w +',height=' + h + "'");
}
function OpenWin3(url,n,w,h) {
	window.open (url,n,'toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + w +',height=' + h + "'");
}

/**************************
	¿À¸¥ÂÊ³¯°³


if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.rightSub{display: none;}\n')
document.write('</style>\n')
}
**************************/

function ShowRightMenu(obj) {
	switch (obj)	{
		case "0" :
			document.all.rightDiv[0].style.visibility = "hidden";
			document.all.rightDiv[1].style.visibility = "visible";
			break;

		case "1" :
			document.all.rightDiv[0].style.visibility = "visible";
			document.all.rightDiv[1].style.visibility = "hidden";
			break;
	}
}

function showCalendar(iPos) {
	cPos = iPos;
	switch (cPos) {
		case "start":
			calendar.style.setExpression("left","document.body.clientWidth/2-calendar.offsetWidth/2+46");
			calendar.style.setExpression("top","323");
			break;
		case "end":
			calendar.style.setExpression("left","document.body.clientWidth/2-calendar.offsetWidth/2+161");
			calendar.style.setExpression("top","323");
			break;
	}

	document.all.calendar.style.visibility="visible";
}

function closeLayer() {
	document.all.calendar.style.visibility="hidden";
}


var Loc = "" ;
function LocationFamily(form){
	Loc = form.family.value;
	if(form.family.value!="") {
		window.location.href = form.family.value;
	}
}

var Loc2 = "" ;
function LocationFamily2(form){
	Loc = form.family2.value;
	if(form.family2.value!="") {
		window.location.href = form.family2.value;
	}
}

function nextFocus(obj1, num, obj2) {
	if(obj1.value.length >= num) obj2.focus();
}
