
	// png24 스크립트

		function setPng24(obj) {
			obj.width=obj.height=1;
			obj.className=obj.className.replace(/\bpng24\b/i,''); 
			obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
			obj.src='http://image.kids.daum.net/play/images/empty';
			//obj.src='';
			return '';
		}



	// 섬네일 스크립트
	function change_img(src) {
	  document.getElementById("show_img").src = src;
	}




	//슬라이드 겔러리


	var itemflag=false, itembzAw=0, itemtemp=0, itemamount=0, itembzHchk=0, _targetItem=null, slideSize=0;
	//itemflag:롤링 여부, itembzAw:현재위치
	//itemtemp:롤링 속도,배너 사이즈 체크, itemamount:배너하나당 width값, itembzHchk:화면에 보여지는 width
	//itembzAw:현재위치 , _targetItem:objectID

	function slideLR(obj,chk,atom,list) { //obj:objectID, chk:Left Right, atom:배너하나당 width값, list:화면에 보여지는 갯수

		if (!itemflag){

			_targetItem	= document.getElementById(obj);

			var objs = _targetItem.getElementsByTagName("td");
			var i = objs.length;
			var itemTotalWidth = i * atom;
			var itemChkAllow = (itembzAw + itemTotalWidth) - (atom * list);
			itemamount = atom * list;

			itembzHchk = (atom * i) - (atom * list);
			itemflag=true;

			if ((itemChkAllow < (atom * list)) && (chk == "R")) {
				itemamount = (atom * itemChkAllow) / atom;
			}

			for (var intI = 0; intI <= 10; intI++) { //한번에 이동할 슬라이딩 크기 지정
				if (atom % intI == 0) {
					slideSize = intI;
				}
			}

			itemamount = atom; //한칸씩 이동할 크기 지정


			if (!isNaN(_targetItem.style.left)){
				itembzAw = 0;
				return scroll(chk);
			}
			else {
				itembzAw = parseInt(_targetItem.style.left);
				return scroll(chk);
			}
		}
	}

	function scroll(chkPos) {
		if (itemflag) {
			if((itembzAw == 0 && chkPos == "L") || ((itembzAw <= (-itembzHchk)) && chkPos == "R")){
				itemtemp = 0;
				itemflag = false;
			} else{
				itemtemp += slideSize;
				if(chkPos=='L') {
					_targetItem.style.left = (itembzAw + itemtemp) +"px";
					if ((itembzAw + itemtemp) == 0) {
						itembzAw = 0;
					}
				} else if(chkPos=='R') {
					_targetItem.style.left = (itembzAw - itemtemp) +"px";
			   }
				if(itemamount<=itemtemp) {
					itemflag = false;
					itemtemp = 0;
					itembzAw = parseInt(_targetItem.style.left);

				}
				window.setTimeout("scroll('"+chkPos+"')", 15);			
			}
		}
		
	}





// 레이어 팝업
	function layerChk(obj,str){
	if(str == "open"){
		temp = eval("document.getElementById('"+obj+"')");
		if(temp)
			temp.style.display='block';
	}else{
		temp = eval("document.getElementById('"+obj+"')");
		if(temp)
			temp.style.display='none';
	}
	}


/* 갤러리함수 091007 */
function initGallery(el) {
	var listEl = document.getElementById("sj01");
	var listArr = listEl.getElementsByTagName("a");

	var ImgPath = "http://cache.mcloud.co.kr/fansite/kjm/gallery/photo/";		// 이미지경로 

	var photoEl = document.getElementById("bj01");
	var photoName;
	var photoArrow = document.getElementById("photoActArrow");
	var photoActArr = photoArrow.getElementsByTagName("a");
	var i=0;
	for (i=0; i<listArr.length; i++) {
		thismenu = listArr.item(i);

		thismenu.container = listEl;
		thismenu.imgEl = thismenu.getElementsByTagName("img")[0];

		thismenu.onclick = function test() {
			currentmenu = this.container.current;
			
			if (currentmenu == this) return false;
			if (currentmenu) {
				currentmenu.className = "";
			}
			this.className = this.className + "selected";
			photoName = this.imgEl.src.split("/");
			photoEl.innerHTML = "<img src=\"" + ImgPath + photoName[photoName.length - 1] + "\" >";
			

			this.container.current = this;
			
		}

		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	
	if(listEl.first) listEl.first.onclick();

	photoActArr[0].onclick = photoActPrev;
	photoActArr[1].onclick = photoActNext;
	
	function photoActPrev() {
		
		for (i=0;i<listArr.length ;i++ ) {
			if (i==0) continue;
			if(listArr[i].className == "selected") {
				listArr[i].className = "";
				listArr[i-1].onclick();
				break;
			}
			
		}
	}
	function photoActNext() {
		
		for (i=0;i<listArr.length ;i++ ) {
			if (i==listArr.length-1) continue;
			if(listArr[i].className == "selected") {
				listArr[i].className = "";
				listArr[i+1].onclick();
				break;
			}
			
		}
	}
}

function goSideBanner1(){
	location.href="/weost/event/cbtevent.grm";
}

function goSideBanner2(){
	location.href="http://event.goorm.com/eventPage/we/event_20100618/";
}

function m0(){
	location.href="/weost/index.grm";
}

function m1(){
	location.href="/weost/intro/intro.grm";
}

function m2(){
	location.href="/weost/multimedia/musicvideo.grm";
}

function m3(){
	location.href="/weost/gallery/galleryList.grm";
}

function m4(){
	location.href="http://event.goorm.com/eventPage/we/event_20100618/";
}

function m5(){
	location.href="/weost/event/cbtevent.grm";
}

function m6(){
	window.open("/index.html");
}

function m7(){
	dwr.loginStatus(
		function(result) {
			if(result==1){
				alert('이미 로그인이 되어있습니다');	
			}else{
				window.open("https://member.goorm.com/member/agreeContract.gm");			
			}
		}
	);
}



