window.onload = function() {
	resize();
    whatCorrector();
}

function resize() {
	var padding = 323;
	var optimalHeight = document.body.clientHeight - padding;
	var contentHeight = document.getElementById("content").offsetHeight;
	var rightHeight = document.getElementById("right").offsetHeight;

	if( ( contentHeight < optimalHeight ) && ( rightHeight < optimalHeight ) ) {
		document.getElementById("content").style.height = optimalHeight + "px";
		document.getElementById("right").style.height = optimalHeight + "px";
	} else {
		if ( contentHeight > rightHeight ) {
			document.getElementById("right").style.height = contentHeight + "px";
		} else if ( rightHeight > contentHeight ) {
			document.getElementById("content").style.height = rightHeight + "px";
		}
	}
}

function whatCorrector() {
  var replaces = 0;
  var alltags = document.all ? document.all.tags("DIV") : document.getElementsByTagName("*");
  for (i=0; i < alltags.length; i++) {
    if (alltags[i].id == 'content') {
      while (alltags[i].innerHTML.indexOf('##'+'qkac##') != -1 && replaces < 10000) {
        alltags[i].innerHTML = alltags[i].innerHTML.replace('##'+'qkac##', String.fromCharCode(64));
        alltags[i].innerHTML = alltags[i].innerHTML.replace('##'+'pont##', String.fromCharCode(46));
        replaces++;
      }
    }
  }
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

/*
function whatCorrector() {
	var replaces=0;
	while (document.body.innerHTML.indexOf('##'+'qkac##')!=-1 && (replaces<10000)) {

		document.body.innerHTML = document.body.innerHTML.replace('##'+'qkac##',String.fromCharCode(64));
 		document.body.innerHTML = document.body.innerHTML.replace('##'+'pont##',String.fromCharCode(46));
		replaces++;
	}
}
*/
