﻿
// detect navegador


//<script language="JavaScript">
//<!--
//var browser_usuario = navigator.appName;
//if(browser_usuario == "Microsoft Internet Explorer"){
//alert("Utiliza IE");
//} else{
//alert("Utiliza Mozilla");
//};
////-->
//</script>


function navegador(tipo){

var ua = navigator.userAgent;
var ver = parseInt( navigator.appVersion );
var opera = /opera [56789]|opera\/[56789]/i.test(ua);
var ie = !opera && /MSIE/.test(ua);
var ie50 = ie && /MSIE 5\.[01234]/.test(ua);
var ie6 = ie && /MSIE [6789]/.test(ua);
var ieBox = ie && (document.compatMode == null || document.compatMode != "CSS1Compat");
var moz = !opera && /gecko/i.test(ua);
var nn6 = !opera && /netscape.*6\./i.test(ua);


    if (tipo == "normal"){

        if (ie == true) {
        banner()
        }
        
       if (ie != true) {
        bannerRandom()
        }
        
        alert("1" + ie);
    }
    
    if (tipo == "menor"){

        if (ie==true) {
        bannerMenor()
        }
        if (ie != true) {
        bannerRandom()
        }
alert("2" + ie);
    }


}



// monta nome do arquivo

function banner() {


    banner = new Banner('banner');
    banner.add("FLASH", "images/BannerCases/banner3.swf", 5, 140, 600, "verCase.aspx?CasId=30");
    banner.add("FLASH", "images/BannerCases/banner3.swf", 5, 140, 600, "verCase.aspx?CasId=30");
    
    document.write(banner);
    banner.start();
    
    
}    
  
  
function bannerMenor() {


    banner = new Banner('banner');
    banner.add("FLASH", "images/BannerCases/banner3.swf", 5, 74, 600, "verCase.aspx?CasId=30");
    banner.add("FLASH", "images/BannerCases/banner3.swf", 5, 74, 600, "verCase.aspx?CasId=30");
    
    document.write(banner);
    banner.start();
    
    
}  


// gera numero aleatorio
function bannerRandom() {

var numero = aleatorio(1,1)
var link = "banner" + numero + ".swf";



    bannerRandom = new Banner('bannerRandom');
   
    bannerRandom.add("FLASH", "images/BannerCases/"+link, 5, 140, 600,"verCase.aspx?CasId=30");
    
    document.write(bannerRandom);
    bannerRandom.start();
    
    
}   

function bannerRandomMenor() {

var numero = aleatorio(1,1)
//var link = "case"+numero+"m.swf";
//var link = "banner" + numero + ".swf";
var link = "case" + numero + "m.swf";
//var link = "case1m.jpg";

    bannerRandom = new Banner('bannerRandom');
   
    bannerRandom.add("FLASH", "images/BannerCases/"+link, 5, 74, 600,"verCase.aspx?CasId=30");
    
    document.write(bannerRandom);
    bannerRandom.start();
    
    
}     
  
  
  function aleatorio(inferior,superior){ 
    numPossibilidades = superior - inferior 
    aleat = Math.random() * numPossibilidades 
    aleat = Math.floor(aleat) 
    return parseInt(inferior) + aleat 
} 
  
