Q:

return a value via function math result that is stored in a variable

i was trying to get a result of the browsers  window width and trying to put the result of math and condition in a variable , this is the code 
var MyWidth = 1900;
var MyHeight = 900;
var height = $(window).height();
var width = $(window).width();

var AutoW = function () {
    if ( (MyWidth / width).toFixed(2) > 0.95 )
          return 1;
    if ( (MyWidth / width).toFixed(2) < 1.05 )
          return 1;
    else return (MyWidth / width).toFixed(2);
     };

alert(AutoW);

the problem is i don't know the right syntax or structure of the function assigned to the variable
what is the right way to code this ?

A:

alert(AutoW());
AutoW() returns the value of function assigned to the variable.
fiddle : http://jsfiddle.net/V2esf/

