// JavaScript Document
<!--
function encode_utf8(rohtext) {
	rohtext = rohtext.replace(/\r\n/g,"\n");
	var utftext = "";
	for(var n=0; n<rohtext.length; n++){
		var c=rohtext.charCodeAt(n);
		if (c<128)
			utftext += String.fromCharCode(c);
		else if((c>127) && (c<2048)) {
			utftext += String.fromCharCode((c>>6)|192);
			utftext += String.fromCharCode((c&63)|128);}
		else {
			utftext += String.fromCharCode((c>>12)|224);
			utftext += String.fromCharCode(((c>>6)&63)|128);
			utftext += String.fromCharCode((c&63)|128);}
		}
	return utftext;
}
function clear1(form){
	if(form.q.value == "Busca rápida "){
		form.q.value ="";
	}
}
function submit_search(form){
	alert (form);
	/*var valor = form.q.value; 
	var valor = encode_utf8(valor);*/
	
	if(form.q.value == ""){
		form.q.focus();
	}/*else{
		if(form.rd[0].checked == true){
			form.method = "GET";
			form.action = "/busca/search.php";
			form.submit();
		}else{
			window.open("http://www.google.com.br/search?q="+valor,"busca")
		}
	}*/
}

//navegador1
function navegue(url){
	if(url == "0"){
		void[0];
	}else{
		document.location = url;
	}
}

//pop1
function pop1(url,nome,w,h){
	window.open(url,nome,"width="+w+" height="+h+" menubar=yes")
}

//valida1
function valida1(form){
	for (var i = 0; i < form.elements.length; i++) {
 		if (form.elements[i].type != "submit" && form.elements[i].type != "reset" && form.elements[i].type != "button"){
			if (form.elements[i].valida == "y" && form.elements[i].value == ""){
				form.elements[i].focus();
				return false;
			}
		}	
	}
}

//pop da integração antigo x novo
function pop2(tipo,sid){
		
		if(tipo == "aluno"){
			
			window.open("v1sy/_exec_aluno.php?sid="+sid,"v1sy","width=798,height=430,toolbar=yes,menubar=yes,location=no,resizable=yes,scrollbars=yes,status=yes")
			//alert("janela do aluno");
			
		}else if(tipo == "responsavel"){
			
			window.open("v1sy/_exec_responsavel.php?sid="+sid,"v1sy","width=798,height=430,toolbar=yes,menubar=yes,location=no,resizable=no,scrollbars=yes,status=yes");
			//alert("janela do responsável");
			
		}
}


//variaveis e funções do calendario
var ult;

function lit(cod){
	//Limpa
	if(ult !== undefined){
		document.getElementById(ult).style.padding="";
		document.getElementById(ult).style.border="";
	}

	//Destaca
	document.getElementById(cod).style.padding="2px";
	document.getElementById(cod).style.border="1px solid #F58735";
	
	//direciona na página
	window.location = "#anc"+cod;
		
	ult = cod;
}
//fim do calendário

//valida FALE CONOSCO

function valida_contato(form){
	for (var i = 0; i < form.elements.length; i++) {
 		if (form.elements[i].type != "submit" && form.elements[i].type != "reset" && form.elements[i].type != "button"){
			if (form.elements[i].valida == "y" && form.elements[i].value == ""){
				form.elements[i].focus();
				return false;
			}
		}	
	}
}
//fim do valida

//pop3
function pop3(url,nome,w,h){
	window.open(url,nome,"width="+w+",height="+h)
}
//

// abre janela maximizada
function ver_print(url,janela,scroll){
W = eval(screen.width)-10;
H = eval(screen.height)-54;

window.open(url,janela,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,copyhistory=no,width="+W+",height="+H+",top=0,left=0");
}

function data(){
   hoje=new Date();
   data=""+hoje.getDate()+"/"+(hoje.getMonth()+1)+"/"+hoje.getYear();
   document.write(data);
}

function abrir(url,janela,scroll){
W = eval(screen.width)-10;
H = eval(screen.height)-54;

window.open(url,janela,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,copyhistory=no,width="+W+",height="+H+",top=0,left=0");
}

