// JavaScript Document

function mark(face,field_color,text_color) {
	if (document.documentElement); //if browser is IE5+ or NS6+
	{
		face.style.backgroundColor=field_color;
		face.style.color=text_color;
	}
}

ok=false;
function CheckAll() {
	if(!ok){
	  	for (var i=0;i<document.form1.elements.length;i++) {
	    	var x = document.form1.elements[i];
	    	if (x.name == 'checkbox[]') {
		    	x.checked = true;
				ok=true;
			}
	    }
	} else {
		for (var i=0;i<document.form1.elements.length;i++) {
	    	var x = document.form1.elements[i];
	    	if (x.name == 'checkbox[]') {
		    	x.checked = false;
				ok=false;
			}
	    }
	}
}

function popup(caminho,nome,largura,altura,rolagem) {
	var esquerda = (screen.width - largura) / 2;
	var cima = (screen.height - altura) / 2 -50;
	janela = window.open(caminho,nome,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + rolagem + ',resizable=no,copyhistory=no,top=' + cima + ',left=' + esquerda + ',width=' + largura + ',height=' + altura);
}

//+ fotos

function Toggle(item) {
	var obj;
	if ( document.getElementById ) 
   	{
		obj=document.getElementById(item);
	} else {
		obj = document.all[item];
	}
	var key;
   	if ( document.getElementById ) 
   	{
		key=document.getElementById("x" + item);
	} else {
		key = document.all['x' +item];
	}	

	if (obj != undefined) {
		var visible = ( obj.style.display != 'none');
		if (visible) {
			obj.style.display="none";
		} else {
			obj.style.display="block";
		}
	}
}
