A momento ho fatto così , anche se non è propio quello che volevo, ma è un qualche cosa di semplice senza usare javascript o media queries.
codice:
* {
padding: 0;
margin: 0;
}
html, body {
height: 100%;
}
#container {
min-height: 100%;
background-color: #000;
width: 100%;
margin: 0 auto;
}
* html #container {
height: 100%;
}
#header {
width: 100%;
height: 10px;
position: relative;
background: #000;
}
#main {
width: 100%;
height: 610px;
position: relative;
overflow: hidden;
background: #fff;
}
#footer {
width: 100%;
height: 170px;
position: relative;
background: url('../images/footer.png') repeat-x;
}