// ezzato Javascript funcions
// version: 1.0
// feb 2007

t_nxt=0;
st_nxt=0;
sp_nxt=0;
b_nxt=0;
pc_nxt = 0;

// ---------------------------------------------------------------------------------------
// defaultfuncions
// ---------------------------------------------------------------------------------------

function popup(fileName,windowName,windowScrolling,windowWidth,windowHeight) {
	//
	window.open (fileName,windowName,"toolbar=no,left=50,location=no,directories=no,status=no,menubar=no,scrollbars="+windowScrolling+",resizable=no,copyhistory=no,width="+windowWidth+",height="+windowHeight+"");
	//
}

function trace(param) {
	
	alert(param);
	
}

// ---------------------------------------------------------------------------------------
//  specific functions
// ---------------------------------------------------------------------------------------

function splasher(myWidth , myHeight , banners , speed , roundness) {
	
	detectFlash( '../flash/splasher.swf' , myWidth , myHeight , '#ffffff' , 'high' , 'transparent' , 'flash_splash'+sp_nxt,'fv_banners='+banners+'&fv_speed='+speed+'&fv_roundness='+roundness);
	sp_nxt++;
	
}

function verificaContato()
{    	 	
	pw1 = document.form.email.value.toUpperCase();
	pw2 = document.form.confemail.value.toUpperCase();
	
 	if (document.form.nome.value=='')
 	{
		window.alert("Informe o seu nome.");
		document.form.nome.focus();
   		return false;
 	}
 	
 	if (document.form.email.value=='')
 	{
		window.alert("Informe o seu email.");
		document.form.email.focus();
   		return false;
 	}  
 	else
 	{
	
	
 	    if (!(Email(document.form.email.value)))
 	    {
		    window.alert("Informe o seu email corretamente.");
		    document.form.email.focus();
   		    return false;
 	    }
		else
	{	if (pw1 != pw2)
	{
		window.alert("Email não confere!")
		document.form.confemail.value = '';
		document.form.confemail.focus();
			return false;
	}
	
	}
 	}
	
	if (document.form.ddd_fone.value=='')
 	{
		window.alert("Informe o DDD do seu telefone.");
		document.form.ddd_fone.focus();
   		return false;
 	}
 	
 	if (document.form.fone.value=='')
 	{
		window.alert("Informe o seu telefone.");
		document.form.fone.focus();
   		return false;
 	}
}

function verificaInscricao()
{    	 	
 	if (document.form.empresa.value=='')
 	{
		window.alert("Informe o nome da empresa.");
		document.form.empresa.focus();
   		return false;
 	}
 	
 	if (document.form.cnpj.value=='')
 	{
		window.alert("Informe o CNPJ da empresa.");
		document.form.cnpj.focus();
   		return false;
 	}
 	
 	if (document.form.ie.value=='')
 	{
		window.alert("Informe a Inscrição Estadual da empresa.");
		document.form.ie.focus();
   		return false;
 	}
 	
 	if (document.form.nome.value=='')
 	{
		window.alert("Informe o nome do participante.");
		document.form.nome.focus();
   		return false;
 	}
 	
 	if (document.form.endereco.value=='')
 	{
		window.alert("Informe o endereço comercial do participante.");
		document.form.endereco.focus();
   		return false;
 	}
 	
 	if (document.form.cep.value=='')
 	{
		window.alert("Informe o cep do endereço comercial do participante.");
		document.form.cep.focus();
   		return false;
 	}
 	
 	if (document.form.cidade.value=='')
 	{
		window.alert("Informe a cidade do endereço comercial do participante.");
		document.form.cidade.focus();
   		return false;
 	}
 	
 	if (document.form.uf.value=='')
 	{
		window.alert("Informe a UF do endereço comercial do participante.");
		document.form.uf.focus();
   		return false;
 	}
 	
 	if (document.form.ddd_fone.value=='')
 	{
		window.alert("Informe o DDD do telefone do participante.");
		document.form.ddd_fone.focus();
   		return false;
 	}
 	
 	if (document.form.fone.value=='')
 	{
		window.alert("Informe o telefone do participante.");
		document.form.fone.focus();
   		return false;
 	}
 	
 	if (document.form.ddd_fax.value=='')
 	{
		window.alert("Informe o DDD do fax do participante.");
		document.form.ddd_fax.focus();
   		return false;
 	}
 	
 	if (document.form.fax.value=='')
 	{
		window.alert("Informe o fax do participante.");
		document.form.fax.focus();
   		return false;
 	}
 	
 	if (document.form.email.value=='')
 	{
		window.alert("Informe o email do participante.");
		document.form.email.focus();
   		return false;
 	}  
 	else
 	{
 	    if (!(Email(document.form.email.value)))
 	    {
		    window.alert("Informe o email corretamente.");
		    document.form.email.focus();
   		    return false;
 	    }
 	}
 	
 	if (document.form.responsavel.value=='')
 	{
		window.alert("Informe o nome do responsável pela inscrição.");
		document.form.responsavel.focus();
   		return false;
 	}
 	
 	if (document.form.valor_deposito.value=='')
 	{
		window.alert("Informe o Valor Total do depósito identificado.");
		document.form.valor_deposito.focus();
   		return false;
 	}
 	
 	
 	if (!(checkRadios(document.form.categoria)))
 	{
		    window.alert("Selecione a Categoria.");
		    return false;
 	}
 	
}

function checkRadios(campo) 
{
    var radiogroup = campo;
    var itemchecked = false;
    for(var j = 0 ; j < radiogroup.length ; ++j) 
    {
        if(radiogroup[j].checked) 
        {
            itemchecked = true;
            break;
        }
    }

    if(!itemchecked) 
    { 
        return false;
    }        
    return true;
}




email="qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM@0123456789-_.";
function Email(campo)
{
	str_email=campo;
	tamanho=campo.length-1;
	for (var i=0;i<=str_email.length;i++)
   	{
		if (email.indexOf(str_email.charAt(i))<0)
      	{
			return false;
      	}
  	}
	if (campo.indexOf(".")==0||campo.indexOf("@")==0||campo.indexOf("@")==tamanho||campo.indexOf(".")==tamanho)
   	{
		return false;
  	}
	if (campo.indexOf(".")<0||campo.indexOf("@")<0)
   	{
		return false;
	}
	if (campo.indexOf(".com")<0 && campo.indexOf(".net")<0&& campo.indexOf(".br")<0&& campo.indexOf(".org")<0&& campo.indexOf(".gov")<0)
   	{
		return false;
  	}
	posicao_antes=campo.indexOf("@");
	posicao_antes=posicao_antes-1;
	posicao_depois=campo.indexOf("@");
	posicao_depois=posicao_depois+1;
	if (campo.indexOf(".")==posicao_antes||campo.indexOf(".")==posicao_depois)
   	{
		return false;
  	}
	return true;
}

//
//
function xmlMicoxLoader(url)
{     
    
    if(window.XMLHttpRequest)
    {        
        var Loader = new XMLHttpRequest();        
        Loader.open("GET", url ,false);       
        Loader.send(null);    
        return Loader.responseXML;      
		

     }
     else if(window.ActiveXObject)
     {        
        var Loader = new ActiveXObject("Msxml2.DOMDocument.3.0");        
        Loader.async = false;        
        Loader.load(url);        
        return Loader; 

    }     
     
}

//
function assembleMenu(area,subArea) {
	
	var ar_area = new Array();
	ar_area[0] = ["Mensagem da Coordenação", "index.php","",[]];
	ar_area[1] = ["O que aconteceu em  2008", "congress2008.php","",[["Depoimentos", "congress2008.php"], ["Patrocinadores de 2008", "congress2008_3.php"]]];
	ar_area[2] = ["Palestrantes", "speakers.php","",[]];
	ar_area[3] = ["Grade de  programação", "program_1.php","",[["Congresso", "program_1.php"], ["Cursos", "program.php"]]];
	ar_area[4] = ["Faça sua Inscrição", "inscription.php", "",[["Ficha de Inscrição", "inscription.php"], ["Investimentos", "inscription_1.php"]]];
	ar_area[5] = ["Localização", "localization.php","",[["Mapa","localization.php"],["Passagem e Hospedagem","localization_1.php"]]];
	ar_area[6] = ["Expo Qualidade de Vida", "event.php","",[["Expositores", "event.php"],["Investimento", "event1.php"]]];
    ar_area[7] = ["Contato", "contact.php","",[["Fale Conosco","contact.php"],["Imprensa","contact_1.php"]]];

	//
	var currentArea = area;
	var currentSubArea = subArea;
	//
	document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%">');

	
	//
	for (var i = 0; i<ar_area.length; i++) {
		//
		//if (ar_area[i][3].length >2) {
			//var line_space = 50 + ((ar_area[i][3].length-2)*20)
			
		//} else {
		var line_space = 60;			
		//}
		//document.write('<tr height="'+line_space+'"><td width="25" ></td>');
		document.write('<tr><td width="25" ></td>');
		//
		if (i == currentArea) {
			document.write('<td class="menu_text_selected"><div style="position:relative; top: 0px; left: 0px; width: 100%; z-index:2;"><a href="'+ar_area[i][1]+'" class="menu_text_selected">'+ar_area[i][0]+'</a>');
		} else {
			document.write('<td class="menu_text"><div style="position:relative; top: 0px; left: 0px; width: 100%;  z-index:2;" onMouseOver="showHideLayer(dv_menu'+i+', 1)" onMouseOut="showHideLayer(dv_menu'+i+', 0)"><a href="'+ar_area[i][1]+'" class="menu_text" >'+ar_area[i][0]+'</a>');
		}
		
		
		document.write('<div name="dv_menu'+i+'" id="dv_menu'+i+'" style="visibility:hidden; position:relative; top: 00px; left: 0px; width: 100%; z-index:1;">'
  		+ '      <table width="100%" border="0" cellspacing="0" cellpadding="0">'
  		+ '        <tr>'
  		+ '          <td >');
		
		if (ar_area[i][3].length >0) {
			//document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="6"><img src="../images/layout/spacer.gif" width="1" height="1"></td></tr>');
			
			
			for (var j = 0; j<ar_area[i][3].length; j++) {
	
					if (i == currentArea) {
						if (j == currentSubArea) {
							document.write('<tr><td class="subMenu_text"><a href="'+ar_area[i][3][j][1]+'" class="subMenu_text_selected">'+ar_area[i][3][j][0]+'</a></td></tr>');
						} else {
							document.write('<tr><td class="subMenu_text" ><a href="'+ar_area[i][3][j][1]+'" class="subMenu_text">'+ar_area[i][3][j][0]+'</a></td></tr>');
						}
						
					} else {
						document.write('<tr><td class="subMenu_text"><a href="'+ar_area[i][3][j][1]+'" class="subMenu_text">'+ar_area[i][3][j][0]+'</a></td></tr>');
					}
					if (j<ar_area[i][3].length-1) {
						//document.write('<td height="3"><img src="../images/layout/spacer.gif" width="1" height="1"></td>');
					}
				
			}
			//document.write('</table>');
		} else {
			document.write('<tr>'
			+ '          <td height="22"><img src="../images/layout/spacer.gif" width="1" height="22"></td>'
			+ '        </tr>');
		}
		
		//detail
		document.write('</td>'
 		+ '        </tr>'
		+ '        <tr>'
		+ '          <td height="6"><img src="../images/layout/spacer.gif" width="1" height="1"></td>'
		+ '        </tr>'
		//+ '        <tr>'
		//+ '          <td height="1" bgcolor="FAC28F"></td>'
		//+ '        </tr>'
		+ '      </table>'
		+ '    </div></div></td>');
		
		
		
		
		//if(i <ar_area.length-1) {
			//document.write('<td width="13" class="menu_text" align="center" valign="top">|</td>');
		//}
		//
		
		//                                
		document.write('  </tr>');
	}

	
	 document.write('</table>');
	//
	for (var i = 0; i<ar_area.length; i++) {
		
		if (i == currentArea) {
			var dive = "dv_menu"+i;
			var t=setTimeout("showHideLayer(dv_menu"+i+",1)",1);
		}
		
	}
	//
}




//
//
//
function assembleCombo(file,current,wd) {
	//
	var myFile = file;
	xmlDoc = xmlMicoxLoader(myFile);

	//
	var objNodeList = xmlDoc.getElementsByTagName("subArea");
	var objNode = objNodeList[0];
	//
	//
	var ar_area = new Array();
	//
	//
	for (var i = 0; i<objNodeList.length; i++) {
		//
		var z = objNodeList[i].getElementsByTagName("subArea");
		//alert(objNodeList[i].getAttribute('year'))
		//
		//
		//
		ar_area.push([objNodeList[i].getAttribute('title'), objNodeList[i].getAttribute('link')]);
		//
	}
	//
	var ar_register = ar_area
	var combo_width = wd;
	//

	
	document.write('<table border="0" cellspacing="0" cellpadding="0"><tr><td><div onMouseOver="showHideLayer(dv_combo, 1)" onMouseOut="showHideLayer(dv_combo, 0)" style="position:relative; z-index:10;">');
	document.write('<div id="dv_combo" name="dv_combo" style="visibility:hidden; position:absolute; top: 22px; left: 0px; width: 100%; height: 200px;overflow:auto;'
+ '  				   scrollbar-3dlight-color:#AACB34; '
+ '  scrollbar-arrow-color:#ffffff; '
+ '  scrollbar-base-color:#AACB34; '
+ '  scrollbar-darkshadow-color:#AACB34; '
+ '  scrollbar-face-color:#AACB34; '
+ '  scrollbar-highlight-color:#AACB34;' 
+ '  scrollbar-shadow-color:#AACB34; '
+ '  scrollbar-track-color:#C6DF82;">');
	
	
	document.write('<table border="0" cellpadding="0" cellspacing="0" background="../images/layout/tb_clr_1.jpg">'
    + '  <tr>'
    + '    <td><table  border="0" cellpadding="1" cellspacing="1">');
	
	
	for(var i =0;i<ar_register.length;i++) {
		
		//
		document.write('      <tr>'
 		 + '        <td width="'+combo_width+'" bgcolor="#FFFFFF" height="18" onMouseOver="this.bgColor=\'#D2E49C\'" onMouseOut="this.bgColor=\'#ffffff\'">&nbsp;&nbsp;<a href="'+ar_register[i][1]+'" class="list_menu">'+ar_register[i][0]+'</a>&nbsp;&nbsp;</td>'
  		+ '      </tr>');
		//
	}
	
	document.write('    </table></td>'
    + '  </tr>'
    + '</table>');
	
	document.write('</div>');
    document.write('<table width="'+combo_width+'" border="0" cellspacing="0" cellpadding="0">'
  + '                        <tr>'
  + '                          <td width="1" height="1" background="../images/layout/tb_clr_1.jpg"></td>'
  + '                          <td background="../images/layout/tb_clr_1.jpg"></td>'
  + '                          <td width="1" background="../images/layout/tb_clr_1.jpg"></td>'
  + '                        </tr>'
  + '                        <tr>'
  + '                          <td background="../images/layout/tb_clr_1.jpg"></td>'
  + '                          <td><table border="0" cellspacing="0" cellpadding="0" width="100%">'
  + '                              <tr>'
  + '                                <td width="8" height="3"></td>'
  + '                                <td></td>'
  + '                                <td width="5"></td>'
  + '                              </tr>'
  + '                              <tr>'
  + '                                <td></td>'
  + '                                <td><table  width="100%" border="0" cellspacing="0" cellpadding="0">'
  + '                                    <tr>');
	
  document.write('                    	 <td class="list_menu">'+ar_register[current][0]+'</td>'
  + '                                      <td width="10"></td>'
  + '                                      <td align="right"><img src="../images/layout/combo_arrow.jpg" width="16" height="14"></td>'
  + '                                    </tr>'
  + '                                </table></td>'
  + '                                <td></td>'
  + '                              </tr>'
  + '                              <tr>'
  + '                                <td height="3"></td>'
  + '                                <td></td>'
  + '                                <td></td>'
  + '                              </tr>'
  + '                          </table></td>'
  + '                          <td background="../images/layout/tb_clr_1.jpg"></td>'
  + '                        </tr>'
  + '                        <tr>'
  + '                          <td height="1" background="../images/layout/tb_clr_1.jpg"></td>'
  + '                          <td background="../images/layout/tb_clr_1.jpg"></td>'
  + '                          <td background="../images/layout/tb_clr_1.jpg"></td>'
  + '                        </tr>'
  + '                      </table>'
  + '                    </div></td></tr></table>');
}

//

//
function showHideLayer(object, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[object].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(object);
        object.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[object].style.visibility = iState ? "visible" : "hidden";
    }
}
//
//
function navigate(area, sub) {
	//
	//
	if (sub == undefined) {
		var myURL = ar_area[area][1];
		//
		if (ar_area[area][2] != undefined) {
			var myTarget = ar_area[area][2];
		}
		//                
	} else {
		var myURL = ar_area[area][3][sub][1];
		//
		if (ar_area[area][3][sub][2] != undefined) {
			var myTarget = ar_area[area][3][sub][2];
		}
		//               
	}
	//
	if (myTarget == undefined) {
		getURL(myURL);
	} else {
		getURL(myURL, myTarget);
	}
	//
}


function splasher(myWidth , myHeight , banners , speed) {

	
	//var banners = "../images/ads/splash01.jpg;page_1_3.asp;Transparência, Qualidade<br>e Agilidade Sempre;r|../images/ads/splash02.jpg;page_1_3.asp;Foco Total no<br>Ponto de Venda;r|../images/ads/splash03.jpg;page_1_3.asp;Excelência em<br>Merchandising;r|../images/ads/splash04.jpg;page_1_3.asp;Equipe Treinada<br>Significa Bons Resultados;r|../images/ads/splash05.jpg;page_1_3.asp;Comprometimento<br>com os Objetivos;c|../images/ads/splash06.jpg;page_1_3.asp;Soluções<br>Personalizadas em RH;l|../images/ads/splash07.jpg;page_1_3.asp;Terceirização Sob Medida<br>Para Cada Cliente;l"
	//var speed = 6 ;// seconds
	//var myWidth = '100%';
	//var myHeight = '170';
	
	detectFlash( '../flash/splasher.swf' , myWidth , "100%" , '#ED1C24' , 'high' , 'opaque' , 'flash_splash'+sp_nxt,'fv_banners='+banners+'&fv_speed='+speed);
	sp_nxt++;
}


function createTittle(tittle_text,tittle_color) {

	var givenName = "flashTit"+t_nxt;
	var myStartWidth = 100;
	var myStartHeight = 42;
	
 	document.writeln('<table width="'+myStartWidth+'" height="'+myStartHeight+'" name="td_'+givenName+'" id="td_'+givenName+'" border="0" cellspacing="0" cellpadding="0"><tr><td>');
	document.writeln('<script>detectFlash( "../flash/title.swf",  width="100%", height="42", "ffffff", "high", "transparent", "'+givenName+'", "objectName='+givenName+'&myTittle='+tittle_text+'&myColor='+tittle_color+'");</script>');
	document.writeln('</td></tr></table>');
	t_nxt++;
	
	
}

// ---------------------------------------------------------------------------------------
//  fireworks over behaviors
// ---------------------------------------------------------------------------------------


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 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_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];}
}



// ---------------------------------------------------------------------------------------
// flash detect
// ---------------------------------------------------------------------------------------


// initialize global variables

var detectableWithVB = false;
var pluginFound = false;
var MinimalVersion= 8;

// functions

function redirectCheck(pluginVersion, pluginFound, SWF_NAME, SWF_WIDTH, SWF_HEIGHT, SWF_BGCOLOR, SWF_QUALITY, SWF_WMODE, SWF_ID, SWF_VARS) {
	
	if( pluginFound ) {
		// Verify version
		if(pluginVersion >= MinimalVersion) {

			var myVars = SWF_VARS+"&object_id="+SWF_ID;

			document.writeln('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" VIEWASTEXT id='+SWF_ID+' name='+SWF_ID+' width="'+ SWF_WIDTH +'" height="'+ SWF_HEIGHT +'" wmode="'+SWF_WMODE+' swLiveConnect="TRUE" showMenu="false">');
			document.writeln('<PARAM NAME=movie VALUE="'+SWF_NAME+'" >');
			document.writeln('<PARAM NAME=FlashVars VALUE="'+myVars+'">');
			document.writeln('<PARAM NAME=quality VALUE="'+SWF_QUALITY+'">');
			document.writeln('<PARAM NAME="wmode" VALUE="'+SWF_WMODE+'" >');
			document.writeln('<PARAM NAME="showMenu" VALUE="false">');
			document.writeln('<PARAM NAME="bgcolor" value="'+SWF_BGCOLOR+'">'); 
			document.writeln('<EMBED src="' + SWF_NAME + '" showMenu="false" name="'+SWF_ID+'" FlashVars="'+myVars+'" swLiveConnect="TRUE" width="'+ SWF_WIDTH +'" height="'+ SWF_HEIGHT +'" type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" bgcolor="' + SWF_BGCOLOR + '" quality="' + SWF_QUALITY + '" wmode="'+SWF_WMODE+'"></EMBED>');
			document.writeln('</OBJECT>');
			
		} else {

			noFlashFound();
		}
		
    } else {

		noFlashFound();
    }	
}

function detectFlash( SWF_NAME, SWF_WIDTH, SWF_HEIGHT, SWF_BGCOLOR, SWF_QUALITY, SWF_WMODE, SWF_ID, SWF_VARS) {
    pluginFound = detectPlugin('Shockwave','Flash'); 

    // if not found, try to detect with VisualBasic
    if( !pluginFound && detectableWithVB ) {
		pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.' + versionFlash() );
    }
	pluginVersion = versionFlash();
    // check for redirection
    return redirectCheck(pluginVersion, pluginFound, SWF_NAME, SWF_WIDTH, SWF_HEIGHT, SWF_BGCOLOR, SWF_QUALITY, SWF_WMODE, SWF_ID, SWF_VARS);
}

function versionFlash() {
	var sAux = 8;
	
	for( i = 10; i > 2; i-- ) {
		
		pluginFound = detectPlugin('Shockwave Flash ' + i); 		
		// if not found, try to detect with VisualBasic
		if(!pluginFound && detectableWithVB) {
			pluginFound = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.' + i);
		}
		if ( pluginFound ) {
			sAux = i;
			break;
		}
	}
	
	return sAux;
}

function detectPlugin() {

    // allow for multiple checks in a single pass
    var daPlugins = detectPlugin.arguments;

    // consider pluginFound to be false until proven true
    var pluginFound = false;

    // if plugins array is there and not fake
    if (navigator.plugins && navigator.plugins.length > 0) {
		var pluginsArrayLength = navigator.plugins.length;
	
		// for each plugin...
		for (pluginsArrayCounter=0; pluginsArrayCounter < pluginsArrayLength; pluginsArrayCounter++ ) {
	
			// loop through all desired names and check each against the current plugin name
			var numFound = 0;
			for(namesCounter=0; namesCounter < daPlugins.length; namesCounter++) {
			
				// if desired plugin name is found in either plugin name or description
				if( (navigator.plugins[pluginsArrayCounter].name.indexOf(daPlugins[namesCounter]) >= 0) || 
					(navigator.plugins[pluginsArrayCounter].description.indexOf(daPlugins[namesCounter]) >= 0) ) {
					// this name was found
					numFound++;
				}   
			}
	
			// now that we have checked all the required names against this one plugin,
			// if the number we found matches the total number provided then we were successful
			if(numFound == daPlugins.length) {
				pluginFound = true;
				// if we've found the plugin, we can stop looking through at the rest of the plugins
				break;
			}
		}
    }
    
    return pluginFound;
    
} // detectPlugin

// Here we write out the VBScript block for MSIE Windows
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');

    document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');

    document.writeln('\'this next function will detect most plugins');
    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');

    document.writeln('</scr' + 'ipt>');
}

function noFlashFound() {
	
	//	document.write('<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" >'
  //+ '  <tr>'
  //+ '    <td align="center" valign="middle"><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank"><img src="../images/noflash.jpg"  border="0"></a></td>'
  //+ '  </tr>'
  //+ '</table>');
	 document.writeln('<p>Voc&ecirc; precisa do Plugin Flash 8 ou superior para visualizar esta anima&ccedil;&atilde;o.<br />');
	 document.writeln('<a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&quot;" target="_blank">Clique aqui</a> para instalar o plugin. </p>'); 
}


