center a div depending screen width
<p>i think i'm doing something wrong.
i mean, I'm trying to make a function to center one divs depending screen width.</p>

<h1>cabecera is the div i'm trying to center using left position</h1>

<p>my code start through this thinking:</p>

<p>mw ---> minimal width of the div</p>

<p>mg0 --> left margin + right margin ( the same value for both )</p>

<pre><code>$(window).width = mg0 + mw = m + m + mw
</code></pre>

<p>this is my code.</p>

<pre><code>function calc_margen() {
  var mw = 1000;
  var mpw = $(window).width();
  var mg0 = mpw - mw;
  var m = mg0 / 2;
  $('#cabecera').left( m );
  $('#pie').left ( m );
};
</code></pre>
