function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;



function bookmark(){
window.external.AddFavorite('http://www.tiummall.com', '»êµ¹Æ¼¿ò')
}



function bluring(){
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;



function open_window( filename, option, name )
{
	if( !name )
	{
		name = 'new'
	}


        win = window.open( filename, name, option );

        return win
}

function window_open( page, name, top, left, width, height )
{
	option = "'toolbar=no," +
		"location=no," +
		"directories=no," +
		"status=no," +
		"menubar=no," +
		"scrollbars=yes," +
		"resizable=yes," +
		"width=" + width + "," +
		"height=" + height + "," +
		"top=" + top + "," +
		"left=" + left + "'"

        window.open( page, name, option );
}

function open_poll_pop( mode, no )
{
	page = '/front/php/poll_r.php?mode=' + mode + '&no=' + no;
	window_open( page, 'poll', 100, 300, 466, 382 );
}

/*Left menu ¹ÝÅõ¸í ·¹ÀÌ¾î ±¸Çö*/
function Layer_overload(LayerName,Status) 
{
    if (navigator.appName == "Netscape")
    {
		LayerN = document.getElementById(LayerName).style;
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
    }	
    else
    {
		LayerN = document.all[LayerName].style;
		if (Status == 'show') LayerN.visibility = 'visible';
		if (Status == 'hide') LayerN.visibility = 'hidden';
    }
}

/*Left menu±¸Çö*/
var old='';

function menu(name)
{
	submenu=eval("submenu_"+name+".style");
	if(old!=submenu)
	{
		if(old!='')
		{
			old.display='none';
		}
		submenu.display='block';
		old=submenu;
	}
	else
	{
		submenu.display='none';
		old='';
	}
}


function Layer_rollover(img_name,img_url)
{
	var menu;	
	//tmp = new String( "document."+img_name );
	menu=eval("document."+img_name);		
	menu.src = img_url;
	return;
}

function image_zoom( product_no, main_cate_no, display_group )
{
	//href = '/front/php/image_zoom.php?img='+image+'&product_no='+document.frm.product_no.value;
	href = '/front/php/image_zoom.php?product_no='+product_no+'&main_cate_no='+main_cate_no+'&display_group='+display_group;
	option = 'toolbar=no,scrollbars=no,resizable=yes,width=800,height=640,left=0,top=0';
	win_name = 'image'

	window.open( href, win_name, option );
}






var ScrollControl    = function(objId,options){ 
    this.init(objId,options); 
} 
ScrollControl.prototype    = { 
    stage : {}, 
    options : {}, 
    isover : false, 
    freeze : false, 
    course : 'top', 

    init : function(objId,options){ 
        this.setOptions(options); 
        this.setStage(objId); 
        this.setTrueData(); 

        this.move(); 
    }, 
    setOptions : function(options){ 
        options.inteval    = options.inteval    || 50; 
        options.freeze    = options.freeze    || 1500; 
        options.height    = parseInt(options.height, 7)    || 16; 

        options.cMarginTop    = options.cMarginTop    || (options.height/2) * 0.3; 
        options.cHeight        = options.height - options.cMarginTop; 

        this.options    = options; 
    }, 
    setTrueData : function(){ 
        var cObjs        = this.stage.childNodes; 
        var removes        = []; 

        for(var i=0;i<cObjs.length;i++){ 
            if(!cObjs[i].tagName){ 
                removes.push(cObjs[i]);    //¹Ù·Î »èÁ¦ ½Ã µ¥ÀÌÅÍ ²¿ÀÌ´Âµí ÇÏ¿© ÀÏ´Ü ÅµÇÔ. 
            }else{ 
                cObjs[i].style.margin        = "0"; 

                cObjs[i].style.marginTop    = this.options.cMarginTop; 
                cObjs[i].style.height        = this.options.cHeight; 
            } 
        } 

        // Ã£Àº µ¥ÀÌÅÍ¸¦ »èÁ¦ÇÔ.(FFÀÇ °æ¿ì text ³ëµå°¡ Ã·ºÎµÊ.) 
        for(var i=0;i<removes.length;i++){ 
            this.stage.removeChild(removes[i]); 
        } 

        if(cObjs.length == 1){ 
            this.stage.appendChild( cObjs[0].cloneNode(true) ); 
        } 

    }, 
    setStage : function(objId){ 
        var This    = this; 
        this.stage        = document.getElementById(objId); 

        this.stage.style.height        = this.options.height; 
        this.stage.style.overflow    = "hidden"; 
        this.stage.style.padding    = "0px"; 
        this.stage.style.margin        = "0px"; 

        this.stage.onmouseover=function(){This.isover=true;} 
        this.stage.onmouseout=function(){This.isover=false;} 
    }, 
    setCourse : function(course){ 
        if(this.course != 'down' && course == 'down'){ 
            this.changeChild(); 
            this.stage.scrollTop = this.options.height; 
        }else if(course == 'top' && this.stage.scrollTop >= this.options.height){ 
            this.stage.appendChild(this.stage.childNodes[0]); 
            this.stage.scrollTop = this.stage.scrollTop - this.options.height; 
        } 

        this.course    = course; 
    }, 
    changeChild : function(){ 
        var childCnt    = this.stage.childNodes.length; 

        for(var i=0; i<childCnt-1;i++ ){ 
            this.stage.appendChild( this.stage.childNodes[0] );    // Ç×»ó Ã¹¹øÂ°°ÍÀ» µÚ·Î ÀÌµ¿ 
        } 
    }, 
    actionTop : function(){ 
        this.stage.scrollTop++; 
        if( this.stage.scrollTop >= this.options.height ){ 
            this.stage.appendChild(this.stage.childNodes[0]); 
            this.stage.scrollTop = this.stage.scrollTop - this.options.height; 
            this.freeze            = true; 
        } 
    }, 
    actionDown : function(){ 
        this.stage.scrollTop--; 
        if( this.stage.scrollTop == 0 ){ 
            this.changeChild(); 
            this.stage.scrollTop = this.options.height; 
            this.freeze            = true; 
             
            this.setCourse("top"); 
        } 
    }, 
    move : function(){ 
        if(!this.isover){ 
            if(this.course == 'top')    this.actionTop(); 
            else                        this.actionDown(); 
        } 

        var This    = this; 
        if(this.freeze)    window.setTimeout(function(){This.move()}, this.options.freeze); 
        else            window.setTimeout(function(){This.move()}, this.options.inteval); 
        this.freeze    = false; 
    } 

} 

