/*alias for getElementById */
var $=document.getElementById;

/*
 * Retrieves the most outer window ancestor 
 *   (useful when you're in a frame and want to reach the first frame)
*/
function getMainWindow(aWindow){
    if(aWindow.parent==aWindow) return aWindow;
    else return getMainWindow(aWindow.parent);
}