if (screen.width < 800)  {
  document.write('<link rel="stylesheet" type="text/css" href="small.css">');
}
if ((screen.width >= 800)&&(screen.width <= 1280))  {
  document.write('<link rel="stylesheet" type="text/css" href="medium.css">');
}
if (screen.width >= 1281) {
  document.write('<link rel="stylesheet" type="text/css" href="large.css">');
}
