
self.offscreenBuffering = true;

function DOMGetElement(o) {

  if (document.getElementById) return document.getElementById(o);

  else if (document.all)             return document.all[o];

  else if (document.layers)          return document.layers[o];

  return null;

}



function DOMWindowGetXOffset() {

  if (document.all)            return document.body.scrollLeft;


  else if (document.getElementById)  return window.pageXOffset;

  else if (document.layers)          return window.pageXOffset;

}



function DOMWindowGetYOffset() {

  if (document.all)             return document.body.scrollTop;

  else if (document.getElementById)  return window.pageYOffset;

  else if (document.layers)          return window.pageYOffset;

}



function DOMElementSetTopPos(o,val) {

  if (document.getElementById) o.style.top = val;

  else if (document.all)       o.style.top = val;

  else if (document.layers)    o.pageY = val;

}



function DOMElementSetLeftPos(o,val) {

  if (document.getElementById) o.style.left = 0;

  else if (document.all)       o.style.left = 0;

  else if (document.layers)    o.pageX = 4;

}



function DOMWindowGetInnerWidth() {

  if (document.all)           return document.body.clientWidth;

  else if (document.getElementById)   return window.innerWidth;

  else if (document.layers)           return window.innerWidth;

}



function DOMWindowGetInnerHeight() {

  if (document.all)          return document.body.clientHeight;

  else if (document.getElementById)  return window.innerHeight;

  else if (document.layers)          return window.innerHeight;

}



function DOMElementGetHeight(o) {

  if (document.all)                 return o.clientHeight;

  else if (document.getElementById) return parseInt(o.offsetHeight);

  else if (document.layers)         return o.document.height;

}



function DOMElementGetWidth(o) {

  if (document.all)                 return o.clientWidth;

  else if (document.getElementById) return parseInt(o.offsetWidth);

  else if (document.layers)         return o.document.width;

}



function pageOffset() {

    var windowHeight = DOMWindowGetInnerHeight();

	var windowWidth = DOMWindowGetInnerWidth();

	fitTextSize(windowHeight);

    setTimeout('pageOffset()',1500);

} 

function fitTextSize(windowHeight) {

      if (windowHeight > 650) {

		  var fontSize = 4;

		  var fontWeight = 'bold';

		  var mSize = 3;

	      }

	  else if (windowHeight > 550){
		  var fontSize = 3;

		  var fontWeight = 'bold';

		  var mSize = 2;

	      } 

	  else if (windowHeight > 450){

		 var fontSize = 3;

		 var fontWeight = 'bold';

	     var mSize = 1;

	      }

	  else if (windowHeight > 400){

		var fontSize = 2;

	    var fontWeight = 'normal';

		var mSize = 1;

	      }

	  else {

		var fontSize = 2;

		var fontWeight = 'normal';

		var mSize = 1;

		  }

	 var heading = DOMGetElement('heading'); 

	// var text1 = DOMGetElement('text1');  


	 //var text2 = DOMGetElement('text2'); 

	// var text3 = DOMGetElement('text3');   



	// heading.setAttribute('size',fontSize + 1);

	// text1.setAttribute('size',fontSize);

	// text2.setAttribute('size',fontSize);

	// StrFontWeight = 'font-weight:' + fontWeight + 'px;'

	// text3.style.fontWeight = fontWeight;

	 fitMsize(mSize);

	

} 

function fitMsize(mSize) {

   var m = DOMGetElement('m');

   var MsizeStr =  '../grafix/m' + mSize + '.jpg';

   m.setAttribute('src',MsizeStr); 

}

