var leftPos = (typeOf window.screenleft == "number") ?window.screenLeft : window.screenX; var topPos = (typeOf window.screenTop == "number" ) ? window.screenTop : window.screenY;