function navHover(obj) {
	if (obj.src.match('free')) {
		obj.src = obj.src.replace('free', 'hover');
	} else {
		obj.src = obj.src.replace('hover', 'free');
	}
}

function inputFlipper(obj, text) {
	if (obj.value == text) {
		obj.value = '';
	} else if (obj.value == '') {
		obj.value = text;
	}
}

function ajaxPollCheck(choice) {
	var answers = document.getElementById('ajaxPoll').getElementsByTagName('img');
	var _poll_answer = document.getElementById('_poll_answer');
	var c;
	for (var i = 0; i < answers.length; i++) {
		answers[i].src = 'img/control-radio_' + ((answers[i].alt == ('choice' + choice)) ? 'check' : 'free') + '.gif';
	}
	_poll_answer.value = choice;
}


function ajaxDropDownOpen(name) {
	var object = document.getElementById("ddown" + name);
	if (object.style.display == 'block') {
		object.style.display = 'none';
	} else {
		object.style.display = 'block';
	}
}

function ajaxDropDownChose(objID, id, value) {
	var labelObject = document.getElementById(objID);
	labelObject.innerHTML = value;
	ajaxDropDownOpen(objID);
	document.getElementById(objID.substring(1, objID.length)).value = id;

}

function ajaxDropDownLoad(objID, size) {
	var labelObject = document.getElementById(objID);
	var listObject = document.getElementById('ddown' + objID);
	labelObject.style.width = (size - 5) + 'px';
	listObject.style.width = (size - 5) + 'px';
	labelObject.style.background = 'url(img/field-select_' + size + '.gif) no-repeat';
}

function showPublications(id) {
	var lister = document.getElementById('__publications');
	var rows = lister.getElementsByTagName('div');
	for(var i = 0; i < rows.length; i++) {
		if (rows[i].id.search('__row') > -1) {
			if (rows[i].id == '__row:' + id) {
				rows[i].className = 'show-block';
			} else {
				rows[i].className = 'show-none';
			}

		}
	}
}


var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy) {
	var el = d.getElementById ? d.getElementById(id) : d.all ? d.all[id] : d.layers[id];
	var px = d.layers ? "" : "px";
	window[id + "_obj"] = el;
	if (d.layers) {
		el.style = el;
	}
	el.cx = el.sx = sx;
	el.cy = el.sy = sy;
	el.sP = function(x, y){
		this.style.left = x + px;
		this.style.top = y + px;
	}
	el.floatIt=function() {
		var pX, pY, add;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : d.documentElement && d.documentElement.clientWidth ? d.documentElement.clientWidth : d.body.clientWidth;
		pY = ns ? pageYOffset : d.documentElement && d.documentElement.scrollTop ? d.documentElement.scrollTop : d.body.scrollTop;
		if (pY > 230) {
//			if (this.sy < 0) {
//				pY += ns ? innerHeight : d.documentElement && d.documentElement.clientHeight ? d.documentElement.clientHeight : d.body.clientHeight;
//			}
			this.cx += (pX + this.sx - this.cx) / 8;
			this.cy += (pY + this.sy - this.cy) / 8;
			this.sP(this.cx, this.cy);
		}
		setTimeout(this.id + "_obj.floatIt()", 40);
	}
	return el;
}