function roll(st,color) { 
	idx=eval(st);
	idx.style.backgroundColor=color;
}

///////// ÀÚµ¿¸µÅ© /////////////////////////////////////////////////////////////////////
function autolink( id )
{
	//alert(id);
	var container = document.getElementById(id);
	var doc = container.innerHTML;
	var regSRC = new RegExp("(src|href)=(\'|\")(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377();|°¡-ÆR]+)","gi");
	var regURL = new RegExp("(http|https|ftp|telnet|news|irc)://([-/.a-zA-Z0-9_~#%$?&=:200-377();|°¡-ÆR]+)","gi");
	var regEmail = new RegExp("([_a-z0-9]+[_a-z0-9+-]+@[a-z0-9+-]+\.[a-z0-9+-]+[\.a-z0-9+-]+)","gi");
	doc = doc.replace(regSRC,"$1=$2donelink://$4");
	doc = doc.replace(regURL,"<a href='$1://$2' target='_blank'>$1://$2</a>");
	doc = doc.replace(regEmail,"<a href='mailto:$1'>$1</a>");
	container.innerHTML = doc.replace( /donelink/gi, 'http' );
}

function alertID()
{
	for(i = 0; i < document.all.length; i++)
	if( document.all[i].id != "" ) alert(document.all[i].id);
}
///////////////////////// ÀÚµ¿¸µÅ© //////////////////////////////////////////////////////////

// setCookie
function setCookie( name, value, expiredays ) 
{
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/;"
}

// getCookie
function t_getCookie(name){
        var arg = name + "=";
        var alen = arg.length;
        var clen=document.cookie.length;
        var i=0;
        
        while(i< clen){
                var j = i+alen;
                if(document.cookie.substring(i,j)==arg){
                        var end = document.cookie.indexOf(";",j);
                        if(end== -1)
                                end = document.cookie.length;
                        return unescape(document.cookie.substring(j,end));
                }
        i=document.cookie.indexOf(" ",i)+1;
        if (i==0) break;
        }
        return null;
}

function t_setCookie(name,value,expires){
        document.cookie=name + "=" + escape(value)+
        ((expires == null)? "" : (" ; expires=" + expires.toGMTString()));
}
function t_setcookieVariables(){
        var today = new Date();
        var expires=new Date();
        expires.setTime(today.getTime()+ 1000*60*60*24*365);
        
        setCookie("news_title","",expires)
        
}

function imgView(no,fld) {
	//alert('ÄíÄí');
	browsing_window = window.open('index_pop.php?incf=product/imgView&fld='+fld+'&no='+no, 'browse_org', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=300, height=300');
	browsing_window.focus();
	return;
}

function orderOpen(ono,no){
	var browzing=window.open('index_pop.php?incf=order/order_detail2&ono='+ono+'&no='+no, '' , 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=800,height=400');
	browzing.focus();
	return;
}

function flashWrite(url,width,height){
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='menu' value='false' />"+
    "<param name='wmode' VALUE='transparent' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='#FFFFFF' />"+
	"<embed src='"+url+"' menu='false' quality='high' width='"+width+"' height='"+height+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}
