Z fusów nie trzeba będzie wróżyć

Oto kod
Kod
function position(id_element, width_element){
var width = screen.availWidth;
width = width - width_element;
if(width < 0) width = 0;
var left = width/2;
document.getElementById(id_element).style.left = left;
}