function dispatchinputs() {
	var inputs = document.getElementsByTagName('input');
	for (i in inputs) {
		if (inputs[i].type == 'text' || inputs[i].type == 'password') {
			inputs[i].onfocus = function() {
				//alert(this.style.backgroudColor);
				//this.style.bgColor = 'FFFFFF';
			}
		}
	}
}

/**
 * Ask and Redirect function
 * on question confirmation redirect to specified location
 */
function aar(question, location) {	
	if(confirm(question))
		window.location = location;
}

function $(id) {
	return document.getElementById(id);
}


function clearText(that, txt){
	if(that.value == txt)
		that.value='';
	return true;
}

function checkType(that, ver){
	var otherField = $('qs_type'+ver);
	if(that.selectedIndex > 0){
		otherField.selectedIndex = 0;
	}
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return [curleft,curtop];
	}
}

function showVCbox(id, that) {
	var pos = findPos(that);
	document.getElementById(id).style.top = pos[1]+'px';
	document.getElementById(id).style.left = (pos[0]-290)+'px';
	document.getElementById(id).style.display = 'block';
}

//findPos(this)
