	wraphandler = {
  init: function() {
    if (!document.getElementById) return;
    // set up the appropriate wrapper
    wraphandler.setWrapper();
    // and make sure it gets set up again if you resize the window
    wraphandler.addEvent(window,"resize",wraphandler.setWrapper);
  },

  setWrapper: function() {
    // width stuff from ppk's evolt.org/article/document_body_doctype_switching_and_more/17/30655/index.html
    var theWidth = 0;
    var wrapwidth = 0;
    if (window.innerWidth) {
	theWidth = window.innerWidth
    } else if (document.documentElement &&
                document.documentElement.clientWidth) {
	theWidth = document.documentElement.clientWidth
    } else if (document.body) {
	theWidth = document.body.clientWidth
    }
    if (theWidth != 0) {
      if (theWidth >= 1260) {
        document.getElementById('wrapper').className = 'mainwrapper';
      } else { 
		if (theWidth >= 1210) {
			document.getElementById('wrapper').className = 'wrapper1200';
		} else {
			if (theWidth >= 1160) {
				document.getElementById('wrapper').className = 'wrapper1150';
			} else {
				if (theWidth >= 1110) {
					document.getElementById('wrapper').className = 'wrapper1100';
				} else {
					if (theWidth >= 1060) {
						document.getElementById('wrapper').className = 'wrapper1050';
					} else {
						if (theWidth >= 1010) {
							document.getElementById('wrapper').className = 'wrapper1000';
						} else {
							if (theWidth >= 960) {
								document.getElementById('wrapper').className = 'wrapper950';
							} else {
								if (theWidth >= 910) {
									document.getElementById('wrapper').className = 'wrapper900';
								} else {
									if (theWidth >= 860) {
										document.getElementById('wrapper').className = 'wrapper850';
									} else {
										if (theWidth >= 810) {
											document.getElementById('wrapper').className = 'wrapper800';
										} else {
											if (theWidth >= 760) {
												document.getElementById('wrapper').className = 'wrapper750';
											} else {
												document.getElementById('wrapper').className = 'wrapper700';
											}
										}
									}
								}
							}
						}
					}
				}
			} 
		}
      }
    }
  },

// addEvent stuff from John Resig's ejohn.org/projects/flexible-javascript-events
  addEvent: function( obj, type, fn ) {
    if ( obj.attachEvent ) {
      obj['e'+type+fn] = fn;
      obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
      obj.attachEvent( 'on'+type, obj[type+fn] );
    } else {
      obj.addEventListener( type, fn, false );
    }
  }
}

wraphandler.addEvent(window,"load",wraphandler.init);
