// JavaScript Document
var funcs = new Array();

function getObject(id){
	return document.getElementById(id);
}

function getHeight(id){
	return getObject(id).offsetHeight;
}

function setHeight(id, w){
	getObject(id).style.height = w + 'px';
}

function copyHeight(idBase, id){	
	setHeight(id, getHeight(idBase));	
}

function clearValue(obj, value){
	if(obj.value == value){
		obj.value = '';
	}
}

function checkValue(obj, value){
	if(obj.value == ''){
		obj.value = value;
	}
}

function show(id){
	getObject(id).style.display = 'block';
}

function hide(id){
	getObject(id).style.display = 'none';
}

function getImgCoords(id) {
	var x = 0;
	var y = 0;
	var el = getObject(id);
	do {
		x += el.offsetLeft;
		y += el.offsetTop;
		el = el.offsetParent;
	}
	while (el);
	return {x: x, y: y};
}

function setCoord(obj, ref, dif){
	
	var coord = getImgCoords(ref);
	
	getObject(obj).style.top = (coord.y - dif.y) + 'px';
	getObject(obj).style.left = (coord.x - dif.x) + 'px';
}

function WindowLoad(){
	for(var i=0; i<funcs.length; i++){
		f = funcs[i];
		f();
	}
}

window.onload = WindowLoad;
