var tddisp='none';
var extcolloaded=false;
var http_requests=[];
var elmts=[];

function resizepage() {
//	var tbl=document.body;
	var tbl={clientWidth:1025};
//	var maintbl=document.getElementById('maintbl');
//	var bigtbl=document.getElementById('bigtbl');
	if (tbl.clientWidth<1024 && tddisp!='none') {
		tddisp='none';
//		maintbl.style.background='none';
//		bigtbl.style.background='none';
	} else if (tbl.clientWidth>=1024 && tddisp!='block') {
		tddisp='block';
//		maintbl.style.background='url(/img/global/bg-newspaperBody.gif) repeat-y right top';
//		bigtbl.style.background='url(/img/global/bg-newspaperBody.gif) repeat-y right top';
		if (!extcolloaded) {
			extcolloaded=true;
			document.getElementById('ifrm1').src="/includes/static/column/top_banner.shtml";
			makeColRequest('/includes/static/column/center.shtml', showcol2,1);
		}
	}
	if (!elmts.length) {
		elmts[0]=document.getElementById('extcol1');
		elmts[1]=document.getElementById('extcol2');
//		elmts[2]=document.getElementById('extcol3');
	}
	for (var i=0;i<elmts.length;i++) elmts[i].style.display=tddisp;
}

    function makeColRequest(page,func,reqnum) {

        http_requests[reqnum] = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_requests[reqnum] = new XMLHttpRequest();
            if (http_requests[reqnum].overrideMimeType) {
                http_requests[reqnum].overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_requests[reqnum] = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_requests[reqnum] = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_requests[reqnum]) {
//            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_requests[reqnum].onreadystatechange = func;
        http_requests[reqnum].open('GET', page, true);
	http_requests[reqnum].setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=windows-1251');
        http_requests[reqnum].send(null);
    }

function showcol1() {
	showcol('extcol1',0);
}
function showcol2() {
	showcol('extcol2',1);
}
function showcol(colname,rn) {
        if (http_requests[rn].readyState == 4) {
            if (http_requests[rn].status == 200) {
                document.getElementById(colname).innerHTML=http_requests[rn].responseText;
            } else {
//                alert('There was a problem with the request.');
            }
        }
}

