﻿// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드, 스케일) YSS Style
function flashWrite(url,w,h,id,bg,vars,win, scale){

	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='scale' value="+scale+" />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' scale='"+scale+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	
	"</object>";

	// 플래시 코드 출력
	document.write(flashStr);

}

// 탭뷰1
function tab1(item,num)
{
 var str="";
 for(i=1; i<=num; i++){
  if(i<10) str = "tab1_"+i;
  else str = "tab1_"+i;
  document.getElementById(str).style.display = "none";
 }
 document.getElementById(item).style.display = "";
}

// 토글메뉴
function ShowContent(MenuName, ShowMenuID) {
	var i=1;
	while(document.getElementById(MenuName + i)){
		var menu=document.getElementById(MenuName + i).style;
		
		if ( i == ShowMenuID ) {
		
			if (menu.display=='block')
			{
				//menu.display='none';
			} else {
				menu.display='block';
			}
		} else {
			menu.display='none';
		}
	i++;
	
	}
}

// 미니 레이어 팝업
function mpop(MenuName, ShowMenuID) {
	var i=1;
	while(document.getElementById(MenuName + i)){
		var menu=document.getElementById(MenuName + i).style;
		if ( i == ShowMenuID ) {
		
			if (menu.display=='block')
			{
				menu.display='none';
			} else {
				menu.display='block';
			}
		} else {
			menu.display='none';
		}

	i++;
	}
}

//Show Hide
function show(item,num)
{
 var str="";
 for(i=1; i<=num; i++){
  str = "item_"+i;
 document.getElementById(item).style.display = "";
}}
function hide(item,num)
{
 var str="";
 for(i=1; i<=num; i++){
  str = "item_"+i;
 document.getElementById(item).style.display = "none";
}}

// 팝업 설정
function pcenter_s_yes(theURL, name,  width, height ){
  var x = (screen.width) ? (screen.width-width)/2 : 0;
  var y = (screen.height) ? (screen.height-height)/2 : 0;  
  var pop = window.open(theURL,name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",left="+x+",top="+y);
  pop.focus
}

function pcenter_s_no(theURL, name,  width, height ){
  var x = (screen.width) ? (screen.width-width)/2 : 0;
  var y = (screen.height) ? (screen.height-height)/2 : 0;  
  var pop = window.open(theURL,name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",left="+x+",top="+y);
  pop.focus
}

function pcenter_s_yes_menu(theURL, name,  width, height ){
  var x = (screen.width) ? (screen.width-width)/2 : 0;
  var y = (screen.height) ? (screen.height-height)/2 : 0;  
  var pop = window.open(theURL,name,"toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+width+",height="+height+",left="+x+",top="+y);
  pop.focus
}

// Fly Quick
function initRpMoving4Main( target, topPosition, topLimit, btmLimit ) {
    if ( ! target  )
    return false;
    var obj = target;
    obj.initTop = topPosition;
    obj.topLimit = topLimit;
    obj.bottomLimit = document.documentElement.scrollHeight  - btmLimit;
    obj.style.position = "absolute";
    obj.top  = obj.initTop;
    obj.left  = obj.initLeft;
    obj.style.top  = obj.top + "px";
    obj.getTop =  function() {
        if ( document.documentElement.scrollTop ) {
            return document.documentElement.scrollTop;
        }
        else if ( window.pageYOffset ) {
            return window.pageYOffset;
        }
        else {
            return 0;
        }
    }
    obj.getHeight =  function() {
        if ( self.innerHeight ) {
            return self.innerHeight;
        }
        else if( document.documentElement.clientHeight ) {
            return document.documentElement.clientHeight;
        }
        else {
            return 500;
        }
    }
    obj.move =  setInterval( function() {
        pos = obj.getTop() + 200; // for Ie 7 , delete 10
        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 )
}
/*
var area_gnb;
function gnb_out(){
  area_gnb = setTimeout("document.getElementById('area_gnb').className='area-gnb-off'", 1000);
}
function gnb_on(){
  clearTimeout(area_gnb);
  document.getElementById('area_gnb').className='area-gnb-on';
}
*/
function docu3days() {
    //var a = pcenter_s_no('../etc/popup/20090612/20090612.html','docu3days','390','470');
    //var a = pcenter_s_no('../etc/popup/20090601/20090601.html','popup','483','624');
    //a.focus();
    
    /*팝업창을 띄울경우 이 주석을 풀어주세요
    var strUrl = "../etc/popup/20090612/20090612.html";
    x = (screen.availWidth - 1014) / 2;
    y = (screen.availHeight - 700) / 2;
    var cmswin = window.open(strUrl, "CmsPage", "left=0,top=0,width=390,height=470,resizable=0, left="+x+", top="+y+"" );
    cmswin.focus();
    */
    location.href = "http://www.karts.ac.kr/karts/board/detailNotice.jsp?c_no=001005001002&page=1&b_no=9926017&bt_no=14&searchSelectNotice=&keywordNotice=&categoryid=";
}
function OpenCmsPhotoPage()
{
    var strUrl = "http://dais.karts.ac.kr/admin/ReqSSO.asp";
    x = (screen.availWidth - 1014) / 2;
    y = (screen.availHeight - 700) / 2;
    var cmswin = window.open(strUrl, "CmsPage", "left=0,top=0,width=1014,height=700,fullscreen=2,resizable=0, left="+x+", top="+y+"" );
    cmswin.focus();
}
//SSL을 위한 부분
function flashWriteSsl(url,w,h,id,bg,vars,win, scale){

	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='scale' value="+scale+" />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' scale='"+scale+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='https://www.macromedia.com/go/getflashplayer' />"+
	
	"</object>";

	// 플래시 코드 출력
	document.write(flashStr);

}
//웹진에서 사용
function popupWindow(url, w, h) {
        var posX = (screen.width - w) / 2;
        var posY = (screen.height - h) / 2;
        var option = ",resizable=no,scrollbars=auto,status=no";
        window.open(url, "new_win","width="+w+",height="+h+",left="+posX +",top="+posY+option);
}
