function show_vote_pop(id, stat) {
	var show = "show_vote_"+id;
	document.getElementById(show).style.display = "block";
	document.getElementById("divval").value = id;
	hide_vote_pop(id);
}
function hide_vote_pop(id)
{
	var count = parseInt(document.getElementById("count").value);
	var showvalue_id = document.getElementById("divval").value;
	//alert(showvalue_id);
	if(showvalue_id!=""){
		if(count>0){
			for(i=1;i<=count;i++){
				if(i!=showvalue_id){
					var showvalue = 'show_vote_'+i;
					document.getElementById(showvalue).style.display = "none";
				}
			}
		}
	}

	//document.getElementById("divval").value = "";

}

function hide_vote_all_pop()
{
	var count = parseInt(document.getElementById("count").value);	
	if(count>0){
		for(i=1;i<=count;i++){
			var showvalue = 'show_vote_'+i;
			var showstatusvalue = 'show_status_'+i;
			document.getElementById(showvalue).style.display = "none";
			document.getElementById(showstatusvalue).style.display = "none";
		}
	}
	document.getElementById("divval").value = "";
	hide_star_all_pop();
}

function show_status_menu(id){
	
	var show = "show_status_"+id;
	document.getElementById(show).style.display = "block";
	document.getElementById("divval").value = id;
	hide_status_pop(id);
}

function hide_status_pop(id)
{
	var count = parseInt(document.getElementById("count").value);
	var showvalue_id = document.getElementById("divval").value;
	
	//alert(showvalue_id);
	if(showvalue_id!=""){
		if(count>0){
			for(i=1;i<=count;i++){
				if(i!=showvalue_id){					
					var showvalue = 'show_status_'+i;
					
					document.getElementById(showvalue).style.display = "none";
				}
			}
		}
	}
}
function hide_status_all_pop()
{
	var count = parseInt(document.getElementById("count").value);
	
	if(count>0){
		for(i=1;i<=count;i++){
			var showvalue = 'show_status_'+i;
			document.getElementById(showvalue).style.display = "none";
		}
	}
	document.getElementById("divval").value = "";

}

	//document.getElementById("divval").value = "";

function change_status(idea_id , value)
{	
	createRequest();
	url = "/zones/changestatus/"+idea_id+"/"+value;
	request.onreadystatechange = showStausIdeas
	request.open("GET", url, true);
	request.send(null);
}

function showStausIdeas()
{
	var status_div = document.getElementById("status_count").value;
	
	if(request.readyState<"4")
	{
		divid = "changed_status_idea_"+status_div;
		document.getElementById(divid).style.display = "block";
		document.getElementById(divid).innerHTML = "<img src='/img/spinner.gif'>";
	}
	if(request.readyState == "4")
	{
		response = request.responseText;		
		divid = "changed_status_idea_"+status_div;
		
		document.getElementById(divid).innerHTML = response;
	}
}

function show_star_pop(id)
{
	var show = "show_star_"+id;
	
	document.getElementById(show).style.display = "block";
	document.getElementById("divvalnew").value = id;
	hide_star_pop(id);
}
function hide_star_pop(id)
{
	var count = parseInt(document.getElementById("count").value);
	var showvalue_id = document.getElementById("divvalnew").value;
	//alert(showvalue_id);
	if(showvalue_id!=""){
		if(count>0){
			for(i=1;i<=count;i++){
				if(i!=showvalue_id){
					var showvalue = 'show_star_'+i;
					document.getElementById(showvalue).style.display = "none";
				}
			}
		}
	}

	//document.getElementById("divval").value = "";

}

function hide_star_all_pop()
{
	var count = parseInt(document.getElementById("count").value);
	
	if(count>0){
		for(i=1;i<=count;i++){
			var showvalue = 'show_star_'+i;
			var showstatusvalue = 'show_status_'+i;
			document.getElementById(showvalue).style.display = "none";
			document.getElementById(showstatusvalue).style.display = "none";
		}
	}
	document.getElementById("divvalnew").value = "";

}
