function init() {
	var dwidth;
	dwidth = getWindowWidth();
	setMainWidth(dwidth);
}

function getWindowWidth() {

//      For some reason, IE 6 doesn't like document.width, so a minor fork to
//      use the document.all syntax instead.
        if(document.all) {
                return(document.body.clientWidth); }
        else if (document.layers) {
                return(window.innerWidth); }
        else if (document.getElementById) {
                return(document.width); }
  return 0;
}

function setMainWidth(dwidth) {
	if (dwidth<700)
		return 0;

	var layer;

	if (document.getElementById) {
	        layer = document.getElementById("main");
        	layer.style.width = dwidth - 150;
		layer = document.getElementById("backmain");
		layer.style.width = dwidth - 150;
        }
//	else if (document.layers) {
//		return 0;
//        }
	else if (document.All) {
        	layer = document.All["main"];
        	layer.style.left = dwidth - 150;
                layer = document.All["backmain"];
                layer.style.left = dwidth - 150;
        }
	return 0;
}

