function its() {
  var n = navigator;
  // string comparisons are much easier if we lowercase everything now.
  // to make indexOf() tests more compact/readable, we prepend a space 
  // to the userAgent string (to get around '-1' indexOf() comparison)
  var ua = ' ' + n.userAgent.toLowerCase();
  var pl = n.platform.toLowerCase(); // not supported in NS3.0
  var an = n.appName.toLowerCase();

  // browser version
  this.version = n.appVersion;
  
  this.nn = ua.indexOf('mozilla') > 0;

  // 'compatible' versions of mozilla aren't navigator
  if(ua.indexOf('compatible') > 0) {
    this.nn = false;
  }

  this.opera = ua.indexOf('opera') > 0;
  this.webtv = ua.indexOf('webtv') > 0;
  this.ie = ua.indexOf('msie') > 0;
  this.aol = ua.indexOf('aol') > 0;
  this.omniweb = ua.indexOf('omniweb') > 0;
  this.galeon = ua.indexOf('galeon') > 0;
  
  this.major = parseInt( this.version );
  this.minor = parseFloat( this.version );
  
  // platform
  this.mac = ua.indexOf('mac') > 0;
  this.mac68k = (ua.indexOf('68k') > 0
   || ua.indexOf('68000') > 0);
  this.macppc = (ua.indexOf('ppc') > 0
   || ua.indexOf('powerpc') > 0);

  // workarounds
  // - IE5/Mac reports itself as version 4.0
  if(this.ie && this.mac) {
    if(ua.indexOf("msie 5")) {
      this.major = 5;
      var actual_index = ua.indexOf("msie 5");
      var actual_major = ua.substring(actual_index + 5, actual_index + 8);
      this.minor = parseFloat(actual_major);
    }
  }

  return this;
}

var its = new its();
var screenwidth = screen.width;

if(its.mac || its.mac68k || its.macppc) {
   if (screen.width < 700) {
      document.write("<LINK REL=stylesheet HREF=\"style_640_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 900) {
      document.write("<LINK REL=stylesheet HREF=\"style_800_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1100) {
      document.write("<LINK REL=stylesheet HREF=\"style_1024_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1200) {
      document.write("<LINK REL=stylesheet HREF=\"style_1152_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1300) {
      document.write("<LINK REL=stylesheet HREF=\"style_1280_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1700) {
      document.write("<LINK REL=stylesheet HREF=\"style_1600_px.css\" TYPE=\"text/css\">"); 
     }
   else {
      document.write("<LINK REL=stylesheet HREF=\"style_1024_px.css\" TYPE=\"text/css\">"); 
     }
  }

else {
   if (screen.width < 700) {
      document.write("<LINK REL=stylesheet HREF=\"style_640_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 900) {
      document.write("<LINK REL=stylesheet HREF=\"style_800_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1100) {
      document.write("<LINK REL=stylesheet HREF=\"style_1024_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1200) {
      document.write("<LINK REL=stylesheet HREF=\"style_1152_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1300) {
      document.write("<LINK REL=stylesheet HREF=\"style_1280_px.css\" TYPE=\"text/css\">"); 
     }
   else if (screen.width < 1700) {
      document.write("<LINK REL=stylesheet HREF=\"style_1600_px.css\" TYPE=\"text/css\">"); 
     }
   else {
      document.write("<LINK REL=stylesheet HREF=\"style_1024_px.css\" TYPE=\"text/css\">"); 
     }
  }