
// png file
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=''; 
	return '';
}

//gnb
function gnb(path, n)	{		
	for(var i=1; i<6 ; i++)	{
		obj = document.getElementById('gnb_sub0' + i);
		obj_i = document.getElementById('gnb0' + i);
		if (i == n)	{
		obj.style.visibility = "visible";
		obj_i.setAttribute('src','/images/'+path+'/gnb0'+n+'_on.gif');
		} else	{
			obj.style.visibility = "hidden";
			obj_i.setAttribute('src','/images/'+path+'/gnb0'+i+'.gif');
		}
	}
}

// view, hide Layer 
function showCon(idName)	{
	 obj = document.getElementById(idName);
	 obj.style.display = "block";	
}

function hideCon(idName)	{
	 obj = document.getElementById(idName);
	 obj.style.display = "none";
}

function upZindex(idName)	{
	document.getElementById(idName).style.zIndex = "10";
}

function downZindex(idName)	{
	document.getElementById(idName).style.zIndex = "0";
}

// view, hide input_box for IE6.0 
function hideSelect(idName)	{
	 if(navigator.appVersion.indexOf("MSIE 6.0") >= 0) {
		 obj = document.getElementById(idName);
		 var selects = obj.getElementsByTagName("select");
		 for (var i=0 ; i<selects.length ; i++) {
			 selects[i].style.visibility = "hidden";
		 }
	 }
}

function showSelect(idName)	{
	if(navigator.appVersion.indexOf("MSIE 6.0") >= 0) {
		 obj = document.getElementById(idName);
		 var selects = obj.getElementsByTagName("select");
		 for (var i=0 ; i<selects.length ; i++) {
			 selects[i].style.visibility = "visible";
		 }
	}
}

// gallery - left&right
function photoScrollWidth(widthV,name)	{	
	var photoScrollList=document.getElementById(name);
	var photoScrollEa = photoScrollList.getElementsByTagName("li");
	var photoScrollWidth	= photoScrollEa.length * widthV;
	photoScrollList.style.width = photoScrollWidth + "px";
}

function	photoScrollMove(moveF,moveV,EA,name)	{
	var photoScrollList=document.getElementById(name);
	var photoScrollLeft = photoScrollList.style.left;
	photoScrollLeft = parseInt(photoScrollLeft.replace("px",""));
	photoScrollWidth = photoScrollList.style.width;
	photoScrollWidth = parseInt(photoScrollWidth.replace("px",""));
	photoScrollWidth = -(photoScrollWidth + (moveV*EA));
	if (moveF == "P") {
		if (photoScrollLeft !=0)	{
			photoScrollList.style.left = photoScrollLeft + moveV + "px";
		}
		else	alert("This is the first page")
	}
	else	{		
		if (photoScrollLeft > photoScrollWidth)	{
			photoScrollList.style.left = photoScrollLeft + moveV + "px";
		}
		else	alert("This is the last page")
	}
}


function viewBig(prodWidth, idName)	{
	document.getElementById("prod_B").src = "/images/product/prod" + prodWidth + "_b0" + idName + ".jpg";
}

// gallery2 - up&down
function photoScrollHeight(heightV,name)	{	
	var photoScrollList=document.getElementById(name);
	var photoScrollEa = photoScrollList.getElementsByTagName("li");
	var photoScrollHeight	= Math.floor((photoScrollEa.length) / 8 + 1) * heightV;
	photoScrollList.style.height = photoScrollHeight + "px";
}

function	photoScrollMoveH(moveF,moveV,EA,name)	{
	var photoScrollList=document.getElementById(name);
	var photoScrollTop = photoScrollList.style.top;
	photoScrollTop = parseInt(photoScrollTop.replace("px",""));
	photoScrollHeight = photoScrollList.style.height;
	photoScrollHeight = parseInt(photoScrollHeight.replace("px",""));
	photoScrollHeight = -(photoScrollHeight + (moveV*EA));
	if (moveF == "P") {
		if (photoScrollTop !=0)	{
			photoScrollList.style.top = photoScrollTop + moveV + "px";
		}
		else	alert("This is the first page")
	}
	else	{		
		if (photoScrollTop > photoScrollHeight)	{
			photoScrollList.style.top = photoScrollTop + moveV + "px";
		}
		else	alert("This is the last page")
	}
}


// 2-depth align
function sub_width()	{	
	var i=0;
	var obj = document.getElementById('sub_width');
	var obj_pro = document.getElementById("gnb_sub01");
	var obj_length = obj.getElementsByTagName('li');
	var obj_ul = obj.getElementsByTagName('ul');		
	for (n=0; n<obj_length.length ; n++){
		i += obj_length[n].offsetWidth;
		obj_ul[0].style.visibility = 'hidden';
		obj.style.width = i + 1+ 'px';
		obj_pro.style.width = i + 1+ "px";		
		
	}		
	obj_pro.style.marginRight = ((780 - i)/3) + "px";	
	obj_ul[0].style.visibility = 'visible';
}