var C_id;

function $(Str) { return document.getElementById(Str); }

function $$(Str) { return document.getElementsByName(Str); }

if (window.attachEvent) {
	var addEvent = function (Element,Handle,Action) { return Element.attachEvent(Handle,Action); }
} else if (window.addEventListener) {
	var addEvent = function (Element,Handle,Action) { return Element.addEventListener(Handle.replace(/^on/i,""),Action,false); }
}

var _downFilePath = "/upfile/";

function SetC_id(id)
{
	C_id = id;
}

function isNull( text )  
{  
	 if( text == null ) return true;  

	 var result = text.replace(/(^\s*)|(\s*$)/g, "");  

	 if( result )	  return false;  
	 else    return true;  
}


function CheckNumber(fl) {
	t = fl.value ;
	for(i=0;i<t.length;i++) 
	if (t.charAt(i)<'0' || t.charAt(i)>'9') {
		alert("숫자만 입력해주세요.") ;
		fl.value="";
		fl.focus() ;
		return false ;
	}
}


function CheckFloat(fl) {
	t = fl.value ;
	for(i=0;i<t.length;i++) 
	if (  t.charAt(i)!='.' && (t.charAt(i)<'0' || t.charAt(i)>'9') ) {
		alert(" 소수점과 숫자만 입력해주세요.") ;
		fl.value="";
		fl.focus() ;
		return false ;
	}
}


function CheckMinus(fl) {
	t = fl.value ;
	for(i=0;i<t.length;i++) 
	if (  t.charAt(i)!='-' && (t.charAt(i)<'0' || t.charAt(i)>'9') ) {
		alert(" '-'와 숫자만 입력해주세요.") ;
		fl.value="";
		fl.focus() ;
		return false ;
	}
}


function CheckBar(fl) {
	t = fl.value ;
	for(i=0;i<t.length;i++) 
	if (  t.charAt(i)!='|' && (t.charAt(i)<'0' || t.charAt(i)>'9') ) {
		alert(" '|'와 숫자만 입력해주세요.") ;
		fl.value="";
		fl.focus() ;
		return false ;
	}
}



var alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var alphaS= 'abcdefghijklmnopqrstuvwxyz';
var numeric = '1234567890';
var dash = '_-';
var special = "`%^&{}|=<>?#'$\\\";:";
var dot = '.';
var email = '@'
var selftextgubun = ',';

function checknorm(target, cmt, astr, lmax,lshort)
{
	var i; 

	var t =trim(target.value); 
	if (t.length == 0 )
	{
		alert(cmt + '(을)를 정확히 기재해 주십시오.'); 
		target.focus(); 
		return true ; 
	}    
	if (lshort != 0 && t.length < lshort)
	{
		alert(cmt + '는 ' + lshort + '자 이상만 가능합니다.');
		target.focus()
		return true;
	}
	if (lmax != 0 && t.length > lmax)
	{
		alert(cmt + '는 ' + lmax + '자 이내만 가능합니다.');
		target.focus()
		return true;
	}	
	if (astr.length >= 1) 
	{
		for (i=0; i<t.length; i++)
		if(astr.indexOf(t.substring(i,i+1))<0)
		{
			alert(cmt + '에 정확히 입력해 주십시오.');
			try{				
				target.focus();
			}
			catch ( ex )
			{
			}		
			
			return true;
		}
	}
	return false
}	

function checkid(target, cmt)
{
	var login_id = target.value;
	var ascii, i;

	if (login_id == "")
	{
		return true;
	}

	for (i=0;i < login_id.length ;i++)
	{
		ascii = login_id.charCodeAt(i);
		if ((i==0) && ((ascii < 97) || (ascii  > 122)))
		{
			alert("첫 글자는 영문소문자만 가능합니다.");
			target.focus();
			return true;
		}
		else if (   ascii >= 65 && ascii <= 90 )
		{
			alert(" 영문 대문자는 사용할 수 없습니다.");
			target.focus();
			return true;
		}
		else if (ascii > 122)
		{
			alert("한글을 비롯한 특수문자는 사용할 수 없습니다.");
			target.focus();
			return true;
		}
		
	}
	
	for (i = 0; i < login_id.length; i++)
	{
		if (login_id.charAt(i) >= "0" && login_id.charAt(i) <= "9")
		{
			continue;
		}
		else if (login_id.charAt(i) >= "a" && login_id.charAt(i) <= "z")
		{
			continue;
		}
		else if (login_id.charAt(i) >= "A" && login_id.charAt(i) <= "Z")
		{
			continue;
		}
		else if (login_id.charAt(i) == "_")
		{
			continue;
		}
		else if (login_id.charAt(i) == " ")
		{
			alert("회원 아이디(ID)는 띄어쓰기 없이 영문자와 숫자 조합과 '_'만 가능합니다. ");
			target.focus();
			return true;
		}
		else
		{
			alert("회원 아이디(ID)는 띄어쓰기 없이 5~15자리의 영문자와 숫자 조합과 '_'만 가능합니다.");
			target.focus();
			return true;
		}
	}
	 
	return false;
	
}


function ltrim(str)
{
	var strreturn = "";
	for(i=0; i <= str.length-1 ; i++)
	{
		if (str.charAt(i) != ' ')
		{
			strreturn = str.substring(i,str.length);
			return strreturn;
		}
	}
	return strreturn;
}

function rtrim(str)
{
	var strreturn = "";
	for(i=str.length-1; i >=0  ; i--)
	{
		if (str.charAt(i) != ' ')
		{
			strreturn = str.substring(0,i+1);
			return strreturn;
		}
	}
	return strreturn;
}

function trim(str)
{
	return rtrim(ltrim(str));
}


function checknot(target,cmt,astr)
 {
	var i; 
	var t = target.value;
	
	if (astr.length == 0)	astr = special;
	
	for (i=0; i<t.length; i++)
	{
		if(astr.indexOf(t.substring(i,i+1)) >= 0)
		{
			alert(cmt + "에 [~()_-*@!'+/]외의 특수문자는 사용불가 합니다. ");					
			target.focus()
			return true;
		}
	}
	return false
}


function pop_closed()
{
		if (window.ActiveXObject) {
			try {
				document.close();
			} catch (e) {
				try {					
					window.opener = self;
					self.close();
				} catch (e) {
					return null;
				}
			}
		} else if (window.XMLHttpRequest) {
			try {

				window.open('about:blank','_self').close();
			} catch (e) {
				return null;
			}
		}

	if (/MSIE/.test(navigator.userAgent)) 
	{

		if(navigator.appVersion.indexOf("MSIE 7.0")>=0) 
		{	
			window.opener='Self';
			window.open('','_parent','');
			window.close();
		}

		else 
		{
			window.opener = self;
			self.close();
		}
	}
}


function ItemPop( mode, tbl, fknum )
{	
	param = "mode="+mode+"&tbl="+tbl+"&num="+fknum;	
	window.open('/contents/pop_itemAdd.php?'+param,'ITEM_ADD','scrollbars=0, width=750, height=700');
}


function pop_reload_close()
{
	if (window.ActiveXObject) { 
		try { 
			window.opener.location.reload(); 
		} catch (e) { 
			try {	 
				opener = self; 
				opener.location.reload(); 
			} catch (e) { 
			} 
		} 
	} else if (window.XMLHttpRequest) { 
		try { 
			opener.location.reload(); 
		} catch (e) { 
		} 
	} 
    
	if (/MSIE/.test(navigator.userAgent)) { 
    	if(navigator.appVersion.indexOf('MSIE 7.0')>=0) { 
			if (opener && !opener.closed){ opener.location.reload(); } 
			}else{ 
				if (opener && !opener.closed){ opener.location.reload(); } 

			}
	}
	
	pop_closed();
}


function pop_move_close( url )
{
	if (window.ActiveXObject) { 
		try { 
			window.opener.location.href = url; 
		} catch (e) { 
			try {	 
				opener = self; 
				opener.location.href = url; 
			} catch (e) { 
			} 
		} 
	} else if (window.XMLHttpRequest) { 
		try { 
			opener.location.href = url; 
		} catch (e) { 
		} 
	} 
    
	if (/MSIE/.test(navigator.userAgent)) { 
    	if(navigator.appVersion.indexOf('MSIE 7.0')>=0) { 
			if (opener && !opener.closed){ opener.location.href = url;  } 
			}else{ 
				opener = self; 
				if (opener && !opener.closed){ opener.location.href = url;  } 
			}
	} 
	pop_closed();
}


function iframe_reload_close()
{
	if (window.ActiveXObject) { 
		try { 
			parent.location.reload(); 
			document.close(); 
		} catch (e) { 
			try {	 
				parent = self; 
				parent.location.reload(); 
				self.close(); 
			} catch (e) { 
			} 
		} 
	} else if (window.XMLHttpRequest) { 
		try { 
			parent.location.reload(); 
			window.open('about:blank','_self').close(); 
		} catch (e) { 
		} 
	} 
    
	if (/MSIE/.test(navigator.userAgent)) { 
    	if(navigator.appVersion.indexOf('MSIE 7.0')>=0) { 
			if (parent && !parent.closed){ parent.location.reload(); } 
	   			window.open('about:blank','_self').close(); 
			}else{ 
				parent = self; 
				if (parent && !parent.closed){ parent.location.reload(); } 
					self.close(); 
			}
	} 
}

if(typeof HTMLElement != "undefined" && typeof HTMLElement.prototype.__defineGetter__ != "undefined") {
	HTMLElement.prototype.__defineGetter__("innerText",
		function() {
			if(this.textContent) { return(this.textContent)	} 
			else 
			{	
				var r = this.ownerDocument.createRange();
				r.selectNodeContents(this);
				return r.toString();
			}
		});

	HTMLElement.prototype.__defineSetter__("innerText",
		function(sText) { this.innerHTML = sText });
}

var shopTarget;
var shopAdd;
var shopNum;

function shopView( target, shop, add )
{	

	if (add =="null" || add == null  ||  add =="" )
	{
		add = '';

	}else{
		add = "&"+add ; 
	}
	shopNum    = shop;
	shopTarget = target;
	shopAdd    = add;
	
	new ajax.xhr.Request("/product/shopview_transaction/move_page.php", "shop="+shop, MoveShopView, 'POST');
}

function MoveShopView( xmlDoc )
{
	var viewUrl = getNodeValue( xmlDoc.getElementsByTagName( 'url' ) );
	
	if (viewUrl=="")
	{
		document.write("존재 하지 않는 상품입니다.");
	}

	var url = viewUrl + "?shop=" + shopNum + shopAdd ;
	
	if ( shopTarget =="openwindow" )
	{
		window.open( url ) ;
	}
	else
	{
		document.location.href = url;
	}		
}

function pop_emoney( member_id )
{
	window.open('/adminnew/member/pop_emoney_list.php?muid='+member_id,'','toolbar=no, width=800, height=600, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function pop_order( code )
{	
	window.open('/adminnew/order/pop_order.php?ordercode='+code,'','toolbar=no, width=700, height=740, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function pop_display_mody(fileName)
{
	window.open('/adminnew/design/pop_display_mody.php?fileName='+fileName,'','toolbar=no, width=650, height=370, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function display_restoration(fileName)
{
	var obj = $('restorationIframe');
	if(obj == null){
		var iframe = document.createElement("IFRAME");	
		iframe.setAttribute("id", "restorationIframe");
		iframe.setAttribute("name", "restorationIframe");
		iframe.style.width = "0";
		iframe.style.height = "0";
		document.body.appendChild(iframe);
		obj = $('restorationIframe');
	}
	
	obj.src = '/adminnew/design/pop_display_mody.php?fileName='+fileName+'&mode=restoration';
}

function go_home( )
{
	var url =  "/main/main.php" ;
	document.location.href = url;
	
}

function pop_member(muid)
{
	window.open('/adminnew/member/pop_member.php?muid='+muid,'','toolbar=no, width=700, height=600, top=10, left=10, scrollbars=yes, resizable=yes');	
}

var initBody 
function beforePrint( name ){ 
	initBody = document.body.innerHTML; 
	document.body.innerHTML = name.innerHTML; 	
} 
function afterPrint(){ 
	document.body.innerHTML = initBody; 
} 
function printArea( name ) { 	
	beforePrint( name );
	window.print(); 
	afterPrint();					
} 

function pop_resize()
{		
	var Dwidth = parseInt(document.body.scrollWidth);
	var Dheight = parseInt(document.body.scrollHeight);
	var divEl = document.createElement("div");
	divEl.style.position = "absolute";
	divEl.style.left = "0px";
	divEl.style.top = "0px";
	divEl.style.width = "100%";
	divEl.style.height = "100%";

	document.body.appendChild(divEl);

	if (window.DOMParser) {Dheight = Dheight + 75;}

	window.resizeBy(Dwidth-divEl.offsetWidth, Dheight-divEl.offsetHeight);
	document.body.removeChild(divEl);
}


function number_format(val){ 
	val=parseInt(val)
	ret_val = val.toLocaleString();
	pos = ret_val.indexOf(".");
	if(pos==-1) pos = ret_val.length;
	ret_val = ret_val.substr(0,pos);
	return(ret_val);
}

function renumber_format(val){ 
	 var returnValue = val.replace(",","");	 

	 return returnValue;
}

String.prototype.replaceAll = function( searchStr, replaceStr )  
{  
	this.temp = this;  
	while( this.temp.indexOf( searchStr ) != -1 )  
	{  
	 	this.temp = this.temp.replace( searchStr, replaceStr );  
	}  
	return this.temp;  
}  

function InsertFile(fname, msection, fileFilter)
{    
 	 var URLs='/common/inc/pop_orgAdd.php?fname=' + fname + '&msection=' + msection + '&imgfname=' + fileFilter;
	 var arr = showModalDialog( URLs ,"","font-family:Verdana; font-size:12; dialogWidth:678px; dialogHeight:487px" );
	 if( typeof(arr) == "object" &&  arr.imageUrl != null && arr.imageUrl !='undefined'  ) 
	 {
		try{ document.getElementById( arr.idx + "view" ).src = arr.imageUrl ;}catch(e){}
		try{ document.getElementById( arr.idx + "viewMain" ).src = arr.imageUrl ; }catch(e){}
		try{ document.getElementById( arr.idx + "view" ).style.background = "url('"+ arr.imageUrl +"')";}catch(e){}
			
		if( arr.idx == "edit")	
		{	
			document.getElementById( '_nowimgdiv_').innerHTML = "<img src='"+ arr.imageUrl +"' border=0 >";
		}
		else
		{
			document.getElementById( arr.idx + '' ).value = arr.imageUrl ;  
		}
	}

}

function UserMenuset(BANK,NAME,DATE)
{
	var UserMenu = document.getElementById('UserMenu');

	var text=""	
	text+="		<table border='1' cellpadding='1' cellspacing='1' bgcolor='#cccccc'>"
	text+="		  <tr bgcolor='#ffffff'>"
	text+="			  <td width='100px' align='center'>구매인 </td><td width='120px'>"+NAME+"</td>"
	text+="		  </tr>"
	text+="		  <tr bgcolor='#ffffff'>"
	text+="			  <td align='center'>입금예정일 </td><td>"+DATE+"</td>"
	text+="		  </tr>"
	text+="		  <tr bgcolor='#ffffff'>"
	text+="			  <td align='center' colspan='2'>"+BANK+"</td>"
	text+="		  </tr>"	
	text+="		</table>"
	UserMenu.innerHTML=text;
}
function UserMenuhide()
{
	var UserMenu = document.getElementById('UserMenu');

	UserMenu.innerHTML=''
}
function OnShowUserMenu(BANK,NAME,DATE,e)
{		
	UserMenuCheck();
	
	var UserMenu = document.getElementById('UserMenu');
		
	if(e.x)
	{ 
		UserMenu.style.left = e.clientX + 10 + document.documentElement.scrollLeft+ 'px';
		UserMenu.style.top  = e.clientY - 12 + document.documentElement.scrollTop + 'px';	
	}
	else
	{ 
		UserMenu.style.left = e.pageX + 10 + document.body.scrollLeft + 'px';
		UserMenu.style.top  = e.pageY - 12 + document.body.scrollTop + 'px';
	}

	if(UserMenu.innerHTML == '')
	{
		UserMenuset(BANK,NAME,DATE)
	}
	else UserMenuhide()
}

function UserMenuCheck()
{
	var objDiv = document.getElementById('UserMenu');
	if(objDiv == null)
	{
		var obj = document.createElement("div");
		obj.setAttribute("id", "UserMenu");
		obj.style.width="200px";
		obj.style.position="absolute";
		obj.style.borderStyle="none";	
		document.body.appendChild(obj);
	}
}

function OnShowUserMenu2(NOTE,e)
{		
	UserMenuCheck();
	
	var UserMenu = document.getElementById('UserMenu');
		
	if(e.x)
	{ 
		UserMenu.style.left = e.clientX + 10 + document.documentElement.scrollLeft+ 'px';
		UserMenu.style.top  = e.clientY - 12 + document.documentElement.scrollTop + 'px';	
	}
	else
	{
		UserMenu.style.left = e.pageX + 10 + document.body.scrollLeft + 'px';
		UserMenu.style.top  = e.pageY - 12 + document.body.scrollTop + 'px';
	}

	if(UserMenu.innerHTML == '')
	{
		UserMenuset2(NOTE)
	}
	else UserMenuhide()
}

function UserMenuset2(NOTE)
{
	var UserMenu = document.getElementById('UserMenu');

	var text=""	
	text+="		<table border='1' cellpadding='1' cellspacing='1' bgcolor='#cccccc'>"
	text+="		  <tr bgcolor='#ffffff'>"
	text+="			  <td width='100px' align='center'>정산내역 </td><td width='120px'>"+NOTE+"</td>"
	text+="		  </tr>"
	text+="		</table>"
	UserMenu.innerHTML=text;
}

function ShopMody(num)
{
	window.open('/smanage/reg_mody.php?num='+num,'','toolbar=no, width=900, height=700, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function ShopReReg(num)
{
	window.open('/smanage/reg_mody.php?num='+num,'','toolbar=no, width=900, height=700, top=10, left=10, scrollbars=yes, resizable=yes');	
}


function select_box() 
{
	var gsize = parseInt($('gsize').value) ;	

	for(i=0; i<gsize; i++) 
	{
		var goods = eval($('chkitem'+i));
	
		if(goods.checked)
		{
			return true;
		}
	}
	return false;
}

function check_all() 
{
	var gsize = parseInt($('gsize').value) ;	

	var b = false;
	if( $('chkall').checked ) 
	{
		b = true;		
	}

	for(i=0; i<gsize; i++) 
	{			
		var obj = eval($('chkitem'+i));
		if(b)	
		{
			if ( !obj.disabled )
			{
				obj.checked = true;
			}
		}
		else
		{
			obj.checked = false;
		}
	}
}	

function Favorite(title) {  
	url = location.href;
   if (window.sidebar) 
   window.sidebar.addPanel(title, url, "");
   else if(window.opera && window.print)

   { 
      var elem = document.createElement('a');
      elem.setAttribute('href',url);
      elem.setAttribute('title',title);
      elem.setAttribute('rel','sidebar');
      elem.click();
   }

   else if(document.all)
   window.external.AddFavorite(url, title);
}

function UrlCopy() {
	if (window.clipboardData)
	{
		window.clipboardData.setData("Text",location.href);
		alert("게시물 내용이 클립보드에 복사되었습니다.");
	}
	else
	{
		prompt("Ctrl+C를 눌러 게시물 내용을 클립보드로 복사하세요", location.href);
	}
}

var shopInfoLayerNumBefor;
function ShopInfoLayerShow(num, e)
{
	var currentElement;
	

	if (e.target)
	{		

		currentElement=e.target;		
	}
	else if (e.srcElement)
	{

		currentElement=e.srcElement;		
	}
	
	var oElement = currentElement; 
	var curleft = 0;  
	var curtop = 0;  

	if (oElement.offsetParent)   
	{
		while (oElement.offsetParent)  
		{   
			curleft += ( oElement.offsetLeft - oElement.scrollLeft );  
			curtop += ( oElement.offsetTop - oElement.scrollTop );   
			oElement = oElement.offsetParent;   
		}   
	}
			
		
	var objDiv = document.getElementById('shipInfo');
	if(objDiv == null)
	{
		var obj = document.createElement("div");
		obj.setAttribute("id", "shipInfo");
		obj.style.width="200px";
		obj.style.height="30px";
		obj.style.position="absolute";
		obj.style.display = "none";
		obj.className = "rollover";
		obj.onmouseover = function() { ShopInfoLayerView(); }
		obj.onmouseout = function() { ShopInfoLayerHidden(); }

		document.body.appendChild(obj);		
	}
	
	var shipInfo = document.getElementById('shipInfo');

	
	if(shopInfoLayerNumBefor == null || shopInfoLayerNumBefor != num){
		shipInfo.style.display = "none";
		var text = "<div class='p_quick' id='p_quickForm' style='display:none'>"+
			"<a href='javascript:PopPreview("+num+")' class='rollover'><img src='/images/common/btn/quick_img_01.gif' width='15' height='15' title='미리보기' name='Image1' /><img class='over' width='15' height='15' title='미리보기' src='/images/common/btn/quick_img_01_ov.gif'/>"+
			"<div class='text'>"+
			"	<img class='over' src='/images/common/btn/quick_text_01.gif' title='미리보기' />"+
			"</div></a>"+
			"<a href='javascript:wish_in("+num+")'  class='rollover'><img src='/images/common/btn/quick_img_02.gif' width='15' height='15' title='찜하기' name='Image1' /><img class='over' width='15' height='15' title='찜하기' src='/images/common/btn/quick_img_02_ov.gif'/>"+
			"<div class='text'>"+
			"	<img class='over' src='/images/common/btn/quick_text_02.gif' title='찜하기' />"+
			"</div></a></div>";
	
		shopInfoLayerNumBefor=num;
		shipInfo.innerHTML = text;
		sleep(10);
		document.getElementById('p_quickForm').style.display="";	
		shipInfo.style.display = "";
	}
	shipInfo.style.left = (curleft+(currentElement.width/2)-15)+ 'px';
	shipInfo.style.top  = (curtop + currentElement.height - 30) + 'px';
}

function ShopInfoLayerView()
{
	Obj = document.getElementById('shipInfo');
	if(Obj == null) return;
	Obj.style.display = "";
}
function ShopInfoLayerHidden()
{
	Obj = document.getElementById('shipInfo');

	Obj.style.display = "none";	
}

function pop_vs()
{	
	if(!SelectBoxCheck()) 
	{
		alert(" 대상을 선택해 주세요.");
		return;
	}	

	if ( checkNum < 2 || checkNum > 3 )
	{
		alert( " 상품을 1개 이상 3개 이하로 선택해 주세요. " );
		return;
	}
	
	var checkNum = 0;
	var paramShop = "";

	for (var i=1;i<=gsize;i++ )
	{
		if ( eval($("chkitem"+i)).checked )
		{	
			paramShop += eval($("chkitem"+i)).value + ",";
			checkNum++;
		}
	}
	
	if ( paramShop.substr(paramShop.length-1,1) == "," )
	{
		parameShop = paramShop.substr(0,paramShop.length-1)
	}

	window.open('/popup/pop_vs.php?shop='+parameShop,'','toolbar=no,width=650, height=480, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function wish_in( shop ) 
{	
	if ( C_id=="" )
	{	
		alert( "로그인후 이용해 주세요." );
		PopLogin();
		return;
	}

	new ajax.xhr.Request("/popup/popup_transaction/pop_wish_in.php", "shop="+shop, WishOk, 'POST');	
}

function pop_wish_in() 
{
	if(!SelectBoxCheck()) 
	{
		alert(" 대상을 선택해 주세요.");
		return;
	}	

	if ( C_id=="" || C_id==null )
	{	
		alert( "로그인후 이용해 주세요." );
		PopLogin();
		return;
	}
	
	var checkNum = 0;
	var paramShop = "";

	for (var i=1;i<=gsize;i++ )
	{
		if ( eval($("chkitem"+i)).checked )
		{	
			paramShop += eval($("chkitem"+i)).value + ",";
			checkNum++;
		}
	}
	
	if ( paramShop.substr(paramShop.length-1,1) == "," )
	{
		parameShop = paramShop.substr(0,paramShop.length-1)
	}
	
	new ajax.xhr.Request("/popup/popup_transaction/pop_wish_in.php", "shop="+parameShop, WishOk, 'POST');	
}

function WishOk( xmlDoc )
{
	var aucShop	     = getNodeValue( xmlDoc.getElementsByTagName( 'aucShop' ) );
	var aucShopCount = eval( getNodeValue( xmlDoc.getElementsByTagName( 'aucShopCount' ) ) );
	
	if ( aucShopCount > 0 )
	{
		alert( "경매,공구 상품은 찜하기로 등록되지 않습니다." );
	
		if ( aucShopCount == 1 )
		{
		 	for (var i=1;i<=gsize;i++ )
			{
				if ( eval($("chkitem"+i)).value == aucShop )
				{	
					eval($("chkitem"+i)).checked = false;
				}
			}
		}
		else
		{
			var aucNumCheck = aucShop.split(',');
						
			for (var k=0;k<aucShopCount;k++ )
			{	
				for (var i=1;i<=gsize;i++ )
				{	
					if ( eval($("chkitem"+i)).value == aucNumCheck[k] )
					{	
						eval($("chkitem"+i)).checked = false;
					}
				}
			}
		}
	}

	window.open('/popup/pop_wish_in.php','','toolbar=no,width=420, height=250, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function cart_in( shop )
{	
	if ( C_id=="" || C_id==null )
	{	
		alert( "로그인후 이용해 주세요." );
		PopLogin();
		return;
	}

	new ajax.xhr.Request("/popup/popup_transaction/pop_cart_in.php", "shop="+shop, CartOk, 'POST');	
}

function pop_cart_in()
{	
	if(!SelectBoxCheck()) 
	{
		alert(" 대상을 선택해 주세요.");
		return;
	}	

	if ( C_id=="" || C_id==null )
	{	
		alert( "로그인후 이용해 주세요." );
		PopLogin();
		return;
	}
	
	var checkNum = 0;
	var paramShop = "";

	for (var i=1;i<=gsize;i++ )
	{
		if ( eval($("chkitem"+i)).checked )
		{	
			paramShop += eval($("chkitem"+i)).value + ",";
			checkNum++;
		}
	}
	
	if ( paramShop.substr(paramShop.length-1,1) == "," )
	{
		parameShop = paramShop.substr(0,paramShop.length-1)
	}

	new ajax.xhr.Request("/popup/popup_transaction/pop_cart_in.php", "shop="+parameShop, CartOk, 'POST');	
}

function CartOk( xmlDoc )
{
	var aucShop	     = getNodeValue( xmlDoc.getElementsByTagName( 'aucShop' ) );
	var aucShopCount = eval( getNodeValue( xmlDoc.getElementsByTagName( 'aucShopCount' ) ) );
	
	if ( aucShopCount > 0 )
	{
		alert( "경매,공구 상품은 장바구니에 등록되지 않습니다." );
	
		if ( aucShopCount == 1 )
		{
			for (var i=1;i<=gsize;i++ )
			{
				if ( eval($("chkitem"+i)).value == aucShop )
				{	
					eval($("chkitem"+i)).checked = false;
				}
			}
		}
		else
		{
			var aucNumCheck = aucShop.split(',');
						
			for (var k=0;k<aucShopCount;k++ )
			{	
				for (var i=1;i<=gsize;i++ )
				{	
					if ( eval($("chkitem"+i)).value == aucNumCheck[k] )
					{	
						eval($("chkitem"+i)).checked = false;
					}
				}
			}
		}
	}

	window.open('/popup/pop_cart_in.php','','toolbar=no,width=420, height=250, top=10, left=10, scrollbars=yes, resizable=yes');		
}

function choiceDel2( tbl,num ) 
{	
	if ( confirm("정말로 삭제하시겠습니까?") )
	{
		new ajax.xhr.Request("/common/inc/choice_del.php", "mode=del&table="+tbl+"&num="+num, CallchoiceDel, 'POST');	
	}
}

function choiceDel( tbl )
{	
	if(!SelectBoxCheck()) 
	{
		alert(" 대상을 선택해 주세요.");
		return;
	}	

	var checkNum = 0;
	var paramShop = "";

	for (var i=1;i<=gsize;i++ )
	{
		if ( eval($("chkitem"+i)).checked )
		{	
			paramShop += eval($("chkitem"+i)).value + ",";
			checkNum++;
		}
	}
	
	if ( paramShop.substr(paramShop.length-1,1) == "," )
	{
		parameShop = paramShop.substr(0,paramShop.length-1)
	}
	
	if ( confirm("정말로 삭제하시겠습니까?") )
	{
		new ajax.xhr.Request("/common/inc/choice_del.php", "mode=del&table="+tbl+"&num="+parameShop, CallchoiceDel, 'POST');	
	}
}

function CallchoiceDel( xmlDoc )
{
	location.reload();
}

function PopLogin() 
{
	window.open('/popup/pop_login.php','','toolbar=no, width=460, height=350, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function PopBuyLogin() 
{
	window.open('/popup/pop_nonorder.php','','toolbar=no, width=460, height=350, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function PopPreview(shop) 
{	
	window.name = "parentMain";
	window.open('/popup/pop_preview.php?shop='+shop,'','toolbar=no, width=750, height=500, top=10, left=10, scrollbars=yes, resizable=yes');	
}

function goMiniShop(puid)
{
	document.location.href = "/minishop/myshop_main.php?muid="+puid;
}

function goCallCenter()
{
	pop_closed()
	window.open('/callcenter/callcenter_main.php','','');
}

function View_flash(Url,Width,Height)
{                 
	document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + Width + "\" height=\"" + Height + "\">"); 
	document.writeln("<param name=\"movie\" value=\"" + Url + "\">"); 
	document.writeln("<param name=\"quality\" value=\"high\" />");     
	document.writeln("<param name=\"wmode\" value=\"transparent\">"); 
	document.writeln("<embed src=\"" + Url + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + Width + "\"  height=\"" + Height + "\" wmode =\"transparent\">"); 
	document.writeln("</object>");     
}

function View_flashv2(Url,Width,Height,allowDoamin, objid ,objname )
{ 
	if(allowDoamin =='') allowDoamin='sameDomain';
	
	document.writeln("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"" + Width + "\"  height=\"" + Height + "\" id=\"" + objid + "\" align=\"middle\">");
	document.writeln("<param name=\"allowScriptAccess\" value=\"" + allowDoamin + "\" />");
	document.writeln("<param name=\"movie\" value=\"" + Url + "\" />");
	document.writeln("<param name=\"quality\" value=\"high\" />");
	document.writeln("<param name=\"wmode\" value=\"transparent\" />");
	document.writeln("<embed src=\"" + Url + "\" quality=\"high\" width=\"" + Width + "\"  height=\"" + Height + "\" name=\"" + objname + "\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"  wmode =\"transparent\"/>");
	document.writeln("</object>");
}

function View_flv(Url,Width,Height)
{                 

	document.writeln("<EMBED src=http://www.eosbill.com/movie/flvplayer.swf?autoStart=false&image=http://www.eosbill.com/movie/flvload.jpg&file="+ Url + " width=\"" + Width + "\"  height=\"" + Height + "\" type=application/x-shockwave-flash  wmode =\"transparent\"></embed>");   
    
}


function obj_movie(src, ids, width, height, autostart)
{
	var wh = "";
	if (parseInt(width) && parseInt(height)) 
		wh = " width='"+width+"' height='"+height+"' ";
	if (!autostart) autostart = false;
	return "<embed src='"+src+"' "+wh+" style='FILTER:xray();'  loop='-1' hidden=''0  autostart='"+autostart+"'  wmode =\"transparent\"></embed>";
}	

function check_excel(formname)
{		
   	var objDiv = document.getElementById('excelDownForm');
	if(objDiv == null)
	{
		var obj = document.createElement("iframe");
		obj.setAttribute("id", "excelDownForm");
		obj.style.height="0";
		obj.style.width="0";

		document.body.appendChild(obj);		
	}
	objDiv = document.getElementById('excelDownForm');
 
	$(formname).action="/adminnew/excel_down.php";
	$(formname).target="excelDownForm";	
	$(formname).method='post';
	$(formname).submit();
}	

function check_order_excel(formname)
{		
   	var objDiv = document.getElementById('excelDownForm');
	if(objDiv == null)
	{
		var obj = document.createElement("iframe");
		obj.setAttribute("id", "excelDownForm");
		obj.style.height="0";
		obj.style.width="0";

		document.body.appendChild(obj);		
	}
	objDiv = document.getElementById('excelDownForm');
 
	$(formname).action="/adminnew/order_excel_down.php";
	$(formname).target="excelDownForm";	
	$(formname).method='post';
	$(formname).submit();
}	

function check_cart_excel(formname)
{		
   	var objDiv = document.getElementById('excelDownForm');
	if(objDiv == null)
	{
		var obj = document.createElement("iframe");
		obj.setAttribute("id", "excelDownForm");
		obj.style.height="0";
		obj.style.width="0";

		document.body.appendChild(obj);		
	}
	objDiv = document.getElementById('excelDownForm');
 
	$(formname).action="/adminnew/cart_excel_down.php";
	$(formname).target="excelDownForm";	
	$(formname).method='post';
	$(formname).submit();
}	

function cart_ship_excel(formname)
{		
   	var objDiv = document.getElementById('excelDownForm');
	if(objDiv == null)
	{
		var obj = document.createElement("iframe");
		obj.setAttribute("id", "excelDownForm");
		obj.style.height="0";
		obj.style.width="0";

		document.body.appendChild(obj);		
	}
	objDiv = document.getElementById('excelDownForm');
 
	$(formname).action="/adminnew/cart_ship_down.php";
	$(formname).target="excelDownForm";	
	$(formname).method='post';
	$(formname).submit();
}	
