 //var positionFooter; 
 var positionRight = 0;
 var widthAds = 145;
 var heightAds = 242;

function f_clientWidth() {
	return f_filterResults (
		window.innerWidth ? window.innerWidth : 0,
		document.documentElement ? document.documentElement.clientWidth : 0,
		document.body ? document.body.clientWidth : 0
	);
}
function f_clientHeight() {
	return f_filterResults (
		window.innerHeight ? window.innerHeight : 0,
		document.documentElement ? document.documentElement.clientHeight : 0,
		document.body ? document.body.clientHeight : 0
	);
}
function f_scrollLeft() {
	return f_filterResults (
		window.pageXOffset ? window.pageXOffset : 0,
		document.documentElement ? document.documentElement.scrollLeft : 0,
		document.body ? document.body.scrollLeft : 0
	);
}
function f_scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}


var div = document.getElementById('divPositionRightBannerFloat');
if(div!=null)
    positionRight = div.offsetTop;
try {
    document.getElementById('dhtmltooltip11').style.display = "block";
}
catch (Exception) { }
var yy = 0;
var toptop=0;
var beforeTop = 100;

function showFloatAdsRight()
{               
    yy = f_clientWidth() - widthAds;//padding left
    toptop = (f_scrollTop() - beforeTop)/8;            
	//toptop=0;
    //beforeTop = toptop + beforeTop + 30;
    beforeTop = toptop + beforeTop + 15;
	//beforeTop=20;
    
    if(beforeTop < 5)
        document.getElementById('dhtmltooltip11').style.top = f_scrollTop() + 'px';
    else
        document.getElementById('dhtmltooltip11').style.top = beforeTop + 'px';
        
    beforeTop = parseInt(document.getElementById('dhtmltooltip11').style.top.substring(0,document.getElementById('dhtmltooltip11').style.top.length));
    
    /*document.getElementById('dhtmltooltip11').style.left = yy  + 'px';*/
	document.getElementById('dhtmltooltip11').style.left = yy - 15 +'px';
    
    document.getElementById('dhtmltooltip11').style.display = "block";
    
    /*if(beforeTop < positionRight + heightAds)
        document.getElementById('dhtmltooltip11').style.display = "none";*/
     
    /*var divFooter =  document.getElementById('divPositionFloatBannerFooter');                    
    if(divFooter!=null)
        positionFooter = divFooter.offsetTop;  
                    
    if(beforeTop > positionFooter + heightAds)
        document.getElementById('dhtmltooltip11').style.display = "none";*/
        
    //document.getElementById('dhtmltooltip11').innerHTML =beforeTop+ 'dsd'+positionRight +'-----' + toptop + '-------' + f_scrollTop() + ' --- --';
    
    setTimeout('showFloatAdsRight()', 1);        
}

var div = document.getElementById('divPositionBannerFloat');
var positionLeft = 0;
if(div!=null)
    positionLeft = div.offsetTop;

try { document.getElementById('dhtmltooltip11Left').style.display = "none"; } catch (Exception) { }
var yy = 0;
var toptop=0;
var beforeTop = 100;

function showFloatAdsLeft()
{               
    yy = 0;//padding left
    toptop = (f_scrollTop() - beforeTop)/8;            
	//toptop=0;
    beforeTop = toptop + beforeTop + 18;
	//beforeTop=20;
    
    if(beforeTop < 5)
        document.getElementById('dhtmltooltip11Left').style.top = f_scrollTop() + 'px';
    else
        document.getElementById('dhtmltooltip11Left').style.top = beforeTop + 'px';
        
    beforeTop = parseInt(document.getElementById('dhtmltooltip11Left').style.top.substring(0,document.getElementById('dhtmltooltip11').style.top.length - 2));
    
    document.getElementById('dhtmltooltip11Left').style.left = yy + 5  + 'px';
    
    document.getElementById('dhtmltooltip11Left').style.display = "block";
    
    /*if(beforeTop < positionLeft + heightAds)
        document.getElementById('dhtmltooltip11Left').style.display = "none";*/
     
    /*var divFooter =  document.getElementById('divPositionFloatBannerFooter');                    
    if(divFooter!=null)
        positionFooter = divFooter.offsetTop;  
                    
    if(beforeTop > positionFooter + heightAds)
        document.getElementById('dhtmltooltip11Left').style.display = "none";*/
        
    //document.getElementById('dhtmltooltip11Left').innerHTML =beforeTop+ 'dsd'+positionLeft +'-----' + toptop + '-------' + f_scrollTop() + ' --- --';
    
    setTimeout('showFloatAdsLeft()', 1); 
    //Không hiển thị float banner bên trái
 
}
