if (screen.availWidth == 1024)
location = "pag1.html";
else if (screen.availWidth == 800)
location = "pag2.html";
...