
/*************************************************
* 내 용  : 공통 스크립트
* 작성자 : 이 현 우
* 날 짜  : 2010-01-29
**************************************************/
// flash
function call_flash(url, width,height,text) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" title="'+text+'" id=ShockwaveFlash1>')
	document.write('<param name="movie" value="'+url+'" />')
	document.write('<param name="quality" value="high" />')
	document.write('<param name="wmode" value="transparent" />')
	document.write('<object type="application/x-shockwave-flash" data="'+url+'" width="'+width+'" height="'+height+'">')
	document.write('<param name="wmode" value="transparent" />')
	document.write('</object></object>')

}

// board_view()
function board_view(num) {	

	for( i = 1 ; i <= 3 ; i++){
		document.getElementById("m_board_" + i).style.display = "none";
	}		
	document.getElementById("m_board_" + num).style.display = "block";	
}
function board_view1(num) {	

	for( i = 1 ; i <= 4 ; i++){
		document.getElementById("m_board1_" + i).style.display = "none";
	}		
	document.getElementById("m_board1_" + num).style.display = "block";	
}

// mlife_view(num)
function mlife_view(num) {	

	for( i = 1 ; i <= 5 ; i++){
		document.getElementById("mlife_0" + i).style.display = "none";
	}		
	document.getElementById("mlife_0" + num).style.display = "block";	
}

// menu_view
function menu_view(num) {	

	for( i = 1 ; i <= 6 ; i++){
		document.getElementById("sub" + i).style.display = "none";
	}		
	document.getElementById("sub" + num).style.display = "block";	
}


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_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_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];}
}


// 점프메뉴	
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) 
{
toolbar_str = toolbar ? 'yes' : 'no'; 
menubar_str = menubar ? 'yes' : 'no'; 
statusbar_str = statusbar ? 'yes' : 'no'; 
scrollbar_str = scrollbar ? 'yes' : 'no'; 
resizable_str = resizable ? 'yes' : 'no'; 
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); 
} 

// 팝업창 공통
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function thisclose()
{
	this.close();
}



// qick menu
 function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 400;
		}
	}

	obj.move = setInterval(function() {
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}

		if (pos > obj.bottomLimit)
			pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	}, 30)
}




// 이미지 오버1
function changeImage1(image, text) { 

	this.document.forgist.cyber.src ='../images/about/'+image;
	this.document.forgist.cyber.alt = text;
}
// 이미지 오버2
function changeImage2(image, text) { 

	this.document.forgist.cyber1.src ='../images/about/'+image;
	this.document.forgist.cyber1.alt = text;
}
// 이미지 오버3
function changeImage3(image,text) { 

	this.document.forgist.picture.src ='../images/'+image;
	this.document.getElementById("picture1").innerText =text;
	this.document.getElementById("current_picture").alt = text;
}


//동영상 스크립트
function MakeObjectMovie2(byPath,byWidth,byHeight) {
	document.write('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="MediaPlayer1" name="MediaPlayer1" width="'+byWidth+'" height="'+byHeight+'" style="visibility: block">');
	document.write('  <param name="AutoSize" value="0">');
	document.write('  <!-- 0 이면 크기고정, 1이면 자동으로 크기를 조절함.-->');
	document.write('  <param name="AutoStart" value="0">');
	document.write('  <!--1이면 자동으로 플레이 됨, 0이면 버튼을 눌러야 됨. -->');
	document.write('  <param name="AutoRewind" value="1">');
	document.write('  <!-- 1이면 자동으로 되감기 됨 -->');
	document.write('  <param name="ClickToPlay" value="0">');
	document.write('  <!-- 1이면 마우스 클릭하면 재생과 일시정지됨-->');
	document.write('  <param name="Enabled" value="1">');
	document.write('  <!-- 1이면 기능버튼 사용가능하고, 0이면 사용이 불가능함. -->');
	document.write('  <param name="ShowTracker" value="0">');
	document.write('  <!-- 1이면 재생되는 트랙의 상황을 보여줌.-->');
	document.write('  <param name="EnableTracker" value="0">');
	document.write('  <!-- 0이면 트랙에서 슬라이드바 사용안됨. -->');
	document.write('  <param name="EnableContextMenu" value="1">');
	document.write('  <!-- 1이면 마우스 오른쪽버튼으로 단축메뉴 호출이 가능함. -->');
	document.write('  <param name="ShowStatusBar" value="0">');
	document.write('  <!-- 1이면 하단에 있는 상태바를 보여줌 -->');
	document.write('  <param name="ShowControls" value="0">');
	document.write('  <!-- 1이면 재생 및 정지 등의 콘트롤패널을 보여 줌. -->');
	document.write('  <param name="ShowAudioControls" value="1">');
	document.write('  <!-- 1이면 볼륨조절기 보임. -->');
	document.write('  <param name="ShowCaptioning" value="0">');
	document.write('  <!-- 1이면 캡션창이 보인다. -->');
	document.write('  <param name="Mute" value="0">');
	document.write('  <!-- 1이면 소리나지 않음 -->');
	document.write('  <param name="ShowDisplay" value="0">');
	document.write('  <!-- 1이면 클립, 만든이, 저작권의 정보를 보여 줌. -->');
	document.write('  <param name="Filename" value="'+byPath+'">');
	document.write('  <!--Value뒤에 재생할 파일명을 적어 준다-->');
	document.write('</object>');
}
function play_movie() {
	MediaPlayer1.play();
}
function pause_movie() {
	MediaPlayer1.pause();
}
function stop_movie() {
	MediaPlayer1.stop();
}





/*************************************************************************
* Scrolling Top Button				ex) InitializeStaticMenu();
*************************************************************************/
/**
// 스크롤메뉴의 좌측 위치 
var stmnGAP1 = 120;
// 페이지 헤더부분의 여백 
var stmnGAP2 = 100;
// 스크롤시 브라우저 상단과 약간 띄움. 필요없으면 0으로 세팅 
var stmnBASE = 50;
// 스크롤메뉴 초기 시작위치 (아무렇게나 해도 상관은 없지만 stmnGAP1과 약간 차이를 주는게 보기 좋음) 
var stmnActivateSpeed = 200;
// 움직임을 감지하는 속도 (숫자가 클수록 늦게 알아차림) 
var stmnScrollSpeed = 2;
// 스크롤되는 속도 (클수록 늦게 움직임) 
var stmnBOTTOMGAP = 0;
// 풋터 영역 지정
var stmnTimer;
var divM=document.getElementById("quick")
function RefreshStaticMenu() {
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
	stmnStartPoint = parseInt(divM.style.top, 10);
	stmnEndPoint = document.body.scrollTop+stmnGAP2;
	stmnLimit = parseInt(window.document.body.scrollHeight)-parseInt(divM.offsetHeight)-stmnBOTTOMGAP;
	if (stmnEndPoint>stmnLimit) {
		stmnEndPoint = stmnLimit;
	}
	if (stmnEndPoint<stmnGAP1) {
		stmnEndPoint = stmnGAP1;
	}
	stmnRefreshTimer = stmnActivateSpeed;
	if (stmnStartPoint != stmnEndPoint) {
		stmnScrollAmount = Math.ceil(Math.abs(stmnEndPoint-stmnStartPoint)/15);
		divM.style.top = parseInt(divM.style.top, 10)+((stmnEndPoint<stmnStartPoint) ? -stmnScrollAmount : stmnScrollAmount);
		stmnRefreshTimer = stmnScrollSpeed;
	}
	stmnTimer = setTimeout("RefreshStaticMenu();", stmnRefreshTimer);
}
function OnScrollGen() {
	divM=document.getElementById("quick")
	divM.style.top = document.body.scrollTop+stmnBASE;
	RefreshStaticMenu();
}
function OnScrollGenMain() {
//	stmnGAP1 = 230;
//	stmnBASE = 230;
	divM=document.getElementById("quick")
	divM.style.top = document.body.scrollTop+stmnBASE;
	RefreshStaticMenu();
}*/

