// png ie6
//var clear="/images/common/clear.gif"; //path to clear.gif
//document.write('<script type="text/javascript" id="ct" defer="defer" src="javascript:void(0)"><\/script>');var ct=document.getElementById("ct");ct.onreadystatechange=function(){pngfix()};pngfix=function(){var els=document.getElementsByTagName('*'),ip=/\.png/i,al="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",i=els.length,uels=new Array(),c=0;while(i-->0){if(els[i].className.match(/unitPng/)){uels[c]=els[i];c++;}}if(uels.length==0)pfx(els);else pfx(uels);function pfx(els){i=els.length;while(i-->0){var el=els[i],es=el.style,elc=el.currentStyle,elb=elc.backgroundImage;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter=al+el.src+"',sizingMethod='crop')";el.src=clear;}else{if(elb.match(ip)){var path=elb.split('"'),rep=(elc.backgroundRepeat=='no-repeat')?'crop':'scale',elkids=el.getElementsByTagName('*'),j=elkids.length;es.filter=al+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';if(j!=0){if(elc.position!="absolute")es.position='static';while(j-->0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}};};


// MAIN : banner
function MainBanner(obj, arg_Length) {
	var obj_Image;
	var obj_Button;

	for (i = 1; i <= arg_Length; i++) {
		obj_Image = eval("document.getElementById('HotArrival" + i + "')");
		obj_Button = eval("document.getElementById('HotArrivalImg" + i + "')");
		if (eval(obj) == i) {
			obj_Image.style.display = "block";
			obj_Button.src = "/images/main/no_"+ i +"_on.gif";
		} else {
			obj_Image.style.display = "none";
			obj_Button.src = "/images/main/no_"+ i +".gif";
		}
	}
}


// COMMON : category
function CategoryMenu(obj) {
	for(Li=1;Li<=3;Li++){
		getCateMenu		= eval("document.getElementById('cateMenu_"+ Li +"')");
		getCategoryImg	= eval("document.getElementById('CategoryImg"+ Li +"')");

		if(obj == Li){
			if(getCateMenu.style.display == "block"){
				getCateMenu.style.display	= "none";
				getCategoryImg.src				= "/images/common/cate_"+ Li +".gif";
			}else{
				getCateMenu.style.display	= "block";
				getCategoryImg.src				= "/images/common/cate_"+ Li +"_on.gif";
			}
		}else{
			getCateMenu.style.display	= "none";
			getCategoryImg.src				= "/images/common/cate_"+ Li +".gif";
		}
	}
}


// COMMON : left menu
function topCateShow(obj){
	document.getElementById(obj).style.display = "block";
	document.getElementById(obj).style.zIndex = "980";
}

// COMMON : left menu
function topCateHide(obj){
	document.getElementById(obj).style.display = "none";
	document.getElementById(obj).style.zIndex = "500";
}



// COMMON : left menu
function subCateShow(obj){
	document.getElementById(obj).style.display = "block";
	document.getElementById(obj).style.zIndex = "1000";
}

// COMMON : left menu
function subCateHide(obj){
	document.getElementById(obj).style.display = "none";
	document.getElementById(obj).style.zIndex = "900";
}

//**********************************************************************************//
//입력폼에서 Null문자를 제거
//	varStr	: document.form.Inputbox.value
//**********************************************************************************//
function Trim(varStr) {
	var reg = /\s+/g;
	return varStr.replace(reg,'');
}

//**********************************************************************************//
//사용자 입력폼 입력여부 체크
//	varObject	: document.form.inputbox
//	varName		: 입력폼 이름
//**********************************************************************************//
function fncCheckUserInputbox(varObject, varName) {
	if (Trim(varObject.value) == "") {
		alert("Please enter " + varName);
		varObject.value = "";
		varObject.focus();
		return false;
	} else {
		return true;
	}
}

//**********************************************************************************//
//사용자 입력폼 입력여부 체크
//	varObject	: document.form.ListBox
//	varName		: 선택폼 이름
//**********************************************************************************//
function fncCheckUserListBox(varObject, varName) {
	if (Trim(varObject.value) == "") {
		alert("Please selected" + varName);
		varObject.focus();
		return false;
	} else {
		return true;
	}
}

//**********************************************************************************//
//새창 (일반)
//	varUrl	: 새창 URL
//	varName	: 새창 이름
//	varWidth	: 새창 넓이
//	varHeight : 새창 높이
//**********************************************************************************//
function fncWindowOpenSize(varUrl, varName, varWidth, varHeight)
{
	var varOption = "toolbar=no, menubar=no, location=no, resizable=no, scrollbars=no, directories=no, width=" + varWidth + ",height=" + varHeight + "";
	var winPopup = window.open(varUrl, varName, varOption);
}

function embedFlash(id, flashFile, w, h, code){
	var linkInfo = "";
	var objInfo = "";
	var flashVars = "";

 	linkInfo = flashFile;

	objInfo+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + w + "' height='" + h + "' id='" + id + "' name='" + id + "'>";
	objInfo+="<param name='movie' value='" + linkInfo + "'>";
	objInfo+="<param name='FlashVars' value='" + flashVars + "'>";
	objInfo+="<param name='allowScriptAccess' value='always'>";
	objInfo+="<param name='quality' value='high'>";
	objInfo+="<param name='wmode' value='transparent' />";
	objInfo+="<param name='menu' value='false' />";
	objInfo+="<embed menu='false' src='" + linkInfo + "' wmode='transparent'  quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + w + "' height='" + h + "' FlashVars='" + flashVars + "' allowScriptAccess='always' swLiveConnect=true id='" + id + "' name='" + id + "'></embed></object>";
	document.write(objInfo);

}


function fnc_OriginPopupView(src) { 
//what = document.frmPrc.txtQryimg1[""+id+""].value;
what = src;
var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10'); 
imgwin.focus(); 
imgwin.document.open(); 
imgwin.document.write("<html>\n"); 
imgwin.document.write("<head>\n"); 
imgwin.document.write("<title>**</title>\n"); 

imgwin.document.write("<sc"+"ript>\n"); 
imgwin.document.write("function resize() {\n"); 
imgwin.document.write("pic = document.il;\n"); 
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height ; myWidth = eval(pic).width ;\n"); 
imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 

imgwin.document.write("  var height = screen.height;\n"); 
imgwin.document.write("  var width = screen.width;\n"); 
 

  // 가로, 세로 최대 사이즈 설정
imgwin.document.write("   var maxWidth = width*0.7 ; ");  // 원하는대로 설정. 픽셀로 하려면 maxWidth = 100  이런 식으로 입력
imgwin.document.write("   var maxHeight = height*0.7 ;  "); // 원래 사이즈 * 0.5 = 50%
   // 가로나 세로의 길이가 최대 사이즈보다 크면 실행  
imgwin.document.write("   if(myWidth >= maxWidth || myHeight >= maxHeight){\n ");
   // 가로가 세로보다 크면 가로는 최대사이즈로, 세로는 비율 맞춰 리사이즈
imgwin.document.write("      if(myWidth > myHeight){\n ");
imgwin.document.write("         resizeWidth = maxWidth; \n");
imgwin.document.write("         resizeHeight =(myHeight * resizeWidth) / myWidth; \n");
   // 세로가 가로보다 크면 세로는 최대사이즈로, 가로는 비율 맞춰 리사이즈
imgwin.document.write("      }else{\n ");
imgwin.document.write("         resizeHeight = maxHeight;\n ");
imgwin.document.write("         resizeWidth = (myWidth * resizeHeight) / myHeight; \n");
imgwin.document.write("      }  \n");
   // 최대사이즈보다 작으면 원본 그대로
imgwin.document.write("   }else{ \n");
imgwin.document.write("      resizeWidth = myWidth;\n ");
imgwin.document.write("      resizeHeight = myHeight;\n ");
imgwin.document.write("   } \n");
imgwin.document.write("  } \n");
imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
imgwin.document.write("  self.moveTo(leftpos, toppos);\n"); 
//imgwin.document.write("  self.resizeTo(resizeWidth, resizeHeight);\n"); 
imgwin.document.write("  self.resizeTo(resizeWidth, resizeHeight);\n"); 
imgwin.document.write("  pic.height = resizeHeight;\n"); 
imgwin.document.write("  pic.width =  resizeWidth;\n");

imgwin.document.write("};\n"); 
imgwin.document.write("</sc"+"ript>\n"); 

imgwin.document.write("</head>\n"); 
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 

imgwin.document.write("<img border=0 src='"+what+"' xwidth=10 xheight=9 name=il style=cursor:hand onclick='self.close()'  onload='resize();'>\n"); 
imgwin.document.write("</body>\n"); 
imgwin.document.close(); 

} 
