jQuery.noConflict();




jQuery(document).ready(function(){
	
	
		jQuery('.artigo_info').slideUp('fast');
	
	
		altura = jQuery('#component_wrap').eq(0).outerHeight();
			

	
		
		//pesquisa se na lateral ou não
		
		if(jQuery('.pesquisa .artigo').length>0){
			
						
			html = jQuery('#busca').addClass('lateral');
	
			altura = jQuery('#busca').eq(0).outerHeight();
			
			jQuery('.rbpo #right').eq(0).height(jQuery('#right').eq(0).outerHeight()+altura+20)
	


			//agora marca as palavras
			jQuery('#busca input.fabrik_filter').each(function(index) {
				txt = jQuery(this).val();
		
				if(txt!="" && txt!='0'){
					jQuery('.artigo .nomeartigo, .artigo .resumo,.artigo .autor,.artigo .keyword').highlight(txt);
				}
				
			});



		} else {
			
			
			
		
		jQuery('.rbpo #right').eq(0).height(altura+20)
		
		
			
		}
	
	
	
	
	
	

		jQuery('.nomeartigo').click(function(index) {
		
			
 			if(jQuery(this).parent('.artigo').hasClass('open')){
				
			
				jQuery(this).parent('.artigo').find('.artigo_info').slideUp(400);
					jQuery(this).parent('.artigo').removeClass('open');
				
			}else{
			
					jQuery(this).parent('.artigo').addClass('open');
					jQuery(this).parent('.artigo').find('.artigo_info').slideDown(400)
			
		}
			
			
	
			
			
			
		});
	
	
	
});



function viewEng(){
	
	
		jQuery('.rbpo .artigo').removeClass('open');
			jQuery('.artigo_info').slideUp('fast');
	
	
 			if(jQuery('#artigos_container').hasClass('in_eng')){
	
				jQuery('.eng').fadeOut(400, function() {
					jQuery('.artigo_info').slideUp('fast');
					jQuery('.ptbr').fadeIn(400);
					jQuery('#artigos_container').removeClass('in_eng')
					
				
					jQuery('.sumario').text('Sumário')
					jQuery('.sumary').text('View Sumary in English')
				
				
				});
		
		
	
		}else{
		
		
	
			jQuery('.ptbr').fadeOut(400, function() {
				
						jQuery('.artigo_info').slideUp('fast');
			
				jQuery('.eng').fadeIn(400);
				
				jQuery('#artigos_container').addClass('in_eng')
				
				
					jQuery('.sumario').text('Sumary')
			
				jQuery('.sumary').text('Ver sumário em Português')
			
				
			});
		
		
	}
}










function hasPdfPlugin() {   
//detect in mimeTypes array
if (navigator.mimeTypes != null && navigator.mimeTypes.length > 0) {        
    for (i = 0; i < navigator.mimeTypes.length; i++) {
        var mtype = navigator.mimeTypes[i];
        if(mtype.type == "application/pdf" && mtype.enabledPlugin)
            return true;
    }
}

//detect in plugins array
if (navigator.plugins != null && navigator.plugins.length > 0) {
    for (i = 0; i < navigator.plugins.length; i++) {
        var plugin = navigator.plugins[i];
        if (plugin.name.indexOf("Adobe Acrobat") > -1
                || plugin.name.indexOf("Adobe Reader") > -1) {
            return true;
        }

    }
} 
// detect IE plugin
if (window.ActiveXObject) {
    // check for presence of newer object       
    try {
        var oAcro7 = new ActiveXObject('AcroPDF.PDF.1');
        if (oAcro7) {
            return true;
        }
    } catch (e) {
    }

    // iterate through version and attempt to create object 
    for (x = 1; x < 10; x++) {
        try {
            var oAcro = eval("new ActiveXObject('PDF.PdfCtrl." + x + "');");
            if (oAcro) {
                return true;
            }
        } catch (e) {
        }
    }

    // check if you can create a generic acrobat document
    try {
        var p = new ActiveXObject('AcroExch.Document');
        if (p) {
            return true;
        }
    } catch (e) {
    }

}

// Can't detect in all other cases
return false;
}








