//Se pueden editar iconos
var panelActivo = true;
//Auxiliar elemento celda
var td = null;
var colors = new Array('#FFFFFF','#000000');
var celdas = new Array();
for (i=1;i<=25;i++) celdas[i]=0;

function switchTD(celda){
	//alert(celdas.join(""));
	if (panelActivo){
		celdas[celda]=(celdas[celda]+1)%2;
		td = document.getElementById('td'+celda);
		td.style.backgroundColor = colors[celdas[celda]];
		td = document.getElementById('ptd'+celda);
		td.style.backgroundColor = colors[celdas[celda]];
	}
}

function clearICO(){
	for (i=1;i<=25;i++){
		celdas[i]=0;
		td = document.getElementById('td'+i);
		td.style.backgroundColor = colors[0];
		td = document.getElementById('ptd'+i);
		td.style.backgroundColor = colors[0];
	}
}

function invert(){
	for (i=1;i<=25;i++) switchTD(i);
}

function nuevoIcono(){
		$("#limpiar").removeAttr("disabled");
		$("#invertir").removeAttr("disabled");
		clearICO();
		$("#publicarIcono").slideDown("normal");
		$("#resultado").remove();
		$("#submit").show();
		$("#nombre").val('');
		panelActivo = true;	
}