
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_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_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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
	
function _open_menu(catid,event) {  
/*
	var rightedge=document.body.clientWidth-event.clientX ;
	var bottomedge=document.body.clientHeight-event.clientY ;

	if (rightedge<catid.offsetWidth) 
	catid.style.left=document.body.scrollLeft+event.clientX-catid.offsetWidth 
	else 
	catid.style.left=document.body.scrollLeft+event.clientX 

	if (bottomedge<catid.offsetHeight) 
	catid.style.top=document.body.scrollTop+event.clientY-catid.offsetHeight 
	else 
	catid.style.top=document.body.scrollTop+event.clientY 
*/
	//alert(document.body.clientWidth);
	
	var half = document.body.clientWidth / 2;
/*
	if(half < event.clientX){
		catid.style.left = (document.body.clientWidth - 875)/2 + (865/2 - document.all["category"].offsetWidth) -5;		
	}else{
		catid.style.left = (document.body.clientWidth - 875)/2 + document.all["category"].offsetWidth -5;
	}
*/
	if(half < event.clientX){
		catid.style.left = event.clientX - event.offsetX - 150 + 5;
	}else{
		catid.style.left = event.clientX - event.offsetX + document.all[event.srcElement.name].width-5;
	}
	
//	alert(event.clientY - event.offsetY);
//	alert(event.clientY);
//	alert(event.offsetY);
//	alert(document.all[event.srcElement.name].clientY);
//	alert(document.body.scrollTop);

	catid.style.top = (document.body.scrollTop + event.clientY - event.offsetY - 5);
//	alert("---"+event.clientY+"--"+catid.style.top);
	catid.style.display="block"; 

} 

function _close_menu(catid) {  
	catid.style.display="none"; 
}

function _open_menu_product(catid,event) {  

	var half = document.body.clientWidth / 2;

	if(half < event.clientX){
		catid.style.left = event.clientX - event.offsetX - 150 + 5;
	}else{
		catid.style.left = event.clientX - event.offsetX + 150-5;
	}

	catid.style.top = (document.body.scrollTop + event.clientY - event.offsetY - 5);
	catid.style.display="block"; 
	top_4.style.display="block"; 
}	
function _close_menu_product(catid) { 
	catid.style.display="none"; 
	//top_4.style.visibility="hidden";  
}

function searchSubmit(form){
	if(!form.key.value){
		alert('°Ë»öÇÏ½Ç Å°¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä!');
		form.key.focus();
		return false;
	}
	return;
}
function listchange(){
	listform.submit();
}
function matchsubmit(){

	var cnt;
	var matchvalue = "";
	Fieldcnt = document.matchform.elements.length;

	cnt = 0;
	for(i=0; i<Fieldcnt; i++ ){
		subname = document.matchform.elements[i].name.substring(0,3);

		if(subname == "ids"){
			if(document.matchform.elements[i].checked){
/*
				if(i == 0) matchvalue = document.matchform.elements[i].value;
				else matchvalue = matchvalue + "," + document.matchform.elements[i].value;
*/
				if(matchvalue != "") matchvalue += ",";
				matchvalue = matchvalue + document.matchform.elements[i].value;
			
				cnt++;
			}
		}
	}
	if(cnt == 0){
		alert("»óÇ°À» ¼±ÅÃÇØÁÖ¼¼¿ä");
		return;
	}
	else if(cnt > 4 || cnt < 2){
		alert("»óÇ° ºñ±³´Â 2ÀÌ»ó, 4°³±îÁö °¡´ÉÇÕ´Ï´Ù.");
		return;
	}
	var url = "product.asp?cmd=product_match&shopid=$$SHOPID$&ids="+matchvalue;		
	
	window.open(url,"popup",'scrollbars=yes,resizable=yes,width=600,height=500,status=no');
	//matchform.submit();
}

function open_img(url,sts){

	var url,sts;
	if(sts == "no"){
		alert("µî·ÏµÈ ÀÌ¹ÌÁö°¡ ¾ø½À´Ï´Ù");
	}else{
		window.open(url,"zipWin",'scrollbars=yes,resizable=yes,width=600,height=500,status=no');
	}
}

function open_window(url,winname,width,height,scroll){

	if(url == "profile.asp") {
		width = "870";
		height= "640";
	}

	var url;
	var width,height;

	var fullW = screen.availwidth;
	var fullH = screen.availHeight;

	var lefts = fullW/2 -(width/2);
	var tops = fullH/2 - (height/2);

	if(!scroll) scroll = "no";
	else if(scroll == "") scroll = "no";
	else scroll = scroll;
/*
	if(!scroll) scroll = "yes";
	else scroll = "no";
*/

	var option = "scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",status=no,top="+tops+",left="+lefts;

	window.open(url,winname,option);
}

function open_window2(url,winname,width,height,scroll,toolbar){

	var url;
	var width,height;

	var fullW = screen.availwidth;
	var fullH = screen.availHeight;

	var lefts = fullW/2 -(width/2);
	var tops = fullH/2 - (height/2);

	if(!scroll) scroll = "no";
	else if(scroll == "") scroll = "no";
	else scroll = scroll;
/*
	if(!scroll) scroll = "yes";
	else scroll = "no";
*/

	var option = "scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",status=no,top="+tops+",left="+lefts+",toolbar="+toolbar;

	window.open(url,winname,option);
}

//ÆË¾÷ Ã¢À» ¶ç¿ì´Â..ÇÔ¼ö.µû·Î ÇÑ°³ ´õ ¸¸µé¾î¼­...ÀÚµ¿À¸·Î ÆË¾÷µÇ°Ô.
function open_popups(url,winname,width,height,scroll){

	var url;
	var width,height,scroll;

	var fullW = screen.availwidth;
	var fullH = screen.availHeight;

	var lefts = fullW/2 -(width/2);
	var tops = fullH/2 - (height/2);

	if(!scroll) scroll = "no";
	else if(scroll == "") scroll = "no";

//	var option = "scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",status=no,top="+tops+",left="+lefts;
	var option = "scrollbars="+scroll+",resizable=no,width="+width+",height="+height+",status=no";

	window.open(url,winname,option);
}

function open_popups_moveto(url,winname,width,height,scroll,x,y){

	var url;
	var width,height,scroll;

	var fullW = screen.availwidth;
	var fullH = screen.availHeight;

	var lefts = fullW/2 -(width/2);
	var tops = fullH/2 - (height/2);

	if(!scroll) scroll = "no";
	else if(scroll == "") scroll = "no";

//	var option = "scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",status=no,top="+tops+",left="+lefts;
	var option = "scrollbars="+scroll+",resizable=no,width="+width+",height="+height+",status=no,top="+y+",left="+x;

	window.open(url,winname,option);
}
function movie_open(){
	var url = movieform.movie.value;

	if(url == "x") return false;

	if(url.substring(0,5) == "movie"){		
		window.open(url,'_movie','scrollbars=no,resizable=yes,width=380,height=400,status=no');
	}else if(url.substring(0,7) == "/image/"){		
		window.open(url,'_movie','scrollbars=no,resizable=yes,width=1024,height=768,status=no');
	}else{
		window.open(url,'_cartoon','scrollbars=no,resizable=yes,width=445,height=525,status=no');
	}
}
	function poll_submit(){

		var cnt;
		var novalue = "";
		Fieldcnt = document.pollform.elements.length;

		cnt = 0;
		for(i=0; i<Fieldcnt; i++ ){
			subname = document.pollform.elements[i].name.substring(0,3);

			if(subname == "no"){
				if(document.pollform.elements[i].checked){
					novalue = document.pollform.elements[i].value;
					cnt++;
				}
			}
		}
		if(cnt == 0){
			alert("ÅõÇ¥Ç×¸ñÀ» ¼±ÅÃÇØÁÖ¼¼¿ä");
			return;
		}
		return;
	}
function open_bbs(catid,event){

	var rightedge=document.body.clientWidth-event.clientX ;
	var bottomedge=document.body.clientHeight-event.clientY ;

	if (rightedge<catid.offsetWidth) 
	catid.style.left=document.body.scrollLeft+event.clientX-catid.offsetWidth+8;
	else 
	catid.style.left=document.body.scrollLeft+event.clientX+8;

	if (bottomedge<catid.offsetHeight) 
	catid.style.top=document.body.scrollTop+event.clientY-catid.offsetHeight 
	else 
	catid.style.top=document.body.scrollTop+event.clientY 

	catid.style.display="block";
}
function close_bbs(catid) {
    catid.style.display="none";
}

function doBlink() {
    var blink = document.all.tags("BLINK")
    for (var i=0; i < blink.length; i++)
        blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function startBlink() {
    if (document.all)
        setInterval("doBlink()",500)
}

function have_licence(str)
{
	/* checkFormat */
	 var isEMBED = /.*<embed\s.*/gi;
	 var isBGSOUND = /.*<bgsound\s.*/gi;

	 if( isEMBED.test(str) || isBGSOUND.test(str)) {
		 if(confirm('ÀÛ¼ºÇÏ½Å º»¹®³»¿¡ ÀúÀÛ±ÇÄ§ÇØ °¡´É¼ºÀÌ ÀÖ´Â À½¿ø¸µÅ©µî¿¡ »ç¿ëµÉ ¼ö ÀÖ´Â EMBED,BGSOUNDµîÀÇ ÅÂ±×°¡ ÀÖ½À´Ï´Ù.\nÀúÀÛ±Ç Çã°¡¸¦ µæÇÏÁö ¾ÊÀº ¸ðµç À½¾Ç¹°¿¡ ´ëÇØ¼­ ¸µÅ©¸¦ °É¾î °Ô½ÃÇÏ´Â °æ¿ì ÀúÀÛ±Ç Ä§ÇØ·Î ´Ü¼Ó ´ë»óÀÌ µË´Ï´Ù.\nÀÚ¼¼ÇÑ ³»¿ëÀº 2005³â 1¿ù 17ÀÏÀÚ ¼¥ÀÇ °øÁö»çÇ×À» È®ÀÎ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n\nÀúÀÛ±ÇÄ§ÇØ ¾ø´ÂÄÁÅÙÃ÷ÀÌ¹Ç·Î ±×´ë·Îµî·ÏÇÑ´Ù: È®ÀÎ \t\t³»¿ëÀ» ´Ù½Ã Àç¼öÁ¤ÇÑ´Ù: Ãë¼Ò')){
			return true;
		 }
		 else {
			return false;
		 }
	 }
	 else {
		return true;
	 }
}

	// embed °ü·Ã 

	function GET(arrayKey, arrayValue, Value) {
		count = arrayKey.length;
		for(i=0;i<count;i++) {
			if(arrayKey[i]==Value) {
				return arrayValue[i];
				break;
			}
		}
	}

	function mEmbed() {
		var key = new Array();
		var value = new Array();
		error_check=0;
		for(i=0;i<mEmbed.arguments.length;i++) {
			data = mEmbed.arguments[i].split('=');
			key[i] = data[0];
			value[i] = data[1];
		}

		contents = '';
		srcdata = GET(key,value,'src');
		if(/\.(...)$/.test(srcdata)) {
			flashon = 1;
		}

		classid = GET(key,value,'classid');
		codebase = GET(key,value,'codebase');
		if(flashon==1) {
			classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
			codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0';
		}
		if(classid && codebase) {
			contents += '<object';
			if(classid) {
				contents += ' classid="' + classid + '"';
			}
			if(codebase) {
				contents += ' codebase="' + codebase + '"';
			}
			count = key.length;
			for(i=0;i<count;i++) {
				if(value[i]!='') {
					if(key[i]!='src') {
						contents += ' ' + key[i] + '="' + value[i] + '"';
					}
				}
			}
			contents += '>';
			for(i=0;i<count;i++) {
				if(value[i]!='') {
					if(flashon==1 && key[i]=='src') {
						contents += '<param name="movie" value="' + value[i] + '" />';
					} else {
						contents += '<param name="' + key[i] + '" value="' + value[i] + '" />';
					}
				}
			}
		}
		contents += '<param name=wmode value=transparent>';
		contents += '<embed';
		for(i=0;i<count;i++) {
			if(value[i]!='') {
				contents += ' ' + key[i] + '="' + value[i] + '"';
			}
		}
		contents += '>';
		contents += ' </embed>';
		if(classid && codebase) {
			contents += '</object>';
		}
		document.write(contents);
	}

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

	// embeded ¿ä±â ±îÁö 


/*
  var bn = 'Unknown', cpu='Unknown', ref='', url='', av='Unknown', os='Unknown', color='Unknown', ua='Unknown', res='';
  bn=navigator.appName;
  cpu=navigator.cpuClass; 
  os=navigator.platform; 
  av=navigator.appVersion;
  ref=document.referrer;
  url=document.URL;
  ua = navigator.userAgent;
  res=window.screen.width+"*"+window.screen.height; 
  var img = new Image() ;
  ref = 'http://dev.altwell.biz/logc/'+'?cpu='+cpu+'&bn='+bn+'&av='+av+'&os='+os+'&ref='+escape(ref)+'&url='+escape(url)+'&ua='+ua+'&res='+res;
  img.src = ref;
*/

