function f_banner(pos, id, lang){ window.fb_pos = pos; window.fb_id = id; window.fb_lang = lang; }
function fb_popshow(){ document.getElementById('fb_popdiv').style.visibility='visible'; }
function fb_pophide(){ document.getElementById('fb_popdiv').style.visibility='hidden'; }
var fb_t1,fb_t2;
var fb_url = 'http://all-hyips.info/';
var fb_div_offset, fb_popdiv_offset;
function get_height(){
    var elem = (document.compatMode === "CSS1Compat") ? document.documentElement : document.body;
    var height = elem.clientHeight;
    var width = elem.clientWidth;
    return height;
}
function generic() {
    var div = document.createElement('div');
    div.style.position = 'fixed';
    div.id = 'fb_div';
    var a = document.createElement('a');
    a.href = window.fb_url + '?a=details&lid=' + window.fb_id;
    a.onfocus = function() {this.blur();};
    var img = document.createElement('img');
    img.src = window.fb_url + '?a=image&lid=' + window.fb_id + '&pos=' + window.fb_pos;
    img.style.border = 'none';
    



    //img.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=0);";
    //div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"', sizingMethod='scale')";
    //img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"')";
    img.onmouseover = function(){var fb_t1=setTimeout('fb_popshow()',100); clearTimeout(fb_t2);};
    img.onmouseout = function(){var fb_t2=setTimeout('fb_pophide()',100); clearTimeout(fb_t1);};
    var popimg = document.createElement('img');
    popimg.src = window.fb_url+ '?a=image&lid=' + window.fb_id;;
    var popdiv = document.createElement('div');
    popdiv.style.position = 'fixed';
    popdiv.id = 'fb_popdiv';
    popdiv.appendChild(popimg);
    popdiv.style.visibility = 'hidden';
    var p = window.fb_pos;
    if (p == 'topleft'){
        div.style.top = 0;
        div.style.left = 0;
        popdiv.style.top = '100px';
        popdiv.style.left = 0;
    }
    if (p == 'topright'){
        div.style.top = 0;
        div.style.right = 0;
        popdiv.style.top = '100px';
        popdiv.style.right = 0;
    }
    if (p == 'bottomleft'){
        div.style.top = (get_height() - 100)+'px';
	//div.style.bottom = 0;
        div.style.left = 0;
        popdiv.style.top = (get_height() - 400)+'px';
	//popdiv.style.bottom = '100px';
        popdiv.style.left = 0;
    }
    if (p == 'bottomright'){
        div.style.top = (get_height() - 100)+'px';
	//div.style.bottom = 0;
        div.style.right = 0;
        popdiv.style.top = (get_height() - 400)+'px';
	//popdiv.style.bottom = '100px';
        popdiv.style.right = 0;
    }
    if (p == 'left'){
        div.style.left = 0;
        div.style.top = (get_height()-225)/2+'px';
        popdiv.style.left = '50px';
        popdiv.style.top = (get_height()-295)/2+'px';
    }
    if (p == 'right'){
        div.style.right = 0;
	div.style.top = (get_height()-225)/2+'px';
	div.style.height = '225px';
	div.style.width = '50px';
	popdiv.style.top = (get_height()-295)/2+'px';
        popdiv.style.right = '50px';
    }
        
    a.appendChild(img);
    div.appendChild(a);
    document.body.appendChild(div);
    document.body.appendChild(popdiv);
    
    if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
    	img.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=0);";
	//div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"')";
	div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img.src+"', sizingMethod='scale')";
	
	div.onmouseover = img.onmouseover;
	div.onmouseout = img.onmouseout;
	div.style.cursor = 'pointer';
	div.onclick = function(){window.location=a.href;};
	a.style.position = 'relative';
	
	div.style.position = 'absolute';
	//div.style.top = "expression(document.body.scrollTop+95)";
	popdiv.style.position = 'absolute';
	
	var d = document.getElementById('fb_div');
	var pd = document.getElementById('fb_popdiv');
	fb_div_offset = parseInt(d.style.top);
	fb_popdiv_offset = parseInt(pd.style.top);		
	window.onscroll = function(){
		var d = document.getElementById('fb_div');
		var pd = document.getElementById('fb_popdiv');
		d.style.top = (fb_div_offset + parseInt(document.documentElement.scrollTop)) + 'px';
		pd.style.top = (fb_popdiv_offset + parseInt(document.documentElement.scrollTop)) + 'px';
	};		
    }	
    
};


//setup onload function
if(typeof window.addEventListener != 'undefined'){ //.. gecko, safari, konqueror and standard
	window.addEventListener('load', generic, false);
} else if(typeof document.addEventListener != 'undefined'){ //.. opera 7
	document.addEventListener('load', generic, false);
} else if(typeof window.attachEvent != 'undefined'){ //.. win/ie
	window.attachEvent('onload', generic);
}
//** remove this condition to degrade older browsers
else { //.. mac/ie5 and anything else that gets this far
	if(typeof window.onload == 'function'){ //if there's an existing onload function
		var existing = onload; //store it
		window.onload = function() { //add new onload handler
			existing(); //call existing onload function
			generic(); //call generic onload function
		};
	} else { 
		window.onload = generic; //setup onload function
	}
}

