function getRemoteArticle(u,d) {
	var ldiv = document.getElementById('lastopendiv').value;
	function SimpleAJAXCallback(in_text){
		if (ldiv) {
			document.getElementById(ldiv).innerHTML = '<span style="line-height: 0px;height:0px;font-size: 0px; padding:0px; margin:0px;"></span>';
		}
		document.getElementById(d).innerHTML = in_text;
		document.getElementById('lastopendiv').value = d;
		//window.location.hash = 'name_'+d;
		setTimeout ("Boo()", 2500);
		scrollToPosition(d);
	}
	SimpleAJAXCall('ajax.call.php?ee='+encodeURI(u)+'&dd='+encodeURI(d),SimpleAJAXCallback,'POST');
}

function getRemoteArticleInner(u,d,l) {
	var ldiv = document.getElementById('lastopendiv').value;
	function SimpleAJAXCallback(in_text){
		if (ldiv) {
			document.getElementById(ldiv).innerHTML = '<span style="line-height: 0px;height:0px;font-size: 0px; padding:0px; margin:0px;"></span>';
		}
		document.getElementById(d).innerHTML = in_text;
		document.getElementById('lastopendiv').value = d;
		//window.location.hash = 'name_'+d;
		//document.getElementById(d).scrollIntoView(true);
		setTimeout ("Boo()", 2500);
		scrollToPosition(d);
	}
	SimpleAJAXCall('ajax.call.php?ee='+encodeURI(u)+'&dd='+encodeURI(d),SimpleAJAXCallback,'POST');
}

function OLDgetRemoteArticleInner(u,d,l) {
	if(searchString(mainArt,l)) {
		d = l;
	}
	var ldiv = document.getElementById('lastopendiv').value;
	function SimpleAJAXCallback(in_text){
		setTimeout ("Boo()", 2500);
		document.getElementById(ldiv).innerHTML = '<span style="line-height: 0px;height:0px;font-size: 0px; padding:0px; margin:0px;"></span>';
		document.getElementById(d).innerHTML = in_text;
		document.getElementById('lastopendiv').value = d;
		window.location.hash = 'name_'+d;
		alert(ldiv);
	}
	SimpleAJAXCall('ajax.call.php?ee='+encodeURI(u)+'&dd='+encodeURI(d)+'&ll='+encodeURI(l),SimpleAJAXCallback,'POST');
}


function searchString(arrayToSearch, stringToSearch) {
	arrayToSearch.sort();
	for (var i = 0; i < arrayToSearch.length; i++) {
		if (arrayToSearch[i] == stringToSearch) {
			return true;
		} else if (stringToSearch < arrayToSearch[i]) {
			return false;
		}
	}
	return false;
}

function scrollToPosition(d) {  
  var theElement = document.getElementById(d);  // document.formName.elementNameor document.getElementById("idName")  
  elemPosX = theElement.offsetLeft  
  elemPosY = theElement.offsetTop;  
  theElement = theElement.offsetParent;  
  while(theElement != null){  
    elemPosX += theElement.offsetLeft   
    elemPosY += theElement.offsetTop;  
    theElement = theElement.offsetParent;  
  }  
  window.scrollTo(elemPosX ,elemPosY);  
}  
  
function Boo() {}
