
var Interface = {

    home_load:function(){
        var lc = document.getElementById('hlc');
        var rc = document.getElementById('hrc'); 
        var h = document.getElementById('hh');
        var hL = this.getPositionX(h); 
        var hT = this.getPositionY(h);
        
        lc.style.left = (hL - 152) + 'px';
        rc.style.left = (hL + 998) + 'px';
        
        lc.style.visibility = 'visible';
        rc.style.visibility = 'visible';         
    },
    
    sub_load:function(){
    

        var lt = document.getElementById('lt');
        var rt = document.getElementById('rt');
        var lb = document.getElementById('lb');
        var rb = document.getElementById('rb');
        var c = document.getElementById('m');
        var f= document.getElementById('f'); 
               
        var cL = this.getPositionX(c); 
        var cT = this.getPositionY(c); 
        var fT = this.getPositionY(f);
        
        lt.style.left = (cL - 156) + 'px';
        lb.style.left = (cL - 156) + 'px';
        rt.style.left = (cL + 985) + 'px';
        rb.style.left = (cL + 985) + 'px';
        lt.style.top = cT + 'px';
        lb.style.top = (fT - 62) + 'px';
        rt.style.top = cT + 'px';
        rb.style.top = (fT - 62)  + 'px';
        lb.style.top = (fT - 62) + 'px';
        rb.style.top = (fT - 62)  + 'px';
        lt.style.visibility = 'visible';
        rt.style.visibility = 'visible';
        lb.style.visibility = 'visible';
        rb.style.visibility = 'visible';    
    },
    
    getPositionX:function(obj){
        var curLeft = 0;
        
        if(obj.offsetParent){
            while(1){
              curLeft += obj.offsetLeft;
              if(!obj.offsetParent){
                break;
              }
              obj = obj.offsetParent;
            }
        }
        else if(obj.x){
            curLeft += obj.x;
        }
        return curLeft;    
    },
    
    getPositionY:function(obj){
        var curTop = 0;
        
        if(obj.offsetParent){
            while(1){
              curTop += obj.offsetTop;
              if(!obj.offsetParent){
                break;
              }
              obj = obj.offsetParent;
            }
        }
        else if(obj.y){
            curTop += obj.y;
        }
        return curTop;     
    },
    
    getPageScrollHeight:function(){
    
	    var pageHeight;

	    if( window.innerHeight && window.scrollMaxY ){ // Firefox 	    
		    pageHeight = window.innerHeight + window.scrollMaxY;
	    }
	    else if( document.body.scrollHeight > document.body.offsetHeight ){ // all but Explorer Mac	    
		    pageHeight = document.body.scrollHeight;
	    }
	    else{ // works in Explorer 6 Strict, Mozilla (not FF) and Safari	     
		    pageHeight = document.body.offsetHeight + document.body.offsetTop; 
	    }
	    return pageHeight;    
    }    
};

