function TypeCheck (s, spc) 
{
	var i;

	for(i=0; i< s.length; i++) 
	{
		if (spc.indexOf(s.substring(i, i+1)) < 0) 
		{
			return false;
		}
	}        
	return true;
}
function newLoginOpen()
{
	window.open("./template/login/login.php", "loginWin", "top=0,left=0,width=403,height=195,scrollbars=no");
}
function checkID(type)
{
	var obj = document.member_info;
	
	str = obj.MB_ID.value;
	
	ids.innerHTML = "";
	ids.innerHTML += "<iframe src='template/regis/id_check.php?id="+str+"&type="+type+"' frameborder='0' width=287 height=27></iframe>";
}
function OpenZipcode(pwd,fname,z1,z2,ad,ad1) 
{
	var gpwd = (pwd) ? pwd : '.';
	var url = gpwd+'/pack/zipsearch/zipcode.php?form='+fname+'&zip1='+z1+'&zip2='+z2+'&address='+ad+'&address1='+ad1;
	window.open(url,'zip_win','width=458,height=550,statusbar=no,scrollbars=yes,toolbar=no');
}
function LoginCheck()
{
	var f = document.LoginForm;
	
	if (!f.id.value) {
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä...");
		f.id.style.background = "gold";
		f.id.focus();
		return false;
	}
	if (!f.pass.value) {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä...");
		f.pass.style.background = "gold";
		f.pass.focus();
		return false;
	}
	return true;
}
function getPageGo(f,new_p)
{
	f.p.value = new_p;
	f.submit();
}
// ·Î±×ÀÎ Ã¼Å©...
function NotLogin() {
	alert("·Î±×ÀÎÀ» ÇÏ½Å ÈÄ ÀÌ¿ëÇÏ½Ã±â ¹Ù¶ø´Ï´Ù..");
	return false;
}
function NotCouponDate() {
	alert("ÄíÆù »ç¿ë±â°£ÀÌ ¾Æ´Õ´Ï´Ù..");
	return false;
}
function goods_buy(uid,type,banner_type,won)
{
	var f = (!f) ? document.view_form : f;

	if ( type == 'buy')
	{
		if (!confirm('Á¤¸»·Î ¹Ù·Î ±¸¸ÅÇÏ½Ã°Ú½À´Ï±î?             '))
		{
			return false;
		}
		f.action.value = type;
		f.goods_uid.value = uid;
		f.banner_type.value = banner_type;
		f.g_won.value = won;
		f.submit();
	}
	if ( type == 'cart')
	{
		if (!confirm('Á¤¸»·Î Àå¹Ù±¸´Ï¿¡ ´ãÀ¸½Ã°Ú½À´Ï±î?             '))
		{
			return false;
		}
		f.action.value = type;
		f.goods_uid.value = uid;
		f.banner_type.value = banner_type;
		f.g_won.value = won;
		f.submit();
	}
}

// ¸¶°¨¹æ¹ý º¸±â...
function Finish_manner() {
	window.open("./template/finish_manner.php", "FinishWin", "width=582, height=600");
}

// °èÁÂ¹øÈ£ º¸±â...
function openAccount()
{
	window.open("./template/account.php", "accountWin", "width=392, height=202");
}

function AutoResize(img){ 
  foto1= new Image(); 
  foto1.src=(img); 
  Controlla(img); 
} 
function Controlla(img){ 
  if((foto1.width!=0)&&(foto1.height!=0)){ 
    viewFoto(img); 

  } 
  else{ 
    funzione="Controlla('"+img+"')"; 
    intervallo=setTimeout(funzione,20); 
  } 
} 


function viewFoto(img){ 
  largh=foto1.width+0; 
  altez=foto1.height+0; 
  stringa="width="+largh+",height="+altez; 

var open_img = img;
  finestra=window.open('about:blank','',stringa); 
  finestra.document.writeln("<body leftmargin=0 topmargin=0><img src="+open_img+" onClick=self.close()></body>"); 
  finestra.document.close(); 
}
function getCookie( name ){
        var nameOfCookie = name + "=";
        var x = 0;
        while ( x <= document.cookie.length )
        {
                var y = (x+nameOfCookie.length);
                if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                                endOfCookie = document.cookie.length;
                        return unescape( document.cookie.substring( y, endOfCookie ) );
                }
                x = document.cookie.indexOf( " ", x ) + 1;
                if ( x == 0 )
                        break;
        }
        return "";
}
function popup(str)
{
	popup = window.open("about:blank", "", "width=640,height=500");
	popup.document.writeln ("<body leftmargin='0' topmargin='0'><embed src='./upload/"+str+"' play='true' loop='true' quality='high'></embed></body>");
	popup.document.close();
}
function popup2(str)
{
	popup = window.open("about:blank", "", "width=640,height=410");
	popup.document.writeln ("<body leftmargin='0' topmargin='0'><embed src='./upload/"+str+"' play='true' loop='true' quality='high'></embed></body>");
	popup.document.close();
}
function JS_view(str)
{
	document.write(str);
}
