function submenu(id,valor){
	
	if($(id)){
	 valor1 = document.getElementById('menu').offsetLeft
	 posicao = (valor1+valor);
	 document.getElementById(id).style.left = posicao+"px";
	 document.getElementById(id).style.visibility='visible';
	} 
}

function some_submenu(id){
	if($(id)){
	 document.getElementById(id).style.visibility='hidden';
	} 
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function mudaimg(id,novo){
	document.getElementById(id).src="images/"+novo+".jpg";
}

function mudarImagen(id,novo){
	document.getElementById(id).src= novo;
}

function movemenuL(){
	document.getElementById('estagios_sub').scrollLeft = document.getElementById('estagios_sub').scrollLeft -1;
	tt = setTimeout(movemenuL,1)
}

function movemenuR(){
	document.getElementById('estagios_sub').scrollLeft = document.getElementById('estagios_sub').scrollLeft  +1;
	tt = setTimeout(movemenuR,1)
}

function paramenu(){
	clearTimeout(tt)
}

function disable_outros(){
	if(document.getElementById('outros').checked == true){
		document.getElementById('quais_outros').disabled = false;
	}else{
		document.getElementById('quais_outros').disabled = true;
		
	}
}

function disable_facu(){
	if(document.getElementById('faz_facu').checked == true){
		document.getElementById('periodo_universidade').disabled = false;
		document.getElementById('universidade').disabled = false;
		document.getElementById('universidade').alt = 'Qual?';
		document.getElementById('periodo_universidade').alt = 'Período';
		
	}else{
		document.getElementById('periodo_universidade').disabled = true;
		document.getElementById('universidade').disabled = true;
		document.getElementById('universidade').alt = '';
		document.getElementById('periodo_universidade').alt = '';
	}
}
function flash(widht,height,swf,wmode){
	document.writeln('     <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" WIDTH="'+widht+'" HEIGHT="'+height+'" ALIGN="">');
	document.writeln('       <PARAM NAME="movie" VALUE="'+swf+'">');
	document.writeln('       <PARAM NAME="quality" VALUE="high">');
	document.writeln('       <PARAM NAME="wmode" VALUE="'+wmode+'">');
	document.writeln('       <PARAM NAME="bgcolor" VALUE="#FFFFFF">');
	document.writeln('      <EMBED src="'+swf+'" quality="high" wmode="'+wmode+'" bgcolor="#FFFFFF"  WIDTH="'+widht+'" HEIGHT="'+height+'" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	document.writeln('     </OBJECT>');
}


function selList(list,valor){

	for(a=0;a<list.options.length;a++){

		if(list.options[a].value == valor) {

			list.options[a].selected=true;

			break;

		}

	}

}
function updateCharCount(textareaId, spanId, maxSize) {
	textarea = document.getElementById(textareaId);
	if (textarea == null) {
		return;
	}
	if (textarea.value.length > maxSize) {
		textarea.value = textarea.value.substring(0, maxSize);
	}
	document.getElementById(spanId).innerHTML = maxSize - textarea.value.length;
}
