/*
	@ÆÄ ÀÏ ¸í : design.js
	@¼³    ¸í : gelleria µðÀÚÀÎ ½ºÅ©¸³Æ®
	-------------------------------------------------------------------
*/
// Scrolling Wing
function initMoving(target, topPosition, topLimit, btmLimit) {
	if (!target) return false;

	var obj = target;
	obj.initTop = topPosition;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - document.getElementById('wing').offsetHeight;

	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() + obj.getHeight() / 2 - 15;
		pos = obj.getTop() + topPosition;

		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)
}
// RollOver
function imageOver(imgEl) {
	imgEl.src = imgEl.src.replace("off.gif", "on.gif");
}
function imageOut(imgEl) {
	imgEl.src = imgEl.src.replace("on.gif", "off.gif");
}
// Layer Show/Hide
function showLayer(target) {
	document.getElementById(target).style.display = "block";
	if(target=="lay_quickview") {
		if(document.getElementById('icoRecomm')) document.getElementById('icoRecomm').style.display="none";
		if(document.getElementById('icoRecomm1')) document.getElementById('icoRecomm1').style.display="none";
		if(document.getElementById('icoRecomm2')) document.getElementById('icoRecomm2').style.display="none";
	}
}
function hideLayer(target) {
	if(document.getElementById(target)) {
	document.getElementById(target).style.display = "none";
	}
}

/*ÆäÀÌÁö ºñÈ°¼ºÈ­*/
function dimLayerView(dim) {
	var oBody = ( document.compatMode && document.compatMode!="BackCompat" ) ? document.documentElement : document.body  ;
	var cheight= ( oBody.scrollHeight > oBody.clientHeight ? oBody.scrollHeight : oBody.clientHeight  ) + 'px';
	if(!dim){document.getElementById('dim_layer').style.display = "block";
	document.getElementById('dim_layer').style.height = cheight;
	chgSelect();
	}
}
function dimLayerClose() {
		document.getElementById('dim_layer').style.display = "none";
		//document.getElementById("default").style.overflowY="auto";
		//document.getElementById("layd").style.paddingRight="0px";
		chgSelectDefaut();
}
/*ºê¶ó¿ìÀú Ã¼Å©*/
appname = navigator.appName;
 useragent = navigator.userAgent;
 if(appname == "Microsoft Internet Explorer") appname = "IE";
 IE55 = (useragent.indexOf('MSIE 5.5')>0);  //5.5 ¹öÀü
 IE6 = (useragent.indexOf('MSIE 6')>0);     //6.0 ¹öÀü

function showTframe(target) {
	 if(appname=="IE" && IE55 || IE6){
		document.getElementById(target).style.display = "block";
	}
}
function hideTframe(target) {
	if(appname=="IE" && IE55 || IE6) {
		if(document.getElementById(target)) {
		document.getElementById(target).style.display = "none";
		}
	}
}
function chgSelect() {
var selectObj = document.getElementsByTagName("select");
	 if(appname=="IE" && IE55 || IE6) {
		if(selectObj) {
			for (var i=0; i<selectObj.length; i++) {
				selectObj[i].style.visibility ="hidden";
			}
		}
	 }
}
function chgSelectDefaut() {
var selectObj = document.getElementsByTagName("select");
	if(appname=="IE" && IE55 || IE6) {
		if(selectObj) {
			for (var i=0; i<selectObj.length; i++) {
				selectObj[i].style.visibility ="visible";
			}
		}
	}

}
/*png*/
function pngImgBackGround(obj,imgSrc){
	if(appname=="IE" && IE55 || IE6) {
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgSrc + "',sizingMethod='scale')";
	} else {
		obj.style.backgroundImage = 'url('+imgSrc+')';
	}
}
/*ÇÃ·¡½¬*/
function swfprint(objid,furl,fwidth,fheight,transoption,flashvars) {
	var ieTxt = '<object id="'+ objid +'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,0" width="'+ fwidth +'" height="' + fheight +'" align="middle">';
	ieTxt += '<param name="allowScriptAccess" value="always"/>';
	ieTxt += '<param name="movie" value="'+ furl +'"/>';
	ieTxt += '<param name="quality" value="high"/>';
	ieTxt += '<param name="bgcolor" value="#ffffff"/> ';
	if (flashvars){
		ieTxt += '<param name="flashVars" value="swfURL=http://image.galleria.co.kr/images/flash/&'+ flashvars +'">';
	} else {
		ieTxt += '<param name="flashVars" value="swfURL=http://image.galleria.co.kr/images/flash/">';
	}
	if (transoption == "t")	{
		ieTxt += '<param name="wmode" value="transparent"/>';
	} else if	(transoption == "o")	{
		ieTxt += '<param name="wmode" value="opaque"/>';
	}
	ieTxt += '</object>';

	var ffTxt = '<object id="'+ objid +'" type="application/x-shockwave-flash" data="'+ furl +'" width="'+ fwidth +'" height="' + fheight +'"';
	' flashVars="swfURL=http://image.galleria.co.kr/images/flash/&'+ flashvars +'" ';
	if (transoption == "t")	{
		ffTxt += ' wmode="transparent"';
	} else if	(transoption == "o")	{
		ffTxt += ' wmode="opaque"';
	}
	ffTxt +='allowScriptAccess="always"';
	ffTxt += '></object>';

	if(appname=="IE") document.write(ieTxt);
	else  document.write(ffTxt);


}
// menuOver
function menuOver() {
	this.src = this.src.replace("_off.gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", "_off.gif");
}

function flash_setvariable(flashid,val){
	document.getElementById(flashid).SetVariable('setStep',val);
}
//CENTER POSITION check
var ObjTemp = {};
function view_layer(the_id, the_width, the_height, dim)
{
	var lfrm = document.getElementById(the_id);
	if(!dim) {
		dimLayerView(null);
		lfrm.width = the_width + "px";
		lfrm.height = the_height + "px";
		var aa=document.getElementsByTagName("html");
		//document.getElementsByTagName("html").style.overflowY="hidden";
		//document.getElementById("default").style.overflowY="hidden";
		//document.getElementById("layd").style.paddingRight="16px";
		//aa.style.overflow="hidden";
		getviewpoint();
		showLayer(the_id);

		/*lfrm.style.left = ObjTemp.scroll_left + ((ObjTemp.docwidth-lfrm.offsetWidth) / 2) + "px";*/
		lfrm.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-lfrm.offsetHeight) / 2) + "px";
		lfrm.width = the_width + "px";
		lfrm.height = the_height + "px";
	}

}
function view_layer2(the_id, the_width, the_height, dim, flashid, type)
{
	var lfrm = document.getElementById(the_id);

	dimLayerView(null);
	lfrm.width = the_width + "px";
	lfrm.height = the_height + "px";
	var aa=document.getElementsByTagName("html");
	//document.getElementsByTagName("html").style.overflowY="hidden";
	//document.getElementById("default").style.overflowY="hidden";
	//document.getElementById("layd").style.paddingRight="16px";
	//aa.style.overflow="hidden";
	getviewpoint();
	showLayer(the_id);
	/*lfrm.style.left = ObjTemp.scroll_left + ((ObjTemp.docwidth-lfrm.offsetWidth) / 2) + "px";*/
	lfrm.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-lfrm.offsetHeight) / 2) + "px";
	lfrm.width = the_width + "px";
	lfrm.height = the_height + "px";
	//document.getElementById('testest').value = type;

	if(the_id = 'lay_cart'){
		document.getElementById('lay_cart_check').value = 'yes';
	}

	flash_setvariable(flashid,type);
}
window.onresize = function()
{
var layCart = document.getElementById('lay_cart');
var laySizeCal = document.getElementById('lay_sizecal');
var laySizeQuick = document.getElementById('lay_quickview');
var layOrdering = document.getElementById('lay_ordering');
var layBrandsearch = document.getElementById('lay_brandsearch');
var layGstore = document.getElementById('lay_gstore');
var layMystyle = document.getElementById('lay_mystyle');
	getviewpoint();
	if( layCart && document.getElementById('lay_cart_check').value=='yes' ){layCart.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-layCart.offsetHeight) / 2) + "px";}
	if(laySizeCal){laySizeCal.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-laySizeCal.offsetHeight) / 2) + "px";}
	if(laySizeQuick){laySizeQuick.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-laySizeQuick.offsetHeight) / 2) + "px";}
	if(layOrdering){layOrdering.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-layOrdering.offsetHeight) / 2) + "px";}
	if(layBrandsearch){layBrandsearch.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-layBrandsearch.offsetHeight) / 2) + "px";}
	if(layGstore){layGstore.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-layGstore.offsetHeight) / 2) + "px";}
	if(layMystyle){layMystyle.style.top = ObjTemp.scroll_top + ((ObjTemp.docheight-layMystyle.offsetHeight) / 2) + "px";}
}
function getviewpoint()
{
	var ie=document.all && !window.opera;
	//var domclientWidth=document.documentElement && parseInt(document.documentElement.clientWidth) || 100000; //Preliminary doc width in non IE browsers
	ObjTemp.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body; //create reference to common "body" across doctypes
	ObjTemp.scroll_top=(ie)? ObjTemp.standardbody.scrollTop : window.pageYOffset;
   // ObjTemp.scroll_left=(ie)? ObjTemp.standardbody.scrollLeft : window.pageXOffset;
   // ObjTemp.docwidth=(ie)? ObjTemp.standardbody.clientWidth : (/Safari/i.test(navigator.userAgent))? window.innerWidth : Math.min(domclientWidth, window.innerWidth-16);
	ObjTemp.docheight=(ie)? ObjTemp.standardbody.clientHeight: window.innerHeight;
}

/*ÇöÀçÀ§Ä¡ select box Á¦¾î start*/
function locationSelectView(num,over){
	var listDiv = document.getElementById('locationSelectDivList' + num);
	if(over == 'over')
		{listDiv.style.visibility = 'visible';}
	else
	{listDiv.style.visibility = 'hidden';}
}

function locationSelectWidth(num){
	var viewDiv = document.getElementById('locationSelectDiv' + num)
	var listDiv = document.getElementById('locationSelectDivList' + num)
	var viewDivWidth = viewDiv.clientWidth;
	var listDivWidth = listDiv.clientWidth;
	if(viewDivWidth > listDivWidth)
	{
		//if(viewDivWidth > 103) viewDivWidth = viewDivWidth-2;
		listDiv.style.width = viewDivWidth-2+"px";
	}
	if(viewDivWidth < listDivWidth)
	{
		//if(listDivWidth > 103) listDivWidth = listDivWidth-2;
		viewDiv.style.width = listDivWidth+2+"px";
	}
}
/*ÇöÀçÀ§Ä¡ select box Á¦¾î end*/
//onloadeventÃ³¸®
function addLoadEvent (func) {
var oldonload= window.onload;
	if (typeof window.onload != 'function') {
	window.onload=func;
	}
	else {
		window.onload=function () {
			oldonload();
			func();
		}
	}
}

/*faq Åä±Û*/
function showQna(target,e) {
	if(document.getElementById(target+"_a"+e).style.display=='none'){
		var selectObj = document.getElementById(target).getElementsByTagName("tbody");
		for(var i=1;i<=selectObj.length;i++){
			document.getElementById(target+"_a"+i).style.display = (e==i)?"":"none";
			document.getElementById(target+"_t"+i).style.color = (e==i)?"#193867":"";
			document.getElementById(target+"_q"+i).style.backgroundColor = (e==i)?"#f7f7f7":"";
		}
	} else {
		document.getElementById(target+"_a"+e).style.display='none';
		document.getElementById(target+"_t"+e).style.color='';
		document.getElementById(target+"_q"+e).style.backgroundColor='';
	}
}
/*ÅÇ Åä±Û*/
function tabTogle(name, e) {
	var selectObj = document.getElementById(name).getElementsByTagName("li");
	for(var i=1;i<=selectObj.length;i++){
		document.getElementById(name+"_"+i).style.display = (e==i)?"block":"none";
		var imgEl=document.getElementById(name+'_list_'+i).getElementsByTagName("img").item(0);
		imgEl.src = (e==i)? imgEl.src.replace("off.gif", "on.gif"):imgEl.src.replace("on.gif", "off.gif");
		document.getElementById(name+'_list_'+i).className= (e==i)?"on":"";
	}
}
/*function chageCellOver(e) {
	e.style.backgroundColor="#f7f7f7";
}
function chageCellOut(e) {
	e.style.backgroundColor="";
}*/

/*function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG")
document.body.focus();
}
document.onfocusin=bluring;*/

function tabCategory(idname,e) {
	var gettId=idname;
	var selectObj = document.getElementById(gettId).getElementsByTagName("li");
	for(var i=1;i<=selectObj.length;i++){
		document.getElementById(gettId+"_cont_"+i).style.display = (e==i)?"block":"none";
		if(document.getElementById('tab_three')||document.getElementById('tab_beauty')){
			var imgEl=document.getElementById(gettId+'_tit_'+i).getElementsByTagName("img").item(0);
			imgEl.src = (e==i)? imgEl.src.replace("off.gif", "on.gif"):imgEl.src.replace("on.gif", "off.gif");
		}
		document.getElementById(gettId+'_tit_'+i).className = (e==i)?"on":"off";
	}
}

function highlightRows() {
	var rows=document.getElementById("bbsList").getElementsByTagName("tr");
	for(var i=0;i<rows.length;i++){
		rows[i].onmouseover= function(){
			this.style.backgroundColor="#f7f7f7";
		}
		rows[i].onmouseout=function(){
			this.style.backgroundColor="";
		}
	}
}
/**/
function addClass(element,value) {
  if (!element.className) {
    element.className = value;
  } else {
    newClassName = element.className;
    newClassName+= " ";
    newClassName+= value;
    element.className = newClassName;
  }
}

function lockRow() {
	var tbodies = document.getElementsByTagName("tbody");
	for (var j=0; j<tbodies.length; j++) {
		var rows = tbodies[j].getElementsByTagName("tr");
		for (var i=0; i<rows.length; i++) {
			rows[i].oldClassName = rows[i].className
			rows[i].onclick = function() {
				if (this.className.indexOf("selected") != -1) {
					this.className = this.oldClassName;
				} else {
					addClass(this,"selected");
				}
			}
		}
	}
}
/*color*/
/*function multSelect (){//º»ÆäÀÌÁö·Î ÀÌµ¿
var colorBox=document.getElementById("colorSel").getElementsByTagName("li");
	for (var i=0; i<colorBox.length; i++){
		colorBox[i].oldClassName=colorBox[i].className
		colorBox[i].onclick=function(){
			if (this.className.indexOf("on") != -1) {
				this.className = this.oldClassName;
			} else {
				addClass(this,"on");
			}
		}
	}
}*/


function classOver(name, e) {
	var selectObj =document.getElementById(name).getElementsByTagName("img");
	for(var i=1;i<=selectObj.length;i++){
		document.getElementById(name+'_'+i).src = (e==i)? document.getElementById(name+'_'+i).src.replace("off.gif", "on.gif"):document.getElementById(name+'_'+i).src.replace("on.gif", "off.gif");
	}
}
function sumlistOver(e) {
	var selectObj =document.getElementById('sum_list').getElementsByTagName("img");
	for(var i=1;i<=selectObj.length;i++){
		selectObj.item(i-1).className= (e==i)?"on":"off";
		document.getElementById('bigimg').src = "http://image.galleria.co.kr/images/temp/sum_l_"+e+".gif";
	}
}
function sumlistQuickOver(e,url) {
	var selectObj =document.getElementById('sum_qlist').getElementsByTagName("img");
	for(var i=1;i<=selectObj.length;i++){
		selectObj.item(i-1).className= (e==i)?"on":"off";
		if(url)
		{
			document.getElementById('bigqimg').src = url;
		}
		else
		{
			document.getElementById('bigqimg').src = "http://image.galleria.co.kr/images/temp/sum_l_"+e+".gif";
		}
	}
}
function tmpSumlistQuickOver(obj,list,e,url) {
	var selectObj =document.getElementById(list).getElementsByTagName("img");
	for(var i=1;i<=selectObj.length;i++){
		//alert(i);
		selectObj.item(i-1).className= (e==i)?"on":"off";
		if(url)
		{
			document.getElementById(obj).src = url;
		}
		else
		{
			document.getElementById(obj).src = "http://image.galleria.co.kr/images/temp/sum_l_"+e+".gif";
		}
	}
}

/*img label*/
function imgLabel(name) {
	var obj=document.getElementById(name);
	if(navigator.appVersion.indexOf('MSIE') != -1)
		{obj.click()}
}

/*h1 tab start*/
function divImgView(img,div,total,num){
	var objSrc1On = document.getElementById(img+num).src.split("_on.gif");
	objSrc1 = objSrc1On[0].split("_off.gif");
	var objSrc2On;
	var objSrc2;

	for(var i=1;i<=total;i++)
	{
		objSrc2On = document.getElementById(img+i).src.split("_on.gif");
		objSrc2 = objSrc2On[0].split("_off.gif");
		document.getElementById(img+i).src = objSrc2[0]+'_off.gif';
		document.getElementById(div+i).style.display = 'none';
	}
	document.getElementById(img+num).src = objSrc1[0]+'_on.gif';
	document.getElementById(div+num).style.display = '';
}
/*h1 tab end*/

/*¸¸µçÀÌ : mins01,mins,°ø´ë¿©ÀÚ´Â ¿¹»Ú´Ù ·Ñ¸µ*/
var js_rolling = function(this_s){
	// ½Ã°£´ÜÀ§´Â ms·Î 1000ÀÌ 1ÃÊ
	if(this_s.nodeType==1){
		this.this_s = this_s;
	}else{
		this.this_s = document.getElementById(this_s);
	}
	this.is_rolling = false;
	this.direction = 1; //1:top, 2:right, 3:bottom, 4:left (½Ã°è¹æÇâ) // 1¹ø°ú 4¹ø¸¸ µÊ
	this.children =	null;
	this.move_gap = 1;	//¿òÁ÷ÀÌ´Â ÇÈ¼¿´ÜÀ§
	this.time_dealy = 100; //¿òÁ÷ÀÌ´Â Å¸ÀÓµô·¹ÀÌ
	this.time_dealy_pause = 1000;//ÇÏ³ªÀÇ ´ë»óÀÌ »õ·Î ½ÃÀÛÇÒ ¶§ ¸ØÃß´Â ½Ã°£, 0 ÀÌ¸é Àû¿ë ¾ÈÇÔ
	this.time_timer=null;
	this.time_timer_pause=null;
	this.mouseover=false;
	this.init();
	this.set_direction(this.direction);
}
js_rolling.prototype.init = function(){
	this.this_s.style.position='';
	this.this_s.style.overflow='hidden';
	var children = this.this_s.childNodes;
	for(var i=(children.length-1);0<=i;i--){
		if(children[i].nodeType==1){
			children[i].style.position='';
		}else{
			this.this_s.removeChild(children[i]);
		}
	}
	var this_s=this;
	this.this_s.onmouseover=function(){
		this_s.mouseover=true;
		if(!this_s.time_timer_pause){
			this_s.pause();
		}
	}
	this.this_s.onmouseout=function(){
		this_s.mouseover=false;
		if(!this_s.time_timer_pause){
			this_s.resume();
		}
	}
}
js_rolling.prototype.set_direction = function(direction){
	this.direction=direction;
	if(this.direction==2 ||this.direction==4){
		this.this_s.style.whiteSpace='nowrap';
	}else{
		this.this_s.style.whiteSpace='normal';
	}
	var children = this.this_s.childNodes;
	for(var i=(children.length-1);0<=i;i--){
			if(this.direction==1){
				children[i].style.display='block';
			}else if(this.direction==2){
				children[i].style.textlign='right';
				children[i].style.display='inline';
			}else if(this.direction==3){
				children[i].style.display='block';
			}else if(this.direction==4){
				children[i].style.display='inline';
			}
	}
	this.init_element_children();
}
js_rolling.prototype.init_element_children = function(){
	var children = this.this_s.childNodes;
	this.children = children;
	for(var i=(children.length-1);0<=i;i--){
			if(this.direction==1){
				children[i].style.top='0px';
			}else if(this.direction==2){
				children[i].style.left='-'+this.this_s.firstChild.offsetWidth+'px';
			}else if(this.direction==3){
				children[i].style.top='-'+this.this_s.firstChild.offsetHeight+'px';
			}else if(this.direction==4){
				children[i].style.left='0px';
			}
	}
}
js_rolling.prototype.act_move_up = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.top=(parseInt(child.style.top)-this.move_gap)+'px';
	}
	if((this.children[0].offsetHeight+parseInt(this.children[0].style.top))<=0){
		this.this_s.appendChild(this.children[0]);
		this.init_element_children();
		this.pause_act();
	}
}
js_rolling.prototype.move_up = function(){
	if(this.direction!=1&&this.direction!=3){return false;}
	this.this_s.appendChild(this.children[0]);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.act_move_down = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.top=(parseInt(child.style.top)+this.move_gap)+'px';
	}
	if(parseInt(this.children[0].style.top)>=0){
		this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();
	}
}
js_rolling.prototype.move_down = function(){
	if(this.direction!=1&&this.direction!=3){return false;}
	this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.act_move_left = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.left=(parseInt(child.style.left)-this.move_gap)+'px';
	}
	if((this.children[0].offsetWidth+parseInt(this.children[0].style.left))<=0){
		this.this_s.appendChild(this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();
	}
}
js_rolling.prototype.move_left = function(){
	if(this.direction!=2&&this.direction!=4){return false;}
	this.this_s.appendChild(this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.act_move_right = function(){
	for(var i = 0,m=this.children.length;i<m;i++){
		var child = this.children[i];
		child.style.left=(parseInt(child.style.left)+this.move_gap)+'px';
	}

	if(parseInt(this.this_s.lastChild.style.left)>=0){
		this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
		this.init_element_children();
		this.pause_act();
	}
}
js_rolling.prototype.move_right = function(){
	if(this.direction!=2&&this.direction!=4){return false;}
	this.this_s.insertBefore(this.this_s.lastChild,this.this_s.firstChild);
	this.init_element_children();
	this.pause_act();
}
js_rolling.prototype.start = function(){ //·Ñ¸µ ½ÃÀÛ
	var this_s = this;
	this.stop();
	this.is_rolling = true;
	var act = function(){
		if(this_s.is_rolling){
			if(this_s.direction==1){this_s.act_move_up();}
			else if(this_s.direction==2){this_s.act_move_right();}
			else if(this_s.direction==3){this_s.act_move_down();}
			else if(this_s.direction==4){this_s.act_move_left();}
		}
	}
	this.time_timer = setInterval(act,this.time_dealy);
}
js_rolling.prototype.pause_act = function(){ //ÀÏ½Ã µ¿ÀÛ
	if(this.time_dealy_pause){
		var this_s = this;
		var act = function(){this_s.resume();this_s.time_timer_pause=null;}
		if(this.time_timer_pause){clearTimeout(this.time_timer_pause);}
		this.time_timer_pause = setTimeout(act,this.time_dealy_pause);
		this.pause();
	}
}
js_rolling.prototype.pause = function(){ //ÀÏ½Ã ¸ØÃã
	this.is_rolling = false;
}
js_rolling.prototype.resume = function(){ //ÀÏ½Ã ¸ØÃã ÇØÁ¦
	if(!this.mouseover){
		this.is_rolling = true;
	}
}
js_rolling.prototype.stop = function(){ //·Ñ¸µÀ» ³¡³¿
	this.is_rolling = false;
	if(!this.time_timer){
		clearInterval(this.time_timer);
	}
	this.time_timer = null
}

/*left ¸Þ´º*/
function initSubmenu(depth1, depth2, depth3) {
selectDepth1 = "menu" + depth1 + "-" + depth2;
selectDepth2 = "menu" + depth1 + "-" + depth2 + "-" + depth3;
nav = document.getElementById("left");
menuEl = nav.getElementsByTagName("li");
//alert(menuEl.length);
	for(i = 0; i < menuEl.length; i++) {
		if (menuEl.item(i).id == selectDepth1 || menuEl.item(i).id == selectDepth2) {
			menuEl.item(i).getElementsByTagName("img").item(0).src = menuEl.item(i).getElementsByTagName("img").item(0).src.replace("_off.gif", "_on.gif");
		} else {
			//menuEl.item(i).getElementsByTagName("img").item(0).onmouseover = menuOver;
			//menuEl.item(i).getElementsByTagName("img").item(0).onmouseout = menuOut;
			/*if (menuEl.item(i).getElementsByTagName("ul").item(0)) {
				menuEl.item(i).getElementsByTagName("ul").item(0).style.display = "none";
			}*/
		}
	}
}
/* list toggle */
function initToggleList(ulEl, que, ans) {
	currentListNum = false;
	queEl = ulEl.getElementsByTagName(que);
	ansEl = ulEl.getElementsByTagName(ans);

	for (i=0;i<queEl.length;i++) {
		ansEl.item(i).listNum = i;
		queEl.item(i).listNum = i;
		ansEl.item(i).className = "off";
		queEl.item(i).onclick = toggleList;
	}
}
function toggleList () {
	if (currentListNum != false && this.listNum != currentListNum-1 ) {
		queEl.item(currentListNum-1).className = null;
		ansEl.item(currentListNum-1).className = "off";
	}
	if (this.className == "on") {
		queEl.item(this.listNum).className = null;
		ansEl.item(this.listNum).className = "off";
		currentListNum = false;
	} else {
		this.className = "on";
		ansEl.item(this.listNum).className = "on";
		currentListNum = this.listNum + 1;
	}
}

/*Ä«Å×°í¸®*/
function categorymovie(over){
	if(over=='over')
	{
		document.getElementById('sub_category').style.width='992px';
		chgSelect();
	}
	else
	{
		/*setTimeout("document.getElementById('sub_category').style.width='194px'",1000);
		setTimeout("document.getElementById('sub_category').style.height='30px'",1000);*/
		chgSelectDefaut();
	}
}