function erevnaAns(id,n)
{
	document.getElementById("active"+id).value = id;
	
	document.getElementById("color3"+id).src = "images_/box/2_2.jpg";
	document.getElementById("color1"+id).src = "images_/box/1_2.jpg";	
	document.getElementById("color7"+id).src = "images_/box/3_2.jpg";
	document.getElementById("color9"+id).src = "images_/box/4_2.jpg";
	document.getElementById("color4"+id).style.backgroundColor = "#cc0099";
	document.getElementById("color6"+id).style.backgroundColor = "#cc0099";
	document.getElementById("color11"+id).style.backgroundColor = "#cc0099";
	document.getElementById("color10"+id).style.backgroundColor = "#cc0099";
	document.getElementById("color12"+id).style.backgroundColor = "#cc0099";
	var num = document.getElementById("num"+n).value;
	//document.gelElementById("otherg"+n).style.display = "block";
	for(var i=1; i<=num; i++)
	{
		var  id2 = document.getElementById("L"+i+id).value;
		UnSetColors(id2,id);
	}
}
function setColors(id)
{

if(document.getElementById("active").value != id)
	{
	document.getElementById("color3"+id).src = "images_/box/2_.jpg";
	document.getElementById("color1"+id).src = "images_/box/1_.jpg";	
	document.getElementById("color7"+id).src = "images_/box/3_.jpg";
	document.getElementById("color9"+id).src = "images_/box/4_.jpg";
	
	document.getElementById("color11"+id).style.borderTop = "2px solid #cc0099";
	document.getElementById("color10"+id).style.borderBottom = "2px solid #cc0099";
	document.getElementById("color4"+id).style.borderLeft = "2px solid #cc0099";
	document.getElementById("color6"+id).style.borderRight = "2px solid #cc0099";
	}
}

function UnSetColors(id,id2,id3)
{
	if(document.getElementById("active"+id3).value != id)
	{
		document.getElementById("color3"+id).src = "images_/box/2.jpg";
		document.getElementById("color1"+id).src = "images_/box/1.jpg";	
		document.getElementById("color7"+id).src = "images_/box/3.jpg";
		document.getElementById("color9"+id).src = "images_/box/4.jpg";
		document.getElementById("color11"+id).style.borderTop = "";
		document.getElementById("color10"+id).style.borderBottom = "";
		document.getElementById("color4"+id).style.borderLeft = "";
		document.getElementById("color6"+id).style.borderRight = "";
		
		
		document.getElementById("color11"+id).style.backgroundColor = "#ffffff";
		document.getElementById("color4"+id).style.backgroundColor = "#ffffff";		
		document.getElementById("color10"+id).style.backgroundColor = "#ffffff";
		document.getElementById("color6"+id).style.backgroundColor = "#ffffff";
		document.getElementById("color12"+id).style.backgroundColor = "#ffffff";
		document.getElementById("up2"+id).style.backgroundColor = "#ffffff";
	}
}
function setaptext(id)
{
	var len = document.getElementById("next").href;
	//alert(document.getElementById("ap").value);
	var link = 'erevna.php?id='+document.getElementById("erid").value+'&q='+ document.getElementById("qq").value + '&text='+encodeURIComponent(document.getElementById("ap").value)+"&ans="+id+'#err';
	window.location = link;
	//return false;
}
function goerevnapage()
{
	var id = document.getElementById("active").value;
	var len = 'erevna.php?id='+document.getElementById("erid").value+'&q=apot';
	var link = len + '&ans='+id+'#err';
	window.location = link;
}
function goerevnapage2()
{
	var id = document.getElementById("active").value;
	var len = 'erevna.php?id='+document.getElementById("erid").value+'&q='+document.getElementById("qq").value;
	var link = len + '&ans='+id+'#err';
	window.location = link;
}
function setApKr2()
{
	var id = document.getElementById("active").value;
	var idg = document.getElementById("idg").value;
	var len = document.getElementById("next").href;
	var link = 'krisis_save.php?id=' +idg+ '&q=apot&ans='+id+'#err';
	window.location = link;
}
