
function AllCk(frm)
{
	var len = frm.choiceCart.length;

	if (frm.Cktype.value=='all')
	{
		for (i=1;i<len;i++)
		{
			frm.choiceCart[i].checked = true;
		}
		frm.Cktype.value = 'alldel'
		//frm.t01_change.src = '/data/<%=siteID%>/goods/t02.gif';
		//frm.t01_change1.src = '/data/<%=siteID%>/goods/t02.gif';
	}
	else
	{
		for (i=1;i<len;i++)
		{
			frm.choiceCart[i].checked = false
		}
		frm.Cktype.value = "all"
		//frm.t01_change.src = '/data/<%=siteID%>/goods/t01.gif';
		//frm.t01_change1.src = '/data/<%=siteID%>/goods/t01.gif';
	}
}

function choiceCartIn(frm)
{
	var len = frm.choiceCart.length;
	var k = 0;
	var num = "";
	var ea = "";

	for (i=1;i<len;i++)
	{
		if (frm.choiceCart[i].checked==true)
		{
			k++
			num = num + frm.CkNum[i].value + ","
			ea = ea + frm.ea[i].value + ","
		}
	}

	if (k==0)
	{
		alert("Ç×¸ñÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä");
		return ;
	}
	frm.CartNum.value = num ; 
	frm.CartEa.value = ea ; 
	frm.CartType.value = 'Ck';
	frm.submit();
}

function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}



function searchcheckform(theForm)
{
  if (Check(theForm.keyword.value) < 1)
  {
	alert("Ã£À¸½Ã°íÀÚ ÇÏ´Â ÇØ´ç °Ë»ö¾î¸¦ ½á ÁÖ¼¼¿ä!");
	theForm.keyword.focus();
    return (false);
  }
   
  
   return (true);
}

function Check(keyword) 
{
	var st_num, key_len;
	st_num = keyword.indexOf(" ");	
	while (st_num != -1)
	{
		keyword = keyword.replace(" ", "");
		st_num  = keyword.indexOf(" ");
	}
	key_len=keyword.length;
	return key_len;
}

var maxW,maxH,fromX,fromY,toX,toY,adjX,adjY,zBox,zStep=0,zLink,zNew;

function zoomBox(evt,zlink,maxw,maxh,tox,toy){

if (arguments.length > 2) zNew=1;
	scrollH=(window.pageYOffset!=null)?window.pageYOffset:document.body.scrollTop;
	maxW=maxw?maxw:window.innerWidth?innerWidth:document.body.clientWidth;
	maxH=maxh?maxh:window.innerHeight?innerHeight:document.body.clientHeight;
	toX=tox?tox:0;
	toY=(toy?toy:0)+scrollH;
	fromX=evt.pageX?evt.pageX:evt.clientX;
	fromY=(evt.pageY?evt.pageY:evt.clientY)+(document.all?scrollH:0);
	adjX=toX+evt.screenX-fromX;
	adjY=toY+evt.screenY-fromY;

if (document.createElement && document.body.appendChild && !zBox) {
	zBox=document.createElement("div");
	zBox.style.position="absolute";
	document.body.appendChild(zBox);
	document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
	zBox=document.all.zBoxDiv;

} else if (document.all && !zBox) {
	document.all[document.all.length-1].outerHTML+='<div id="zBoxDiv" style="position:absolute"></div>';
	zBox=document.all.zBoxDiv;

} else if (document.layers && !zBox) {
	zBox=new Layer(maxW);
	zBox.style=zBox;
	}

zLink=zlink;
doZoom();
}

function doZoom() {
zStep+=1;
zPct=(10-zStep)/10
if (document.layers) {
	zBox.moveTo(toX+zPct*(fromX-toX),toY+zPct*(fromY-toY));
	zBox.document.open();
	zBox.document.write("<table width='"+maxW*(1-zPct)+"' height="+maxH*(1-zPct)+" border=2 cellspacing=0><tr><td></td></tr></table>");
	zBox.document.close();
	} else {
	zBox.style.border="2px solid #999999";
	zBox.style.left=toX+zPct*(fromX-toX);
	zBox.style.top=toY+zPct*(fromY-toY);
	zBox.style.width=maxW*(1-zPct);
	zBox.style.height=maxH*(1-zPct);
	}
zBox.style.visibility="visible";
if (zStep < 10) setTimeout("doZoom("+fromX+","+fromY+","+toX+","+toY+")",30);
else {
	zBox.style.visibility='hidden';
	zStep=0;
	if (zLink && !zNew) location.href=zLink.href;
	else if (zLink && zNew) {
		var w=window.open(zLink.href,'','width='+maxW+',height='+maxH+',left=30,top=30,scrollbars=no,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0');
		zNew=null;
		}
	}
}

var win= null;
function popUpCenteredWindow(mypage,myname,w,h,ClickUrl){

	var winl =(screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ='height='+h+',';

	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars=no ,';
	settings +='toolbar=0,';
	settings +='location=0,';
	settings +='directories=0,';
	settings +='status=0,';
	settings +='menubar=no,';
	settings +='copyhistory=no';
	
	var Viewurl = "/PopUpViewer.asp?imgSrc=";
	var ClickUrl;

	win = window.open(Viewurl+mypage+"&ClickUrl="+ClickUrl+"&w="+w+"&h="+h,myname,settings);

	if(parseInt(navigator.appVersion) >= 4){
		win.window.focus();
	}
}

//È­¸é ÇÁ¸°Æ® ÇÏ±â
function print_open(num)
{  
	var  numVal = num;
	zmode = 1;
	myWindow = window.open("/goods/print/print.asp?num="+numVal+"" , "print", "scrollbars=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0,width=680 ,height=600");
}	

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//ÇÁ¸°Æ®ÇÏ±â
function print_list(gourl,query)
	{  
		 zmode = 1;
		 myWindow = window.open("../admin/print.asp?gourl="+gourl+"&query="+query, "print", "scrollbars=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0,width=680 ,height=600");
	}



function fnGoodsMove_Type1() {
	this.GoodsSetTime = null;
	this.BannerCurrent = 0;
	
	this.GoodsSetting = function() {
		this.ObjBox = document.getElementById(this.DivName);
		this.PrevBtnLink = document.getElementById(this.PrevBtn);
		this.NextBtnLink = document.getElementById(this.NextBtn);
		this.ObjUl = this.ObjBox.getElementsByTagName("ul")[0];
		this.ObjLi = this.ObjUl.getElementsByTagName("li");
		this.ObjLiNum = this.ObjLi.length;
		this.TotalWidth = this.DateWidth * this.ObjLiNum;
		
		this.ObjBox.style.width = this.TotalWidth + "px";
		
		if ( this.ObjLiNum % this.DateNum == 0 ) {
			this.BannerEnd = this.TotalWidth - ( this.DateWidth * this.DateNum );
		} else {
			this.BannerEnd = this.TotalWidth - this.DateWidth;
		}
		
		this.BannerPrevLeft = this.BannerEnd;
		this.BannerNextLeft = this.DateWidth * this.DateNum ;
		
		this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
		this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		
		this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame('" + this.BannerNextLeft + "','next')" , this.Delay );
	}
	
	this._moveFrame = function(val,fnmove) {
		clearTimeout(this.GoodsSetTime)
		
		if ( Math.abs(val - this.BannerCurrent) > 5 ) {
			this.BannerCurrent = this.BannerCurrent + ( val - this.BannerCurrent ) * this.Speed;
		} else {
			this.BannerCurrent = val;
		}
		
		this.ObjUl.style.left = ( -1 * this.BannerCurrent ) + "px";
		
		if ( this.BannerCurrent != val ) {
			this.GoodsSetTime = setTimeout(this.fnName + "._moveFrame(" + val + ",'" + fnmove + "')",10);
		} else {
			this.CurrentPicNum = this.BannerCurrent / this.DateWidth;
			
			this.BannerPrevLeft = this.BannerCurrent - ( this.DateWidth * this.DateNum );
			this.BannerNextLeft = this.BannerCurrent + ( this.DateWidth * this.DateNum );
			
			if ( this.BannerCurrent == 0 ) {
				this.BannerPrevLeft = this.BannerEnd;
			} else if ( this.BannerCurrent == this.BannerEnd ) {
				this.BannerNextLeft = 0;
			}
			this.PrevBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerPrevLeft + ",'prev')";
			this.NextBtnLink.href = "javascript:" + this.fnName +"._moveFrame(" + this.BannerNextLeft + ",'next')";
		}
		
		this.GoodsSetTime = setTimeout( this.fnName + "._moveFrame('" + this.BannerNextLeft + "','next')" , this.Delay );
	}
}
//ÀÌ¹ÌÁö ¿øº¸º¸±â
function showPicture(img) {
	var src = img;
  var imgObj = new Image();
  imgObj.src = src;
  var wopt = "scrollbars=yes,status=no,resizable=yes";
  wopt += ",width=" + imgObj.width;
  wopt += ",height=" + imgObj.height;
  var wbody = "<head><title>ÀÌ¹ÌÁö¿øº»º¸±â</title>";
   wbody += "<meta http-equiv=imagetoolbar content=no>"
  wbody += "<script language='javascript'>";
  wbody += "function finalResize(){";
  wbody += "  var oBody=document.body;";
  wbody += "  var oImg=document.images[0];";
  wbody += "  var xdiff=oImg.width-oBody.clientWidth;";
  wbody += "  var ydiff=oImg.height-oBody.clientHeight;";
  wbody += "  window.resizeBy(xdiff,ydiff);";
  wbody += "}";
  wbody += "</script>";
  wbody += "</head>";
  wbody += "<body onLoad='finalResize()' style='margin:0'>";
  wbody += "<a href='javascript:window.close()'><img src='" + src + "' border=0 alt='Ã¢´Ý±â'></a>";
  wbody += "</body>";
  winResult = window.open("about:blank","",wopt);
  winResult.document.open("text/html", "replace");
  winResult.document.write(wbody);
  winResult.document.close();
  return;
}

