/***************************************************************************************************************/
//  Common fuction Class
/***************************************************************************************************************/
function ClsCont_Evt(){
    this.name = "ClsCont_Evt";
    
    this.xDivWrap;
    this.xDivCont;
    this.xLyrFixed;
    
    //브라우져 버젼 체크
    this.xEvt_BrowserVer = function(){
        var xBVer = navigator.appVersion.substring(25,22);
        
        return xBVer;
    };
    
    //초기화
    this.xEvt_Init = function(){
    	var ArgDivWrap = arguments[0];
    	var ArgDivCont = arguments[1];
    	var ArgLyrFixed = arguments[2];

    	this.xDivWrap = ArgDivWrap;
        this.xDivCont = ArgDivCont;
        this.xLyrFixed = ArgLyrFixed;
    };
    
    //레이어 크기변경
    this.xEvt_LayerSizing = function(){
    	if(this.xEvt_BrowserVer() == "6.0"){
    		this.xLyrFixed.style.width = this.xDivWrap.clientWidth +'px';
    		if(document.documentElement.clientWidth < this.xDivCont.clientWidth){
    			this.xLyrFixed.style.bottom = 15+'px';
    		}
    		else{
    			this.xLyrFixed.style.bottom = -1+'px';
    		}
    	}
    	else{
    		this.xLyrFixed.style.width = this.xDivWrap.clientWidth + 'px';
    	}
    };
    
    //스크롤(IE6.0외)
    this.xEvt_Scroll6E = function(){
    	var De = document.documentElement;
    	return self.pageXOffset || (De && De.scrollLeft) || document.body.scrollLeft;
    };
    
    //스크롤(IE6)
    this.xEvt_Scroll6S = function(){
    	return this.xDivWrap.scrollLeft;
    };
    
    //스크롤계산
    this.xEvt_Scroll = function(){
    	var scrollx_bar
    	
    	if (this.xEvt_BrowserVer() == "6.0"){
    		scrollx_bar = this.xEvt_Scroll6S();
    	}else{
    		scrollx_bar = this.xEvt_Scroll6E();
    	}
    	this.xLyrFixed.style.marginLeft= -scrollx_bar + 'px';
    	this.xLyrFixed.style.width = (this.xDivWrap.clientWidth + scrollx_bar) + 'px';
    };
}

var Cls_Evt = new ClsCont_Evt()
Cls_Evt.name = "Cls_Evt";

window.onload = function(){
	Cls_Evt.xEvt_Init(document.getElementById('container'), document.getElementById('entire'), document.getElementById('cartLoc'));
	Cls_Evt.xEvt_LayerSizing();

	var eleTop = 235;
	if (document.getElementById("divTop")) {
		new floatedLayer("divTop", eleTop, 100);
	}
}

window.onresize = function(){
	Cls_Evt.xEvt_LayerSizing();
	Cls_Evt.xEvt_Scroll();
}

