function dynamicLayout(){
    var browserWidth = getBrowserWidth();

    //Load Thin CSS Rules
    if (browserWidth < 950){
        changeLayout("thin","499px","749px","20px");
    }
    //Load Wide CSS Rules
    if ((browserWidth > 1200)){
        changeLayout("wide","799px","1049px","75px");
    }
}
function getBrowserWidth(){
    if (window.innerWidth){
        return window.innerWidth;}  
    else if (document.documentElement && document.documentElement.clientWidth != 0){
        return document.documentElement.clientWidth;}
    else if (document.body){return document.body.clientWidth;}      
        return 0;
}

function changeLayout(description,frame_width,site_width,margin){
		if(document.getElementById("c2")) document.getElementById("c2").style.width=frame_width;
		if(document.getElementById("content1")) document.getElementById("content1").style.width=site_width;
		if(document.getElementById("features")) document.getElementById("features").style.marginRight=margin;
		if(document.getElementById("features")) document.getElementById("features").style.marginLeft=margin;
//		if(document.getElementById("centrecontent3col")) document.getElementById("centrecontent3col").style.marginLeft="190px";
//		if(document.getElementById("centrecontent2col")) document.getElementById("centrecontent2col").style.marginLeft="190px";
}

//addEvent() by John Resig
function addEvent( obj, type, fn ){ 
   if (obj.addEventListener){ 
      obj.addEventListener( type, fn, false );
   }
   else 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] ); 
   } 
} 

//Run dynamicLayout function when page loads and when it resizes.
addEvent(window, 'load', dynamicLayout);
addEvent(window, 'resize', dynamicLayout);
// -->
