﻿/*********************************************************
* goMenu URL 정의
*********************************************************/

/* 01_정보공간 */
var goURL10 = "/info/sports.asp";
var goURL11 = "/info/sports.asp";
var goURL111 = "/info/sports1.asp";
var goURL12 = "/info/special_sports01.asp";
var goURL121 = "/info/special_sports02.asp";
var goURL122 = "/info/sports_item.asp";
var goURL123 = "/info/certificate_main.aspx?pageNum=12";
var goURL13 = "/info/international.asp";	// 국제스포츠교류
var goURL131 = "/info/committee.asp";
var goURL14 = "/info/athletic.asp";  // 국내대회정보
var goURL141 = "/info/winter_athletic.asp";
var goURL142 = "/info/young_athletic.asp";
var goURL15 = "/info/paralympic.asp";  // 국제대회정보
var goURL151 = "/info/asia_paralympic.asp";
var goURL152 = "/info/youngboy.asp";
var goURL153 = "/info/deaf.asp";
var goURL154 = "/info/special.asp";
var goURL16 = "/info/history.asp";  // 장애인체육사

/* 02_알림공간 */
var goURL20 = "/board/board.aspx?id=notice&open=1&pageNum=21";
var goURL21 = "/board/board.aspx?id=notice&open=1&pageNum=21";
var goURL22 = "/board/board.aspx?id=news&open=1&pageNum=22";
var goURL23 = "/board/board.aspx?id=announce&open=1&pageNum=23";
var goURL24 = "/board/board.aspx?id=pds&open=1&pageNum=24";
var goURL25 = "/news/match_list.aspx?pageNum=25";
var goURL26 = "/news/webzinelist.aspx?pageNum=26";
var goURL27 = "/news/newsletterlist.aspx?pageNum=26";
var goURL28 = "/board/board.aspx?id=docpds&open=1&pageNum=24";
var goURL29 = "/board/board.aspx?id=announceorgan";
var goURL291 = "/board/board.aspx?id=announceorgan2";

/* 03_참여공간 */
/*
var goURL30 = "/participation/partMain.aspx?pageNum=31";
var goURL31 = "/participation/partMain.aspx?pageNum=31";
*/
var goURL30 = "/participation/application_main.aspx?pageNum=34";
var goURL32 = "/board/board.aspx?id=Proposal&open=1&pageNum=32";
var goURL33 = "/board/board.aspx?id=HomeReform&open=1&pageNum=33";
var goURL34 = "/participation/application_main.aspx?pageNum=34";
var goURL35 = "/board/board.aspx?id=Freeboard&open=1&pageNum=35";

/* 04_열린공간 */
var goURL40 = "/public/blog.aspx?pageNum=41";
var goURL41 = "/public/blog.aspx?pageNum=41";
var goURL411 = "/board/board.aspx?id=BlogIssue&open=1&pageNum=41";
var goURL412 = "/board/board.aspx?id=BlogImagine&open=1&pageNum=41";
var goURL413 = "/board/board.aspx?id=BlogHuman&open=1&pageNum=41";
//var goURL42 = "/public/community.asp";
var goURL43 = "/board/board.aspx?id=Photo&open=1&pageNum=43";
var goURL44 = "/board/board.aspx?id=Movie&open=1&pageNum=43";
var goURL45 = "/board/board.aspx?id=Freeboard&open=1&pageNum=44";

/* 05_시/도장애인체육회 */
var goURL50 = "/sido/homepage.asp";
var goURL51 = "/sido/homepage.asp";
var goURL52 = "/sido/public_notice01.asp";
var goURL53 = "/board/board.aspx?id=Official1&open=1&pageNum=53";
/*
var goURL522 = "/board/board.aspx?id=Official2&open=1&pageNum=52";
var goURL523 = "/board/board.aspx?id=Official3&open=1&pageNum=52";
var goURL524 = "/board/board.aspx?id=Official4&open=1&pageNum=52";
*/

/* 06_가맹단체 */
var goURL60 = "/organ/homepage.asp";
var goURL61 = "/organ/homepage.asp";
var goURL62 = "/organ/public_notice.aspx?pageNum=62";
var goURL63 = "/board/board.aspx?id=Family&open=1&pageNum=63";
var goURL64 = "/organ/record.asp";

/* 07_대한장애인체육회./대한장애인올림픽위원회 */
var goURL70 = "/kosad/greeting.asp";  // 기관소개
var goURL71 = "/kosad/greeting.asp";
var goURL712 = "/kosad/object.asp";
var goURL713 = "/kosad/organization_chart.asp";
var goURL714 = "/kosad/official.asp";
var goURL715 = "/kosad/ci.asp";
var goURL72 = "/kosad/main_project.asp";  // 주요사업
var goURL721 = "/kosad/main_project.asp";
var goURL722 = "/kosad/main_project_01.asp";
var goURL723 = "/kosad/main_project_02.asp";
var goURL724 = "/kosad/main_project_03.asp";
var goURL725 = "/kosad/main_project_04.asp";
var goURL73 = "/kosad/DepartmentList.aspx?pageNum=73";  // 부서안내
var goURL74 = "/kosad/public_notice01.asp";  // 경영공시
var goURL741 = "/kosad/public_notice01.asp"; 
var goURL742 = "/kosad/public_notice02.asp";
var goURL743 = "/board/board.aspx?id=Official5&open=1&pageNum=74"; 

var goURL744 = "/kosad/public_notice04.asp";
var goURL745 = "/board/board.aspx?id=Official6&open=1&pageNum=74"; 
var goURL75 = "/kosad/regulations.asp";  // 관련규정
var goURL76 = "/kosad/management.asp";  // 열린경영
var goURL761 = "/kosad/customer_manage.asp";  
var goURL77 = "/kosad/location.asp";  // 오시는길

/* 08_회원서비스 */
var goURL80 = "/regist/chk_member.aspx?pageNum=00";
var goURL81 = "/regist/chk_member.aspx?pageNum=00";
var goURL82 = "/regist/login.aspx?modify=1&pageNum=00";
var goURL83 = "/regist/find_id.aspx?pageNum=00";
var goURL84 = "/regist/find_pw.aspx?pageNum=00";
var goURL85 = "/regist/UserModify.aspx?pageNum=00";
var goURL86 = "/regist/withdrawal.aspx";

var goURL91 = "/AllBanner.aspx";

    
/* TOP메뉴들 */
var goURL100 = "/default.aspx"
//var goURL101 = "/regist/chk_member.aspx?pageNum=00"
var goURL101 = "/sitemap/sitemap.asp"
var goURL102 = "/english"
var goURL103 = "/english"
var goURL200 = "/regist/login.aspx?mode=login&pageNum=00";
var goURL201 = "/regist/login.aspx?mode=logout&pageNum=00";
var goURL202 = "/regist/chk_member.aspx?pageNum=00";
var goURL203 = "/regist/UserModify.aspx?pageNum=00";

var goURL210 ="http://ucc.kosad.or.kr" // UCC

//var goURL90 = "/sitemap/sitemap.asp";

function goMenu(str) {
    var setUrl = eval("goURL" + str);

     //페이지 코드 추가
/*
    if (setUrl.toString().indexOf("?") > 0) {
        setUrl = setUrl + '&p=' + str;
    } else {
        setUrl = setUrl + '?p=' + str;
    }
*/    
    	if (str == '102') window.open("/english");
		else if (str == '210') window.open("http://ucc.kosad.or.kr");
		else
			location.href = setUrl;
   }


// 쿠키 관련 함수

// name = string equal to the name of the instance of the object
// defaultExpiration = number of units to make the default expiration date for the cookie
// expirationUnits = 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' (default is 'days')
// defaultDomain = string, default domain for cookies; default is current domain minus the server name
// defaultPath = string, default path for cookies; default is '/'
function Cookiemanager(name, defaultExpiration, expirationUnits, defaultDomain, defaultPath) {
// remember our name
this.name = name;
// get the default expiration
this.defaultExpiration = this.getExpiration(defaultExpiration, expirationUnits);
// set the default domain to defaultDomain if supplied; if not, set it to document.domain
// if document.domain is numeric, otherwise strip off the server name and use the remainder
this.defaultDomain = (defaultDomain) ? defaultDomain : (document.domain.search(/[a-zA-Z]/) == -1) ? document.domain : document.domain.substring(document.domain.indexOf('.') + 1, document.domain.length);
// set the default path
this.defaultPath = (defaultPath) ? defaultPath : '/';
// initialize an object to hold all the document's cookies
this.cookies = new Object();
// initialize an object to hold expiration dates for the doucment's cookies
this.expiration = new Object();
// initialize an object to hold domains for the doucment's cookies
this.domain = new Object();
// initialize an object to hold paths for the doucment's cookies
this.path = new Object();
// set an onlunload function to write the cookies
window.onunload = new Function(this.name + '.setDocumentCookies();');
// get the document's cookies
this.getDocumentCookies();
}
// gets an expiration date for a cookie as a GMT string
// expiration = integer expressing time in units (default is 7 days)
// units = 'miliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' (default is 'days') 
Cookiemanager.prototype.getExpiration = function(expiration, units) {
// set default expiration time if it wasn't supplied
expiration = (expiration) ? expiration : 7;
// supply default units if units weren't supplied
units = (units) ? units : 'days';
// new date object we'll use to get the expiration time
var date = new Date();
// set expiration time according to units supplied
switch (units) {
	case 'years':
		date.setFullYear(date.getFullYear() + expiration);
		break;
	case 'months':
		date.setMonth(date.getMonth() + expiration);
		break;
	case 'days':
		date.setTime(date.getTime() + (expiration * 24 * 60 * 60 * 1000));
		break;
	case 'hours':
		date.setTime(date.getTime() + (expiration * 60 * 60 * 1000));
		break;
	case 'minutes':
		date.setTime(date.getTime() + (expiration * 60 * 1000));
		break;
	case 'seconds':
		date.setTime(date.getTime() + (expiration * 1000));
		break;
	default:
		date.setTime(date.getTime() + expiration);
		break;
}
// return expiration as GMT string
return date.toGMTString();
}
// gets all document cookies and populates the .cookies property with them
Cookiemanager.prototype.getDocumentCookies = function() {
var cookie, pair;
// read the document's cookies into an array
var cookies = document.cookie.split(';');
// walk through each array element and extract the name and value into the cookies property
var len = cookies.length;
for (var i = 0; i < len; i++) {
	cookie = cookies[i];
	// strip leading whitespace
	while (cookie.charAt(0) == ' ') cookie = cookie.substring(1, cookie.length);
	// split name/value pair into an array
	pair = cookie.split('=');
	// use the cookie name as the property name and value as the value
	this.cookies[pair[0]] = pair[1];
}
}
// sets all document cookies
Cookiemanager.prototype.setDocumentCookies = function() {
var expires = '';
var cookies = '';
var domain = '';
var path = '';
for (var name in this.cookies) {
	// see if there's a custom expiration for this cookie; if not use default
	expires = (this.expiration[name]) ? this.expiration[name] : this.defaultExpiration;
	// see if there's a custom path for this cookie; if not use default
	path = (this.path[name]) ? this.path[name] : this.defaultPath;
	// see if there's a custom domain for this cookie; if not use default
	domain = (this.domain[name]) ? this.domain[name] : this.defaultDomain;
	// add to cookie string
	cookies = name + '=' + this.cookies[name] + '; expires=' + expires + '; path=' + path + '; domain=' + domain;
	document.cookie = cookies;
}
return true;
}
// gets cookie value
// cookieName = string, cookie name
Cookiemanager.prototype.getCookie = function(cookieName) {
var cookie = this.cookies[cookieName];

return (cookie) ? cookie : false;
}
// stores cookie value, expiration, domain and path
// cookieName = string, cookie name
// cookieValue = string, cookie value
// expiration = number of units in which the cookie should expire
// expirationUnits = 'miliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' (default is 'days')
// domain = string, domain for cookie
// path = string, path for cookie
Cookiemanager.prototype.setCookie = function(cookieName, cookieValue, expiration, expirationUnits, domain, path) {
this.cookies[cookieName] = cookieValue;
// set the expiration if it was supplied 
if (expiration) this.expiration[cookieName] = this.getExpiration(expiration, expirationUnits);
// set path if it was supplied
if (domain) this.domain[cookieName] = domain;
if (path) this.path[cookieName] = path;
return true;
}

var cookieManager = new Cookiemanager('cookieManager', 1, 'years');



// 폰트사이즈 관련 함수

/*
To implement this script in your Web page, configure this file as
shown below, then put this file on your Web server.

Next, insert the following at the beginning of the <head> section
of your Web page:

	<script type="text/javascript" language="JavaScript1.2" src="[path]fun_fontsize.js"></script>

where [path] is the path to this file on your server.

Insert the following right after the <body> tag:

	<script type="text/javascript" language="JavaScript1.2">
if (efa_fontSize) efa_fontSize.efaInit();
</script>

Finally, insert the following where you wish the links to change the
text size to appear: 

	<script type="text/javascript" language="JavaScript1.2">
if (efa_fontSize) document.write(efa_fontSize.allLinks);
</script>
*/

/*
fun_increment = percentage by which each click increases/decreases size
fun_bigger = array of properties for 'increase font size' link
fun_reset = array of properties for 'reset font size' link
fun_smaller = array of properties for 'decrease font size' link

properties array format:
['before HTML',
'inside HTML',
'title text',
'class text',
'id text',
'name text',
'accesskey text',
'onmouseover JavaScript',
'onmouseout JavaScript',
'on focus JavaScript',
'after HTML'
]
*/

var efa_default = 100; 										//default text size as percentage of user default
var efa_increment = 20; 										//percentage to increase/decrease font size

var efa_bigger = ['Fontsizer: ', 				//HTML to go before 'bigger' link
			  'larger', 			//HTML to go inside 'bigger' anchor tag
			  '', 			//title attribute
			  '', 										//class attribute
			  '', 										//id attribute
			  '', 										//name attribute
			  '', 										//accesskey attribute
			  '', 										//onmouseover attribute
			  '', 										//onmouseout attribute
			  '', 										//onfocus attribute
			  ' | '											//HTML to go after 'bigger' link
			  ]

var efa_reset = ['',
			 'standard', 			//HTML to go before 'reset' link
			 '', //HTML to go inside 'reset' anchor tag
			  '', 										//class attribute
			  '', 										//id attribute
			  '', 										//name attribute
			  '', 										//accesskey attribute
			  '', 										//onmouseover attribute
			  '', 										//onmouseout attribute
			  '', 										//onfocus attribute
			  ' | '											//HTML to go after 'reset' link
			  ]

var efa_smaller = ['',
			   'smaller', 			//HTML to go before 'smaller' link
			   '', 						//HTML to go inside 'smaller' anchor tag
			   '', 										//class attribute
			   '', 										//id attribute
			   '', 										//name attribute
			   '', 										//accesskey attribute
			   '', 										//onmouseover attribute
			   '', 										//onmouseout attribute
			   '', 										//onfocus attribute
			   ''									//HTML to go after 'smaller' link
			   ]

function Efa_Fontsize(increment, bigger, reset, smaller, def) {
// check for the W3C DOM
this.w3c = (document.getElementById);
// check for the MS DOM
this.ms = (document.all);
// get the userAgent string and normalize case
this.userAgent = navigator.userAgent.toLowerCase();
// check for Opera and that the version is 7 or higher; note that because of Opera's spoofing we need to
// resort to some fancy string trickery to extract the version from the userAgent string rather than
// just using appVersion
this.isOldOp = ((this.userAgent.indexOf('opera') != -1) && (parseFloat(this.userAgent.substr(this.userAgent.indexOf('opera') + 5)) <= 7));
// check for Mac IE; this has been commented out because there is a simple fix for Mac IE's 'no resizing
// text in table cells' bug--namely, make sure there is at least one tag (a <p>, <span>, <div>, whatever)
// containing any content in the table cell; that is, use <td><p>text</p></td> or <th><span>text</span></th>
// instead of <td>text</td> or <th>text</th>; if you'd prefer not to use the workaround, then uncomment
// the following line:
// this.isMacIE = ((this.userAgent.indexOf('msie') != -1) && (this.userAgent.indexOf('mac') != -1) && (this.userAgent.indexOf('opera') == -1));
// check whether the W3C DOM or the MS DOM is present and that the browser isn't Mac IE (if above line is
// uncommented) or an old version of Opera
if ((this.w3c || this.ms) && !this.isOldOp && !this.isMacIE) {
	// set the name of the function so we can create event handlers later
	this.name = "efa_fontSize";
	// set the cookie name to get/save preferences
	this.cookieName = 'efaSize';
	// set the increment value to the appropriate parameter
	this.increment = increment;
	//default text size as percentage of user default
	this.def = def;
	//intended default text size in pixels as a percentage of the assumed 16px
	this.defPx = Math.round(16 * (def / 100))
	//base multiplier to correct for small user defaults
	this.base = 1;
	// call the getPrefs function to get preferences saved as a cookie, if any
	this.pref = this.getPref();
	// stuff the HTML for the test <div> into the testHTML property
	this.testHTML = '<div id="efaTest" style="position:absolute;visibility:hidden;line-height:1em;">&nbsp;</div>';
	// get the HTML for the 'bigger' link
	this.biggerLink = this.getLinkHtml(1, bigger);
	// get the HTML for the 'reset' link
	this.resetLink = this.getLinkHtml(0, reset);
	// get the HTML for the 'smaller' link
	this.smallerLink = this.getLinkHtml(-1, smaller);
	// set up an onlunload handler to save the user's font size preferences
} else {
	// set the link html properties to an empty string so the links don't show up
	// in unsupported browsers
	this.biggerLink = '';
	this.resetLink = '';
	this.smallerLink = '';
	// set the efaInit method to a function that only returns true so
	//we don't get errors in unsupported browsers
	this.efaInit = new Function('return true;');
}
// concatenate the individual links into a single property to write all the HTML
// for them in one shot
this.allLinks = this.biggerLink + this.resetLink + this.smallerLink;
}
// check the user's current base text size and adjust as necessary
Efa_Fontsize.prototype.efaInit = function() {
	// write the test <div> into the document
	document.writeln(this.testHTML);
	// get a reference to the body tag
	this.body = (this.w3c) ? document.getElementsByTagName('body')[0].style : document.all.tags('body')[0].style;
	// get a reference to the test element
	this.efaTest = (this.w3c) ? document.getElementById('efaTest') : document.all['efaTest'];
	// get the height of the test element
	var h = (this.efaTest.clientHeight) ? parseInt(this.efaTest.clientHeight) : (this.efaTest.offsetHeight) ? parseInt(this.efaTest.offsetHeight) : 999;
	// check that the current base size is at least as large as the browser default (16px) adjusted
	// by our base percentage; if not, divide 16 by the base size and multiply our base multiplier
	//  by the result to compensate
	if (h < this.defPx) this.base = this.defPx / h;
	// now we set the body font size to the appropriate percentage so the user gets the 
	// font size they selected or our default if they haven't chosen one
	this.body.fontSize = Math.round(this.pref * this.base) + '%';
}
// construct the HTML for the links; we expect -1, 1 or 0 for the direction, an array
// of properties to add to the <a> tag and HTML to go before, after and inside the tag
Efa_Fontsize.prototype.getLinkHtml = function(direction, properties) {
// declare the HTML variable and add the HTML to go before the link, the start of the link
// and the onclick handler; we insert the direction argument as a parameter passed to the
// setSize method of this object
var html = properties[0] + '<a style="cursor: hand;" onclick="efa_fontSize.setSize(' + direction + '); location.reload(); return false;"';
// concatenate the title attribute and value
html += (properties[2]) ? 'title="' + properties[2] + '"' : '';
// concatenate the class attribute and value
html += (properties[3]) ? 'class="' + properties[3] + '"' : '';
// concatenate the id attribute and value
html += (properties[4]) ? 'id="' + properties[4] + '"' : '';
// concatenate the name attribute and value
html += (properties[5]) ? 'name="' + properties[5] + '"' : '';
// concatenate the accesskey attribute and value
html += (properties[6]) ? 'accesskey="' + properties[6] + '"' : '';
// concatenate the onmouseover attribute and value
html += (properties[7]) ? 'onmouseover="' + properties[7] + '"' : '';
// concatenate the onmouseout attribute and value
html += (properties[8]) ? 'onmouseout="' + properties[8] + '"' : '';
// concatenate the title onfocus and value
html += (properties[9]) ? 'onfocus="' + properties[9] + '"' : '';
// concatenate the link contents, closing tag and any HTML to go after the link and return the
// entire string
return html += '>' + properties[1] + '<' + '/a>' + properties[10];
}
// get the saved preferences out of the cookie, if any
Efa_Fontsize.prototype.getPref = function() {
// get the value of the cookie for this object
var pref = this.getCookie(this.cookieName);
// if there was a cookie value return it as a number
if (pref) return parseInt(pref);
// if no cookie value, return the default
else return this.def;
}
// change the text size; expects a direction parameter of 1 (increase size), -1 (decrease size)
// or 0 (reset to default)
Efa_Fontsize.prototype.setSize = function(direction) {
// see if we were passed a nonzero direction parameter;
// if so, multiply it by the increment and add it to the current percentage size;
// if the direction was negative, it will reduce the size; if the direction was positive,
// it will increase the size; if the direction parameter is undefined or zero, reset
// current percentage to the default

this.pref = (direction) ? this.pref + (direction * this.increment) : this.def;
this.setCookie(this.cookieName, this.pref);
// set the text size
this.body.fontSize = Math.round(this.pref * this.base) + '%';
}
// get the value of the cookie with the name equal to a string passed as an argument
Efa_Fontsize.prototype.getCookie = function(cookieName) {
var cookie = cookieManager.getCookie(cookieName);
return (cookie) ? cookie : false;
}
// set a cookie with a supplied name and value
Efa_Fontsize.prototype.setCookie = function(cookieName, cookieValue) {
return cookieManager.setCookie(cookieName, cookieValue);
}

var efa_fontSize = new Efa_Fontsize(efa_increment, efa_bigger, efa_reset, efa_smaller, efa_default);

/* 글자크기 확대 */
function zoomIn() {
	efa_fontSize.setSize(1);
}

/* 글자크기 축소 */
function zoomOut() {
	efa_fontSize.setSize(-1);
}

/* 글자크기 Reset */
function reset() {
	efa_fontSize.setSize(0);
}

function resizewindow(d, v) {
	if (d.body.style.zoom == 0) {
		d.body.style.zoom = v;
	} else {
		d.body.style.zoom *= v;
	}
}

document.attachEvent("onkeydown", Shortcut);

function Shortcut() {
	if (event.keyCode == 117) {
		event.keyCode = 0;
		event.returnValue = false;
		event.cancelBubble = true;
		goMenu(10);
	}
	if (event.keyCode == 118) {
		event.keyCode = 0;
		event.returnValue = false;
		event.cancelBubble = true;
		goMenu(20);
	}
	if (event.keyCode == 119) {
		event.keyCode = 0;
		event.returnValue = false;
		event.cancelBubble = true;
		goMenu(30);
	}
	if (event.keyCode == 120) {
		event.keyCode = 0;
		event.returnValue = false;
		event.cancelBubble = true;
		goMenu(40);
	}
	if (event.keyCode == 121) {
		event.keyCode = 0;
		event.returnValue = false;
		event.cancelBubble = true;
		goMenu(50);
	}
	if (event.keyCode == 122) {
		event.keyCode = 0;
		event.returnValue = false;
		event.cancelBubble = true;
		goMenu(60);
	}
	if (event.keyCode == 123) {
		event.keyCode = 0;
		event.returnValue = false;
		event.cancelBubble = true;
		goMenu(70);
	}
}
