This code works fine in every browser except safari where, after setting the new background image, the value returns the domain instead of the new url. My app changes the background after you upload an image that never existed before.
alert(backArea.style.backgroundImage); //alerts url('/images/bg.gif');
backArea.style.backgroundImage = "url('/images/profiles/temp/<?php echo $main; ?>');";
alert(backArea.style.backgroundImage); //alerts http://www.domain.com/