
//----- Concepcao e desenvolvimento por:
//----- EMPRESASGLOBAIS.COM	
//----- www.EmpresasGlobais.com

/*---------------------------------------------------------------------------------*/
/* Objectivo: detectar o click direito do mouse e evitar a visualização do código  */
/* Nota: facil de contornar mas suficientemente incomodativo para o justificar :-) */

function udpMouseClick(pEvent)
 {
  if (document.all)
   if (event.button==2||event.button==3)
    { 
     alert('AdvogadosPT.net');
     return false;
    }
   if (document.layers)
    if (pEvent.which == 3)
     {
      alert('AdvogadosPT.net');
      return false;
     }
 }
 
if (document.layers) document.captureEvents(event.MOUSEDOWN);
document.onmousedown=udpMouseClick;

/*---------------------------------------*/	
/* Objectivo: abrir nova janela com URL */
/* pType = 0 -> normal     */
/* pType = 1 -> sem botões */

function udpOpenWindow(pUrl, pType, pWidth, pHeight)
{
 var dia=new Date();
 var hora=dia.getTime();
 var lScroll;
 
 if (!pType)
   window.open(pUrl, 'EG'+hora);
  else
   {
    if (!pWidth) pWidth=750;
	if (!pHeight) pHeight=500;
	if (pType==2) lScroll='yes';
	 else lScroll='no';	 
    window.open(pUrl, 'EG'+hora, 'width='+pWidth+',height='+pHeight+',toolbar=no,scrollbars='+lScroll+',resizable=yes,status=no,directories=no,menubar=no,location=no');
   }	
}

/*----------------------------------------------------------*/	
/* Objectivo: detectar Flash e carregar banner .swf ou .jpg */

function udpFlashBanner(pBanner, pWidth, pHeight)
 {
  var lBanner;
 
  if ( document.all || navigator.plugins["Shockwave Flash"])
	lBanner = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
	          'codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" ' +
			  'width="' + pWidth + '" height="' + pHeight + '" vspace="0" hspace="0"> ' + 
			  '<param name="movie" value="' + pBanner + '.swf' + '">' +
			  '<param name="quality" value="high">' +
			  '<param name="menu" value="false">' +
			  '<param name="loop" value="false">' +
			  '<embed src="' + pBanner + '.swf' + '" quality="high" ' +
			  'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ' +
			  'type="application/x-shockwave-flash" width="' + pWidth + '" height="' + pHeight + '" ' +
			  'menu="false" loop="false" vspace="0" hspace="0"></embed></object>';
   else
    lBanner = '<img src="' +  pBanner + '.jpg' + '" alt="" width="' + pWidth + '" height="' + pHeight + '" border="0">';

  document.write( lBanner );
 }
 
