jQuery(function() {
	jQuery('.placeholder').each(function() {
		jQuery(this).focus(function() {
			if(!jQuery(this).hasClass('empty')) {
				jQuery(this).val('');
				jQuery(this).addClass('empty');
			}
		});
	});
});


function highlight(row, highlight) {	
	if(highlight) {
		row.original_background = row.style.background;
		row.style.setProperty('cursor', 'pointer', null);	
		row.style.setProperty('background-color', '#eee', null);
	} else {
		row.style.setProperty('cursor', 'default', null);	
		row.style.setProperty('background-color', row.original_background, null);
	}
}


// Sortlist Options

var highlightTmp = "";
function highlight_row(row) {
	highlightTmp = (document.getElementById(row).style.backgroundColor != "" ? document.getElementById(row).style.backgroundColor : '');
	document.getElementById(row).style.backgroundColor = '#AFCCFF';
}
function unhighlight_row(row) {
	document.getElementById(row).style.backgroundColor = (highlightTmp == '' ? '' : highlightTmp);
}
// This function re-paints the list tables
function repaint() {
	var menuitems = document.getElementById('list').getElementsByTagName("tr");
	var j = 0;
	for (var i=1; i<menuitems.length; i++) {
		if(menuitems[i].style.display != "none") {
			menuitems[i].className = ((j%2) == 0 ? "sortlist_even" : "sortlist_odd");
			j += 1;
		}		
	}
}
