function flash(id, width, height){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
	+'<param name="movie" value="'+id+'">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="transparent">'
	+'<embed src="'+id+'" quality="high" pluginspage="" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash"></embed>'
	+'</object>');
}

function flashx(id, width, height){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
	+'<param name="movie" value="'+id+'">'
	+'<param name="quality" value="high">'
	+'<embed src="'+id+'" quality="high" pluginspage="" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash"></embed>'
	+'</object>');
}

function flashMainTop(log,movie,movie2){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1280" height="800" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
	+'<param name="movie" value="/flash/main.swf">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="transparent">'
	+'<param name="FlashVars" value="log='+log+'&movie='+movie+'&movie2='+movie2+'">'
	+'<embed src="/flash/main.swf" quality="high" pluginspage="" FlashVars="log='+log+'&movie='+movie+'&movie2='+movie2+'" width="1280" height="800" type="application/x-shockwave-flash"></embed>'
	+'</object>');
}

function flashSubTop(log, depth1,depth2){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1280" height="320" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
	+'<param name="movie" value="/flash/subTop.swf">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="transparent">'
	+'<param name="FlashVars" value="log='+log+'&depth1='+depth1+'&depth2='+depth2+'">'
	+'<embed src="/flash/subTop.swf" quality="high" pluginspage="" FlashVars="log='+log+'&depth1='+depth1+'&depth2='+depth2+'" width="1280" height="320" type="application/x-shockwave-flash"></embed>'
	+'</object>');
}

function flashSubMenu(depth1,depth2){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="200" height="500" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
	+'<param name="movie" value="/flash/subLeft.swf">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="transparent">'
	+'<param name="FlashVars" value="depth1='+depth1+'&depth2='+depth2+'">'
	+'<embed src="/flash/subLeft.swf" quality="high" pluginspage="" FlashVars="depth1='+depth1+'&depth2='+depth2+'" width="200" height="500" type="application/x-shockwave-flash"></embed>'
	+'</object>');
}

function flashmv(id, width, height){
	document.write('<object  id="myflash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
	+'<param name="movie" value="'+id+'">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="transparent">'
	+'<embed src="'+id+'" quality="high" pluginspage="" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash"></embed>'
	+'</object>');
}

function flashday(log,movie,movie2){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="750" height="50" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id=ShockwaveFlash1>'
	+'<param name="movie" value="/flash/day.swf">'
	+'<param name="quality" value="high">'
	+'<param name="wmode" value="transparent">'
	+'<param name="FlashVars" value="log='+log+'&movie='+movie+'&movie2='+movie2+'">'
	+'<embed src="/flash/main.swf" quality="high" pluginspage="" FlashVars="log='+log+'&movie='+movie+'&movie2='+movie2+'" width="1280" height="800" type="application/x-shockwave-flash"></embed>'
	+'</object>');
}

self.onError=null; 
//currentX = currentY = 0;  
whichIt = null; 
lastScrollX = 0; 
lastScrollY = 0; 
action = window.setInterval("heartBeat()",1); 
function heartBeat() { 
  diffY = document.body.scrollTop; 
  diffX = 0; 
    if (diffY != lastScrollY) { 
            percent = .1 * (diffY - lastScrollY); 
            if (percent > 0) { 
                    percent = Math.ceil(percent); 
            } else { 
                    percent = Math.floor(percent); 
            } 
            document.all.floater.style.pixelTop += percent; 
            lastScrollY = lastScrollY + percent; 
    } 
    if (diffX != lastScrollX) { 
            percent = .2 * (diffX - lastScrollX); 
            if (percent > 0) { 
                    percent = Math.ceil(percent); 
            } else { 
                    percent = Math.floor(percent); 
            } 
            document.all.floater.style.pixelLeft += percent; 
            lastScrollY = lastScrollY + percent; 
    }        
}    

function MM_openBrWindow(theURL, winName, features) { // v2.0
	var win = window.open(theURL, winName, features);
	win.focus();
}

function gf_checkRegistNo(juminno) {
	if(juminno=="" || juminno==null || juminno.length!=13) 
	{
		alert("주민등록번호를 적어주세요.");
		return false;
	}
	var jumin1 = juminno.substr(0,6);
	var jumin2 = juminno.substr(6,7);
	var yy = jumin1.substr(0,2);        // 년도
	var mm = jumin1.substr(2,2);        // 월
	var dd = jumin1.substr(4,2);        // 일
	var genda = jumin2.substr(0,1);        // 성별
	var msg, ss, cc;

	// 숫자가 아닌 것을 입력한 경우
	if (!isNumeric(jumin1)) 
	{
		alert("주민등록번호 앞자리를 숫자로 입력하세요.");
		return false;
	}
	// 길이가 6이 아닌 경우
	if (jumin1.length != 6) 
	{
		alert("주민등록번호 앞자리를 다시 입력하세요.");
		return false;
	}
	// 첫번째 자료에서 연월일(YYMMDD) 형식 중 기본 구성 검사
	if (yy < "00" || yy > "99" ||
		mm < "01" || mm > "12" ||
		dd < "01" || dd > "31") 
	{
		alert("주민등록번호 앞자리를 다시 입력하세요.");
		return false;
	}
	// 숫자가 아닌 것을 입력한 경우
	if (!isNumeric(jumin2)) 
	{
		alert("주민등록번호 뒷자리를 숫자로 입력하세요.");
		return false;
	}
	// 길이가 7이 아닌 경우
	if (jumin2.length != 7) 
	{
		alert("주민등록번호 뒷자리를 다시 입력하세요.");
		return false;
	}
	// 성별부분이 1 ~ 4 가 아닌 경우
	if (genda < "1" || genda > "4") 
	{
		alert("주민등록번호 뒷자리를 다시 입력하세요.");
		return false;
	}
	// 연도 계산 - 1 또는 2: 1900년대, 3 또는 4: 2000년대
	cc = (genda == "1" || genda == "2") ? "19" : "20";
	// 첫번째 자료에서 연월일(YYMMDD) 형식 중 날짜 형식 검사
	if (isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false) 
	{
		alert("주민등록번호 앞자리를 다시 입력하세요.");
		return false;
	}
	// Check Digit 검사
	if (!isSSN(jumin1, jumin2)) 
	{
		alert("입력한 주민등록번호를 검토한 후, 다시 입력하세요.");
		return false;
	}
	
	return true;
}

function isYYYYMMDD(y, m, d) {
	switch (m) 
	{
		case 2:        // 2월의 경우
		if (d > 29) return false;
		if (d == 29) 
		{
			// 2월 29의 경우 당해가 윤년인지를 확인
			if ((y % 4 != 0) || (y % 100 == 0) && (y % 400 != 0))
				return false;
		}
		break;
		case 4:        // 작은 달의 경우
		case 6:
		case 9:
		case 11:
			if (d == 31) return false;
	}
	// 큰 달의 경우
	return true;
}
function isNumeric(s) {
	for (i=0; i<s.length; i++) {
		c = s.substr(i, 1);
		if (c < "0" || c > "9") return false;
	}
	return true;
}
function isLeapYear(y) {
	if (y < 100)
		y = y + 1900;
	if ( (y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0) ) {
		return true;
	} else {
		return false;
	}
}
function getNumberOfDate(yy, mm) {
	month = new Array(29,31,28,31,30,31,30,31,31,30,31,30,31);
	if (mm == 2 && isLeapYear(yy)) mm = 0;
		return month[mm];
}
function isSSN(s1, s2) {
	n = 2;
	sum = 0;
	for (i=0; i<s1.length; i++)
		sum += parseInt(s1.substr(i, 1)) * n++;
	for (i=0; i<s2.length-1; i++) {
		sum += parseInt(s2.substr(i, 1)) * n++;
		if (n == 10) n = 2;
	}
	c = 11 - sum % 11;
	if (c == 11) c = 1;
	if (c == 10) c = 0;
	if (c != parseInt(s2.substr(6, 1))) return false;
	else return true;
}

function RelationUrl(obj) {
	if (obj.selectedIndex != 0) {
		var win = window.open(obj.options[obj.selectedIndex].getAttribute("value"), "relation_site", "");
		win.focus();
	}
}
