﻿        /* Progressive Layout */
        //browser detection
	    var NS = (navigator.appName == "Netscape");
	    mac = navigator.appVersion.indexOf("Mac");
	    if (mac>=0) {mac=1} else {mac=0}
	    IE = (document.all) ? true : false; 
	    NS4 = (document.layers) ?  true : false;
	    eID = document.getElementById;
	    if(eID && NS) {NS6=true} else {NS6=false}
	    if ((IE) || (NS4) || (NS6)) {dhtml=1;}
	    
        if(document.getElementById)
        MakeLayout("maincontainer",775,1000,1024);

        function MakeLayout(id,minr,maxw,maxr){
            el=document.getElementById(id);
            if(el){
                SetWidth(id,minr,maxw,maxr);
                window.onload=function(){ SetWidth(id,minr,maxw,maxr);}
            }
            else setTimeout("MakeLayout('"+id+"',"+minr+","+maxw+","+maxr+")",50);
        }

        function SetWidth(id,a,b,c){
            var w=getBrowserWidth();
            //alert(w);
			if(w==0) return;
            var el=document.getElementById(id);
            el.style.margin="0 0 0 0";
            var d=el.style;
            if(w<a) d.width=parseInt(a)+"px";
            //else if(w>a) && (w<=b) d.width=parseInt(a)+"px";
            else if(w>=c) d.width=b+"px";
            else{
                var m=(b-a)/(c-a);
                if(IE)
                    d.width = parseInt(w-2)+"px";
                else
                    d.width = parseInt(w-16)+"px";
                //d.width=parseInt(m*w+a*(1-m))+"px";
				//d.width = parseInt(w-10)+"px";
				//alert(d.width);
            }
        }
        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;
        }