// JavaScript Document

function switchlang() {
    var pathname = location.pathname;
    var filename = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length);
    filename="/index.htm"
	location=filename
	
}

function switchlangjt() {
    var pathname = location.pathname;
    var filename = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length);
    filename="/gb/index.htm"
	location=filename
	
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 fwLoadMenus() {  
/*
window.fw_menu_3 = new Menu("root",200,28,"Verdana, Arial, Helvetica, sans-serif",ptmuenfontsize,"#ffffff","#e0e0c2","#336699","#003366");
  fw_menu_3.addMenuItem("Cria&ccedil;&atilde;o do Minist&eacute;rio P&uacute;blico","location='bygk/book1.htm'");
  fw_menu_3.addMenuItem("Natureza Estatuto","location='bygk/book2.htm'");
  fw_menu_3.addMenuItem("Atribui&ccedil;&otilde;es e Compet&ecirc;ncias","location='bygk/book3.htm'");
  fw_menu_3.addMenuItem("Modelo de Funcionamento","location='bygk/book4.htm'");
  fw_menu_3.addMenuItem("Gabinete do Procurador","location='bygk/book5.htm'");
  fw_menu_3.addMenuItem("Composi&ccedil;&atilde;o do Pessoal","location='bygk/book6.htm'");
  fw_menu_3.addMenuItem("Conselho dos Magistrados","location='bygk/book7.htm'");
  fw_menu_3.fontWeight="plain";
  fw_menu_3.hideOnMouseOut=true; 
 window.fw_menu_4 = new Menu("root",270,28,"Verdana, Arial, Helvetica, sans-serif",ptmuenfontsize,"#ffffff","#e0e0c2","#336699","#003366");
  fw_menu_4.addMenuItem("Penas Para Crimes Mais T&iacute;picos","location='question/question1m.htm'");
  fw_menu_4.addMenuItem("Medidas De Coac&ccedil;&atilde;o E Penas","location='question/question2m.htm'");
  fw_menu_4.addMenuItem("As Fases Essenciais Do Processo Penal","location='question/question3m.htm'");
  fw_menu_4.addMenuItem("Os Direitos E Deveres Das Testemunhas <br>No Processo Penal","location='question/question4m.htm'");
  fw_menu_4.fontWeight="plain";
*/
 
 
  window.fw_menu_3 = new Menu("root",200,28,"Verdana, Arial, Helvetica, sans-serif",ptmuenfontsize,"#ffffff","#e0e0c2","#336699","#003366");
  fw_menu_3.addMenuItem("Cria&ccedil;&atilde;o do Minist&eacute;rio P&uacute;blico","location='/pt/intro/bookindex1.htm'");
  fw_menu_3.addMenuItem("Natureza Estatuto","location='/pt/intro/bookindex2.htm'");
  fw_menu_3.addMenuItem("Atribui&ccedil;&otilde;es e Compet&ecirc;ncias","location='/pt/intro/bookindex3.htm'");
  fw_menu_3.addMenuItem("Modelo de Funcionamento","location='/pt/intro/bookindex4.htm'");
  fw_menu_3.addMenuItem("Gabinete do Procurador","location='/pt/intro/bookindex5.htm'");
  fw_menu_3.addMenuItem("Composi&ccedil;&atilde;o do Pessoal","location='/pt/intro/bookindex6.htm'");
  fw_menu_3.addMenuItem("Conselho dos Magistrados","location='/pt/intro/bookindex7.htm'");
  fw_menu_3.fontWeight="plain";
  fw_menu_3.hideOnMouseOut=true;
 window.fw_menu_4 = new Menu("root",270,28,"Verdana, Arial, Helvetica, sans-serif",ptmuenfontsize,"#ffffff","#e0e0c2","#336699","#003366");
  fw_menu_4.addMenuItem("Penas Para Crimes Mais T&iacute;picos","location='/pt/question/question1m.htm'");
  fw_menu_4.addMenuItem("Medidas de Coac&ccedil;&atilde;o e Penas","location='/pt/question/question2m.htm'");
  fw_menu_4.addMenuItem("As Fases Essenciais do Processo Penal","location='/pt/question/question3m.htm'");
  fw_menu_4.addMenuItem("Os Direitos e Deveres das Testemunhas no Processo Penal","location='/pt/question/question4m.htm'");
  fw_menu_4.fontWeight="plain";
  fw_menu_4.hideOnMouseOut=true;
  fw_menu_4.writeMenus();
} // fwLoadMenus()

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
} 

   
  function popWin(image,w,h) {
    var win=window.open( image, "", "width=" + w + ",height=" + h);
  }
  
  function repChar(){	
var str0=window.document.formsunxiao.searWords0.value;
str0=str0.replace(/Á/g, "&Aacute;");
str0=str0.replace(/á/g, "&aacute;");
str0=str0.replace(/À/g, "&Agrave;");
str0=str0.replace(/à/g, "&agrave;");
str0=str0.replace(/Â/g, "&Acirc;");
str0=str0.replace(/â/g, "&acirc;");
str0=str0.replace(/Ä/g, "&Auml;");
str0=str0.replace(/ä/g, "&auml;");
str0=str0.replace(/Ã/g, "&Atilde;");
str0=str0.replace(/ã/g, "&atilde;");
str0=str0.replace(/Å/g, "&Aring;");
str0=str0.replace(/å/g, "&aring;");
str0=str0.replace(/Æ/g, "&AElig;");
str0=str0.replace(/æ/g, "&aelig;");
str0=str0.replace(/Ç/g, "&Ccedil;");
str0=str0.replace(/ç/g, "&ccedil;");
str0=str0.replace(/Ð/g, "&ETH;");
str0=str0.replace(/ð/g, "&eth;");
str0=str0.replace(/É/g, "&Eacute;");
str0=str0.replace(/é/g, "&eacute;");
str0=str0.replace(/È/g, "&Egrave;");
str0=str0.replace(/è/g, "&egrave;");
str0=str0.replace(/Ê/g, "&Ecirc;");
str0=str0.replace(/ê/g, "&ecirc;");
str0=str0.replace(/Ë/g, "&Euml;");
str0=str0.replace(/ë/g, "&euml;");
str0=str0.replace(/Í/g, "&Iacute;");
str0=str0.replace(/í/g, "&iacute;");
str0=str0.replace(/Ì/g, "&Igrave;");
str0=str0.replace(/ì/g, "&igrave;");
str0=str0.replace(/Î/g, "&Icirc;");
str0=str0.replace(/î/g, "&icirc;");
str0=str0.replace(/Ï/g, "&Iuml;");
str0=str0.replace(/ï/g, "&iuml;");
str0=str0.replace(/Ñ/g, "&Ntilde;");
str0=str0.replace(/ñ/g, "&ntilde;");
str0=str0.replace(/Ó/g, "&Oacute;");
str0=str0.replace(/ó/g, "&oacute;");
str0=str0.replace(/Ò/g, "&Ograve;");
str0=str0.replace(/ò/g, "&ograve;");
str0=str0.replace(/Ô/g, "&Ocirc;");
str0=str0.replace(/ô/g, "&ocirc;");
str0=str0.replace(/Ö/g, "&Ouml;");
str0=str0.replace(/ö/g, "&ouml;");
str0=str0.replace(/Õ/g, "&Otilde;");
str0=str0.replace(/õ/g, "&otilde;");
str0=str0.replace(/Ø/g, "&Oslash;");
str0=str0.replace(/ø/g, "&oslash;");
str0=str0.replace(/ß/g, "&szlig;");
str0=str0.replace(/Þ/g, "&THORN;");
str0=str0.replace(/þ/g, "&thorn;");
str0=str0.replace(/Ú/g, "&Uacute;");
str0=str0.replace(/ú/g, "&uacute;");
str0=str0.replace(/Ù/g, "&Ugrave;");
str0=str0.replace(/ù/g, "&ugrave;");
str0=str0.replace(/Û/g, "&Ucirc;");
str0=str0.replace(/û/g, "&ucirc;");
str0=str0.replace(/Ü/g, "&Uuml;");
str0=str0.replace(/ü/g, "&uuml;");
str0=str0.replace(/Ý/g, "&Yacute;");
str0=str0.replace(/ý/g, "&yacute;");
str0=str0.replace(/ÿ/g, "&yuml;");

window.document.formsunxiao.searWords.value=str0;  	  
}
  
  function checkformsunxiao(){ 
   var str=window.document.formsunxiao.sw.value;
  if (str=="" || str==null){
  alert("Inquire the condition can't be empty.");
  document.formsunxiao.sw.focus();
  }else{
  //repChar();
  //window.document.formsunxiao.searWords.value=str;  	
  window.document.formsunxiao.submit();
  }	  
  }
  



