function DescShow(color,obj){
	var key = $(obj).style.display;
	if (key == "block"){
		$(obj).style.display = "none";
		$(color).className = "";
	}else{
		$(obj).style.display = "block";
		$(color).className = "active";
	};
}
function ShowAndHide(obj) {
	var item = $(obj);
	item.style.display = ((item.style.display=="block")?"none":"block");
}
function ShowObj(obj) {
	var item = $(obj);
	item.style.display = "block";
}
function HideObj(obj) {
	var item = $(obj);
	item.style.display = "none";
}
function CheckShow(chekobj, checkval, checkval2, showobj, hideelse)
{

	var item = $(chekobj);
    var actobj = $(showobj);
    if (item.value==checkval || item.value==checkval2 && checkval2!='')
    {actobj.style.display="block";}
    else {actobj.style.display="none";}

}
function mirrorcheck(sourcename,targetname, mirrored)
{
	if (mirrored) {
	document.getElementById(targetname).checked=document.getElementById(sourcename).checked}
	else {document.getElementById(targetname).checked=!document.getElementById(sourcename).checked}
}
function radioButtonSet(itemobj,inputid) {
	var inputobj = $(inputid);
	if (inputobj){
		if (inputobj.value==1) return false;
		inputobj.value = 1;
		var list = document.getElementsByTagName('INPUT');
		for (var i=0; i<list.length; i++) if ((list[i].type=="hidden") && (list[i].className==itemobj.className)) list[i].value = 0;
		list = document.getElementsByTagName('SPAN');
		for (var i=0; i<list.length; i++) if (list[i].className==itemobj.className) list[i].firstChild.className = "";
		itemobj.firstChild.className = "active";
		var inputobj = $(inputid);
		if (inputobj) inputobj.value = 1;
	}
}
function send_voting()
{
	 	var vote_select=false;
	 	var vote_id=0;

	 	jQuery('.vote INPUT').each(function()
		{
           if (jQuery(this).val()==1)
           {
           		vote_select=true;
           		vote_id=jQuery(this).attr('id').replace('votefake','');
           }

		});



		if (vote_select)
		{         	$('vote_button').innerHTML='<H3>Ваш голос принят</H3>';
         	jQuery.get("/inc/voting.php", { send_voting: vote_id });
		}
}
