
// GNB ÷   ------------------------------------------------------------------------ //
function flash_top_Write(url,w,h,id,bg,vars,win){
	var flash_Str=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' onMouseOver=MueseStatus('Over') onMouseOut=MueseStatus('Out') 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='salign' value='LT' />"+
	"<param name='scale' value='noscale' />"+
	"<param name='bgcolor' value='"+bg+"' />"+

	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' scale='noscale' salign='LT' quality='high'  bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(flash_Str);
}
function MueseStatus(stVal) {
	var place_flashEl = document.getElementById("top-Gnb");
	gndDown_flashoj = place_flashEl.getElementsByTagName("object");
	gndDown_flashoj.topgnb.SetVariable("OverValues", stVal);
}
function swap_url( swapURL ) {
	alert( eval( swapURL ));
}

//  α
function loginCommon(){
	if(document.frmlogin.userid.value == ''){
		alert('̵ Էϼ');
		document.frmlogin.userid.focus();
	}else if(document.frmlogin.passwd.value == ''){
		alert('йȣ Էϼ');
		document.frmlogin.passwd.focus();
	}else{
		document.frmlogin.target = "_self";
		document.frmlogin.submit();
	}

}
function JoinCommon(){
		document.location.href="/member/member.do?command=signup&step=01";
		return;
}

function logoutCommon(){
		document.location.href="/member/member.do?command=logout";
		return;
}

function findIdPwCommon(){
		document.location.href="/member/find_idpw.jsp";
		return;
}

function myIlogCommon(art1){
		//document.location.href="/ilog.do?command=index&blog_id="+art1;
		document.location.href="/ilog.do?command=prologue&blog_id="+art1;
		return;
}

/* layer show/hide */
function layerShow(layeridss) {
	var layerids = document.getElementById(layeridss);
	layerids.style.display = "block";
}
function layerHide(layeridss) {
	var layerids = document.getElementById(layeridss);
	layerids.style.display = "none";
}

/*  XML ÷ ũ */
function flash_xml_link(link,mode){
		//alert(link);
		if(mode=="self"){
			location.href=link;
			//alert(link)
		}else{
			window.open(link)
			//alert("pop \t "+link)

			//
		}
}

/* ˾--*/
function WinPopup(mypage,myname, w, h,scroll) { //v2.0

	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',resizable=0,status=0,scrollbars='+scroll+'';
	popWin = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { popWin.window.focus(); }
}


/*÷ ũ  	*/
function FormFlash_eval(name,mode){

	if(mode=="self"){
				location.href=eval(name);
			}else{
			if(name=="ManService_menu6"){
				WinPopup(eval(name),'winmap', 1024, 705, 0);
			}else if(name=="learning_link"){
				WinPopup(eval(name),'winmap', 650, 500, 1);
			}/*else if(name=="ManService_menu6"){

			}*/
			//window.open(eval(name))
			//alert(eval(name))
		}
}

//  ÷   ------------------------------------------------------------------------ //
function flash_Left_Write(url,w,h,id,bg,vars,win){
	var flash_Str=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' id='side-flash' 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='salign' value='LT' />"+
	"<param name='scale' value='noscale' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' id='side-flash' scale='noscale' salign='LT' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(flash_Str);
}

function flash_Left_Write2(url,w,h,id,bg,vars,win){
	var flash_Str=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,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='salign' value='LT' />"+
	"<param name='scale' value='noscale' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' scale='noscale' salign='LT' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	document.write(flash_Str);
}

// [GNBϴ ÷  //
function flash_resize_GnbDown(h) {
	var gndDown_flashEl = document.getElementById("top-flash");
	gndDown_flashoj = gndDown_flashEl.getElementsByTagName("object");
	gndDown_flashEl.style.height = h +"px";
	//gndDown_flashoj[0].style.height = h +"px";
	//alert( gndDown_flashoj[0] );
}
// [Bottom ÷  //
function flash_resize_Div3(h) {
	var foot_flashElb = document.getElementById("bottom");
	var foot_flashEl = document.getElementById("bottom-flash");
	 foot_flashoj = foot_flashEl.getElementsByTagName("object");
	foot_flashElb.style.height = h +"px";
	//foot_flashEl.style.height = h +"px";
	foot_flashoj[0].style.height = h +"px";

}
// [GNB ÷  //
function flash_resize_top( h ) {
	var place_flashEl = document.getElementById("top-Gnb");
	place_flashoj = place_flashEl.getElementsByTagName("object");
	place_flashEl.style.height = h +"px";
	place_flashoj[0].style.height = h +"px";
}
// [] ÷ ũ Լ //
function flash_link( xmlurl ){
 if(xmlurl == "url") return false;
 if( xmlurl == "http://goongstory.urii.com/gstory.jsp" ) {
  window.open( xmlurl ) 
 }else {
  location.href=xmlurl;
 }
}
// [] ÷   ϴ ޴ ġ Լ //
function flash_resize( w, h ) {
	var place_flashEl = document.getElementById("side-menu");
	var place_flashElk = document.getElementById("side-flash");
	place_flashElk.style.height = h +"px";
	if ( w != 290) {
		place_flashEl.style.height = h +"px";
	}
	if(document.getElementById('side-menu-c')) {
		var place_flashElc = document.getElementById("side-menu-c");
		place_flashElc.style.width = w +"px";
		place_flashElc.style.height = h +"px";
	};
}
function flash_drop( t ) {
	var place_flashEl = document.getElementById("side-menu");
	//if(!document.getElementById('cool-tool')) return false;
	//var place_flashEl = document.getElementById("cool-tool");
	//place_flashEl.style.top = t  +100+"px";
	//place_flashEl.style.top = document.getElementById("side-menu").style.height ;
}

/* image rollover */
function imgOn(imgEl) {
	imgEl.src = imgEl.src.replace("_off.gif", "_on.gif");
}

function imgOff(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", "_off.gif");
}


/* boardToggle */
function boardToggle(el) {
	var toggleContainer = document.getElementById(el);
	triggers = toggleContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).onclick = function () {
			if (toggleContainer.current == this) {
				this.targetEl.style.display = "none";
				this.className = "";
				toggleContainer.current = null;
			} else {
				if (toggleContainer.current) {
					toggleContainer.current.targetEl.style.display = "none";
					toggleContainer.current.className = "";
				}
				this.targetEl.style.display = "";
				this.className = "selected";
				toggleContainer.current = this;
			}
			return false;
		}
	}
}
/* initTab */
function initTabMenu(tabContainerID) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("ul")[0].getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onclick = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return false;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace("on", "");
				}
			}

			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
/* initTab */
function initTabMenu2(tabContainerID, onid) {
	var tabContainer = document.getElementById(tabContainerID);
	var tabonid = document.getElementById(onid);
	var tabAnchor = tabContainer.getElementsByTagName("ul")[0].getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "tab")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		if (thismenu.targetEl != tabonid){
			thismenu.targetEl.style.display = "none";
		}
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		thismenu.onmouseover = function tabMenuClick() {
			currentmenu = this.container.current;
			if (currentmenu == this)
				return;

			if (currentmenu) {
				currentmenu.targetEl.style.display = "none";
				if (currentmenu.imgEl) {
					currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_on.gif", "_off.gif");
				} else {
					currentmenu.className = currentmenu.className.replace("on", "");
				}
			}
			this.targetEl.style.display = "block";
			if (this.imgEl) {
				this.imgEl.src = this.imgEl.src.replace("_off.gif", "_on.gif");
			} else {
				this.className += " on";
			}
			this.container.current = this;

			return false;
		};

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	if (tabContainer.first)
		tabContainer.first.onclick();
}
function mousover(ael) {
	var aEl = document.getElementById(ael);
	aEl.className = "on";
}
function mousout(ael) {
	var aEl = document.getElementById(ael);
	aEl.className = "";
}
/* input */
function inputfocus(el, elvalue) {
	var inputContainer = document.getElementById(el);
	infocus = inputContainer.getElementsByTagName("input");

	for(i = 0; i < infocus.length; i++) {
		if (infocus.item(i).type == "text" || infocus.item(i).type == "password") {
			infocus.item(i).onfocus = function () {
				this.className = this.className.replace("type-text", "type-on");
				if(this.value == elvalue){
					this.value = ""
				}
			}
			infocus.item(i).onblur = function () {
				this.className = this.className.replace("type-on", "type-text");
			}
		}
	}
}
function inputclear(cel, elvalue) {
	var inputc = document.getElementById(cel);
	if(inputc.value == elvalue){
		inputc.value = ""
	}
}
/* ũ  ̴ ̾ */
function initMoving(layerID, position, topLimit, btmLimit) {
	if (!layerID)
		return false;

	var obj = document.getElementById(layerID);
	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 500;
		}
	}

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

		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";
	}, 50)
}

/* iframe resize - Ѽ϶  */
function autoResize(el) {
	var iframeWidth = el.contentWindow.document.body.scrollWidth;
    var iframeHeight = el.contentWindow.document.body.scrollHeight;
	el.width = iframeWidth;
    el.height = iframeHeight;
}

/* ưִ  */
function togCalbtn(calk) {
	if (typeof calk == "string") {
		var cal = document.getElementById(calk);
		var imgcal = document.getElementById('btn-'+calk);
	}
	if (cal.style.display != "block") {
		cal.style.display = "block";
		imgcal.alt = imgcal.alt.replace("", "ݱ");
		imgcal.src = imgcal.src.replace("_on.gif", "_off.gif");
	} else {
		cal.style.display = "none";
		imgcal.alt = imgcal.alt.replace("ݱ", "");
		imgcal.src = imgcal.src.replace("_off.gif", "_on.gif");
	}
}
/* ٷΰ */
function togCal(cal) {
	if (typeof cal == "string") {
		var imgcal = document.getElementById('btn-'+cal);
		var cal = document.getElementById(cal);
	}
	if (cal.style.display != "block") {
		cal.style.display = "block";
		imgcal.src = imgcal.src.replace("_on", "_off");
	} else {
		cal.style.display = "";
		imgcal.src = imgcal.src.replace("_off", "_on");
	}
	var lnk = cal.getElementsByTagName("a");
	for (i=0; i<lnk.length; i++) {
		lnk[i].onclick = function() {
			cal.style.display = "";
			imgcal.src = imgcal.src.replace("_off", "_on");
		}
	}
}

/* ˾ */
function popup(url,wth,heit,scrollbar) {
	eopt = "width="+ wth +",height=" + heit + ",scrollbars=" + scrollbar + ",resizable=0, left=0, top=0"
	window.open(url,"",eopt);
}

/* Ʈн ˾ */
function popup_print_eng(ph) {
	window.open(ph,"wine","width=560,height=530,scrollbars=yes,status=yes, left=0, top=0");
}
function popup_print_color(ph) {
	window.open(ph,"winc","width=640,height=400,scrollbars=yes,status=yes, left=0, top=0");
}
function popup_print_korean(ph) {
	window.open(ph,"wink","width=860,height=500,scrollbars=yes,status=yes, left=0, top=0");
}
function popup_print_korean2(ph) {
	window.open(ph,"wink","width=611,height=500,scrollbars=yes,status=yes, left=0, top=0");
}
function popup_print_number(ph) {
	window.open(ph,"winn","width=613,height=500,scrollbars=yes,status=yes, left=0, top=0");
}
function popup_print_art(ph) {
	window.open(ph,"wina","width=860,height=500,scrollbars=yes,status=yes, left=0, top=0");
}

/* leftmenu */
function leftMenu(el, menuel) {
	var toggleContainer = document.getElementById(el);
	var tmenuel = document.getElementById(menuel);
	triggers = toggleContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			if (triggers.item(i).href.split("#")[1] == menuel){
				var imgtmenuel = triggers.item(i).getElementsByTagName("img");
				imgtmenuell = imgtmenuel[0]
			}
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);


		if (!triggers.item(i).targetEl)
			continue;
		if (triggers.item(i).targetEl == tmenuel) {
			imgtypeall = triggers.item(i).getElementsByTagName('img');
			imgtypeall[0].src = imgtypeall[0].src.replace("off", "on");
		} else {
			triggers.item(i).targetEl.style.display = "none";
			imgtypeall = triggers.item(i).getElementsByTagName('img');
			imgtypeall[0].src = imgtypeall[0].src.replace("on", "off");
		}

		triggers.item(i).onclick = function () {
			imgtype = this.getElementsByTagName('img');
			if (toggleContainer.current == this || this.targetEl.style.display != 'none') {
				this.targetEl.style.display = "none";
				this.className = "";
				imgtype[0].src = imgtype[0].src.replace("on", "off");
				toggleContainer.current = null;
			} else {
				if (toggleContainer.current) {
					toggleContainer.current.targetEl.style.display = "none";
					toggleContainer.current.className = "";
					imgoff = toggleContainer.current.getElementsByTagName('img');
					imgoff[0].src = imgoff[0].src.replace("on", "off");
				}
				if(tmenuel){
					tmenuel.style.display = "none";
					imgtmenuell.src = imgtmenuell.src.replace("on", "off");
				}
				this.targetEl.style.display = "block";
				this.className = "selected";
				toggleContainer.current = this;
				imgtype[0].src = imgtype[0].src.replace("off", "on");
			}
			return false;
		}
	}
}
function togCallist(cal) {
	if (typeof cal == "string") {
		var cal = document.getElementById(cal);
		var textcal = document.getElementById('list-top-btn');
	}
	if (cal.style.display != "block") {
		cal.style.display = "block";
		textcal.firstChild.nodeValue = textcal.firstChild.nodeValue.replace("","ݱ")
	} else {
		cal.style.display = "";
		textcal.firstChild.nodeValue = textcal.firstChild.nodeValue.replace("ݱ","")
	}
}
/* ̹ ũ */
function moveEl(tId,fLeft,fTop,Int) {
	if(!document.getElementById) return false;
	if(!document.getElementById(tId)) return false;
	var elem = document.getElementById(tId);
	if(elem.movement){
		clearTimeout(elem.movement);
	}
	var xpos = parseInt(elem.style.left);
	var ypos = parseInt(elem.style.top);
	if (xpos == fLeft && ypos == fTop){
		return true;
	}
	if(xpos < fLeft){
		var dist = Math.ceil((fLeft-xpos)/10);
		xpos = xpos + dist
	}
	if(xpos > fLeft){
		var dist = Math.ceil((xpos-fLeft)/10);
		xpos = xpos - dist
	}
	if(ypos < fTop){
		ypos++;
	}
	if(ypos > fTop){
		ypos--;
	}
	elem.style.left = xpos + "px";
	elem.style.top = ypos + "px";
	var repeat = "moveEl('" + tId + "'," + fLeft + "," + fTop + "," + Int + ")"
	elem.movement = setTimeout(repeat,Int);
}
function prepareS(tid) {
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById(tid)) return false;

	var preview = document.getElementById(tid);
	preview.style.position = "absolute";
	preview.style.left = "0px";
	preview.style.top = "0px";
}
function prepre(tid, tleft, tleng, tnum) {
	if(!document.getElementById(tid)) return false;
	var elem = document.getElementById(tid);
	var xpos = parseInt(elem.style.left);
	var kimg = elem.getElementsByTagName("td");
	var tkimg = kimg.length - tnum;
	tkimg = tkimg * tleng * -1 - 1;
	tleft = tleft + xpos;
	if (tleft < 1 && tleft > tkimg ) {
		moveEl(tid,tleft,0,10);
	}
}


/* ̷α ̾ */
function layerf() {
	if(!document.getElementById('layer-nxt')) return false;
	if(!document.getElementById('pre-btn')) return false;
	var idlayerwth = document.getElementById('layer-nxt');
	var idbtn = document.getElementById('pre-btn');
	idbtn.style.display = "none";
	idlayerwth.style.display = "block";
	idlayerwth.style.width = "28px";
	movelayerf(236);
}
function layerp() {
	if(!document.getElementById('layer-nxt')) return false;
	var idlayerwth = document.getElementById('layer-nxt');
	movelayerf(26);
}
function movelayerf(fwth) {
	var idlayerwth = document.getElementById('layer-nxt');
	var iidbtn = document.getElementById('pre-btn');
	var wthpos = parseInt(idlayerwth.style.width);
	if(idlayerwth.movement){
		clearTimeout(idlayerwth.movement);
	}
	if (wthpos == fwth){
		return true;
	}
	if(wthpos < fwth){
		var dist = Math.ceil((fwth-wthpos)/10);
		wthpos = wthpos + dist;
	}
	if(wthpos > fwth){
		var dist = Math.ceil((wthpos-fwth)/10);
		wthpos = wthpos - dist;
	}
	if (wthpos == 26) {
		idlayerwth.style.display = "none";
		iidbtn.style.display = "block";
	}
	idlayerwth.style.width = wthpos + "px";
	var repeat = "movelayerf(" + fwth +")";
	idlayerwth.movement = setTimeout(repeat,50);
}


/* quick ũ */
var stmnLEFT = 910; // ũѸ޴  ġ
var stmnGAP1 = 137; //  κ 
var stmnGAP2 = 10; // ũѽ  ܰ ణ . ʿ 0 
var stmnBASE = 0; // ũѸ޴ ʱ ġ (ƹԳ ص   stmnGAP1 ణ ̸ ִ°  )
var stmnActivateSpeed = 200; //  ϴ ӵ (ڰ Ŭ ʰ ˾)
var stmnScrollSpeed = 10; // ũѵǴ ӵ (Ŭ ʰ )

var stmnTimer;

function ReadCookie(name) {
var label = name + "=";
var labelLen = label.length;
var cLen = document.cookie.length;
var i = 0;

while (i < cLen) {
        var j = i + labelLen;

        if (document.cookie.substring(i, j) == label) {
                var cEnd = document.cookie.indexOf(";", j);
                if (cEnd == -1) cEnd = document.cookie.length;
        return unescape(document.cookie.substring(j, cEnd));
        }
        i++;
    }
  return "";
}

function SaveCookie(name, value, expire) {
var eDate = new Date();
eDate.setDate(eDate.getDate() + expire);
document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
}

function Refreshstaticmenu() {
var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

stmnStartPoint = parseInt(staticmenu.style.top, 10);
stmnEndPoint = document.documentElement.scrollTop + stmnGAP2
if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

stmnRefreshTimer = stmnActivateSpeed;

if ( stmnStartPoint != stmnEndPoint ) {
        stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
        staticmenu.style.top = parseInt(staticmenu.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount )+'px';
        stmnRefreshTimer = stmnScrollSpeed;
        }
        stmnTimer = setTimeout ("Refreshstaticmenu();", stmnRefreshTimer);
}

function Toggleanimate() {
    if (!animate.checked) {
        Refreshstaticmenu();
                SaveCookie("animate", "true", 300);
                } else {
                clearTimeout(stmnTimer);
                staticmenu.style.top = stmnGAP1;
                SaveCookie("animate", "false", 300);
        }
}

function Initializestaticmenu() {
staticmenu.style.left = stmnLEFT+'px';
    if (ReadCookie("animate") == "false") {
                animate.checked = true;
                staticmenu.style.top = document.documentElement.scrollTop + stmnGAP1+'px';
                } else {
                animate.checked = false;
                staticmenu.style.top = document.documentElement.scrollTop + stmnBASE+'px';
                Refreshstaticmenu();
        }
}

//ϴ ̾
function bottompositon() {
	//if(!document.getElementById('bottom')) return false;
	if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat'){
		cot_t1_DOCtp="_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}";
	}else{
		cot_t1_DOCtp="_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);_left:expression(document.body.scrollLeft + document.body.clientWidth - offsetWidth);}";
	}
	var cot_tl_fixedCSS='#bottom{';
	var cot_tl_fixedCSS=cot_tl_fixedCSS+cot_t1_DOCtp;
	document.write('<style type="text/css">'+cot_tl_fixedCSS+'</style>');
}

//˾ϴ
function popuppositon() {
	if(document.getElementById('pop-footer') != '') {
		if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat'){
			cot_t1_DOCtp="_top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight);_left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}";
		}else{
			cot_t1_DOCtp="_top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight);_left:expression(document.body.scrollLeft + document.body.clientWidth - offsetWidth);}";
		}
		var cot_tl_fixedCSS='#pop-footer{';
		var cot_tl_fixedCSS=cot_tl_fixedCSS+cot_t1_DOCtp;
		document.write('<style type="text/css">'+cot_tl_fixedCSS+'</style>');
	};
}
popuppositon();

//  ũ
function scrap(bbs_no,title,userid) {
	if(isLogin()) {
		var str = replaceAll( document.location.href, "&", "^" );
		var url = "./ilog.do?command=scrap_ins&bbs_no="+bbs_no+"&url="+str+"&title="+title+"&blog_id="+userid;
		document.blank_frame.location = url;
	}
}

// α ܯ
function blogBookmark(dest_blog_id, blog_id) {
	if(isLogin()) {
		var url = "./ilog.do?command=favorite_ins&dest_blog_id="+dest_blog_id+"&blog_id="+blog_id;
		document.blank_frame.location = url;
	}
}


