function bt(id, after)
{
	var ie=document.all;
	obj	= document.getElementById(id);

	if(ie)
	{
		obj.filters.blendTrans.stop();
		obj.filters.blendTrans.Apply();
		obj.src	= after;
		obj.filters.blendTrans.Play();
	}
	else
	{
		obj.src	= after;
	}
}

function eregi_replace(ereg, dest, str)
{
	ereg = eval("/"+ereg+"/gim");
	return str.replace(ereg, dest);
}

function ereg_replace(ereg, dest, str)
{
	ereg = eval("/"+ereg+"/gm");
	return str.replace(ereg, dest);
}

function eregi(exp,str)
{
	exp=new RegExp(exp,"gi");
	exp=str.match(exp);
	return exp;
}

function ereg(exp,str)
{
	exp=new RegExp(exp);
	exp=str.match(exp);
	return exp;
}

function trim(str)
{
	var ereg=new RegExp("^( )+");
	str=str.replace(ereg,"");
	ereg=new RegExp("( )+$");
	str=str.replace(ereg,"");
	return str;
}

function autoTrim(obj)
{
	obj.value = trim(obj.value);
}

function getInt(str, noZero)
{
	str	= str.toString();
	str = eregi_replace("[^0-9]", "", str);

	if(noZero)
	{
		str = parseInt(str, 10);
	}

	if(isNaN(str))
	{
		str = 0;
	}

	if(str == 0 && noZero)
	{
		str = '';
	}

	return str;
}

function setInt(obj, noZero)
{
	obj.value	= getInt(obj.value, noZero);
}

function on(id)
{
	try
	{
		document.getElementById(id).style.display	= 'inline';
	}
	catch(e)
	{

	}
}

function off(id)
{
	try
	{
		document.getElementById(id).style.display	= 'none';
	}
	catch(e)
	{

	}
}

function setPng24(obj)
{
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}

function findZipcode(obj, zip, addr)
{
	window.open('/main/member/mem_findZipcode.php?obj=' + obj + '&zip=' + zip + '&addr=' + addr, 'ccoddi_zipcode', 'width=600, height=250, left=30, top=30, scrollbars=yes');
}

function createObject(str)
{
	document.write(str);
}

function notYet()
{
	alert("¼­ºñ½º ÁØºñÁßÀÔ´Ï´Ù");
}

function gotoAdminMail()
{
	document.location.href	= "mailto:lab1@g-n-g.com";
}

function openPopupLayer(url, width, height)
{
	document.ccoddiPopupFrame.location.href	= url;
	document.getElementById('ccoddiPopupLayer').style.width		= width;
	document.getElementById('ccoddiPopupLayer').style.height	= height;
	document.getElementById('ccoddiPopupLayer').style.top		= document.body.clientHeight/2 - height/2 + document.body.scrollTop;
	document.getElementById('ccoddiPopupLayer').style.left		= document.body.clientWidth/2 - width/2;
	document.all["ccoddiPopupFrame"].style.width	= width;
	document.all["ccoddiPopupFrame"].style.height	= height;

	document.getElementById('ccoddiPopupLayer').style.display	= 'inline';
	document.body.scroll = 'no';

}

function closePopupLayer()
{
	document.getElementById('ccoddiPopupLayer').style.display	= 'none';
	document.ccoddiPopupFrame.location.href	= 'about:blank';
	document.body.scroll = 'yes';
}

function openHelp()
{
	window.open('/main/help/', 'ccoddi_help', 'width=790, height=490, top=50, left=50, scrollbars=yes');
}

/*-----------------------------------------------------------------
image hook
-----------------------------------------------------------------*/
var preloadQueue	= new Array();

function imageHook(id)
{
	preloadQueue	= new Array();

	var obj		= document.getElementById(id).all.tags("img");
	var j		= 0;
	var buff	= '';

	for(var i=0; i<obj.length; i++)
	{
		if(obj[i].readyState == 'uninitialized')
		{
			buff	+= "<iframe name='preload" + j + "' style='display:none' onload='imageHookLoad(" + j + ")'></iframe>";
			preloadQueue[j]	= obj[i];
			j++;
			continue;
		}
	}

	document.getElementById('preloadArea').innerHTML	= buff;

	for(var i=0; i<preloadQueue.length; i++)
	{
		window.open(preloadQueue[i].src, 'preload' + i);
	}
}

function imageHookLoad(i)
{
	preloadQueue[i].src	= preloadQueue[i].src;
}