Bug 1115481 - Move 'window' variable declaration in the #ifdef it's used from. r=karlt