var timePassedd = false;

var t;
var count = 0;
function bottom(targetYPos) {
	var y = document[getDocElName()].scrollTop;
	if (count > 10) {
		count = 0;
		return;
	}
	if (y < targetYPos) {
		window.scrollBy(0,10);
		count++;
		t=setTimeout('bottom('+targetYPos+')',10);
	}
	else {
		count = 0;
		clearTimeout(t);
	}
	return false;
}
function scrollDown(targetYPos) {
	var y = document[getDocElName()].scrollTop;
	if (count > 100) {
		count = 0;
		return;
	}
	if (y < targetYPos) {
		window.scrollBy(0,10);
		count++;
		t=setTimeout('scrollDown('+targetYPos+')',10);
	}
	else {
		count = 0;
		clearTimeout(t);
	}
	return false;
}
function getDocElName(){
	if(document.compatMode && document.compatMode == "CSS1Compat"){
		return "documentElement";
	}
	else{
		return "body";
	}
}
function getOffsets(e) {
	var o = {
		height: e.offsetHeight,
		width: e.offsetWidth
	};
	
	var x = e.offsetLeft;
	var y = e.offsetTop;
	var p = e.offsetParent;
	
	while(p && (p.nodeType != 9)) {
		x += p.offsetLeft;
		y += p.offsetTop;
		p = p.offsetParent;
	}
	o.left = x;
	o.top = y;
	return o;
}
function organizeText() {
	var imagetext = document.getElementById('imagetext');
	var top = document.getElementById('top');
	var offsets = getOffsets(top);
	
	if(imagetext != null){
		imagetext.style.zIndex = 10;
		imagetext.style.display = 'block';
		imagetext.style.position = 'absolute';
		imagetext.style.top = (offsets.top + 149) + 'px';
		imagetext.style.left = (offsets.left + 314) + 'px';
	}
}

window.onload = organizeText;
window.onresize = organizeText;
