// JavaScript Document
var lastSwap = '';

function show(id){
	var div = document.getElementById(id);
	if (div){
		div.style.display = 'block';
	}
}
function swap(id, action){
	var div = document.getElementById(id);
	if (div){
		div.style.display = action;
	}
	if (lastSwap){
		if (lastSwap == id){
			//Do not close if user is on element
		}else{
			var div = document.getElementById(lastSwap);
			if (div){
				div.style.display = 'none';
			}
		}
	}
	lastSwap = id;
}

oldHref = '';

function functionStars(action, star, element){
	if (action == 'set'){
		
		var old = oldHref.style;
		var hre = element.style;
		var inp = document.getElementById('stars');
		
		if (old){ old.backgroundPosition = '18px 18px'; }
		if (hre){ hre.backgroundPosition = '0'; oldHref = element; }
		if (inp){ inp.value = star; }
		
		
	}else{
		
		var div = document.getElementById('starDiv');
		div.style.backgroundPosition = '0 ' + (18+(star*18)) + '';
		
	}
}
