
var requiredVersion			=		5;

// #############################################

var flash2Installed			=		false;    
var flash3Installed			=		false;    
var flash4Installed			=		false;    
var flash5Installed			=		false;    
var flash6Installed			=		false;    
var maxVersion					=		6;             
var actualVersion				=		0;          
var hasRightFlashVersion			=		false;    
var jsVersion						=		1.0;


// #############################################


var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; 

jsVersion = 1.1;

if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
  document.write('</SCR' + 'IPT\> \n'); 
}


// #############################################


function detectFlash() {  
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"]|| navigator.plugins["Shockwave Flash"]) {

      var isVersion2				=		navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription	=		navigator.plugins["Shockwave Flash" + isVersion2].description;
      var flashVersion			=		parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
     
      flash2Installed				=		flashVersion == 2;    
      flash3Installed				=		flashVersion == 3;
      flash4Installed				=		flashVersion == 4;
      flash5Installed				=		flashVersion == 5;
      flash6Installed				=		flashVersion >= 6;
    }
  }
  
  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
  
  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;  

  if (actualVersion >= requiredVersion) {
    hasRightFlashVersion = true;                
  }
}

detectFlash();


var rand1 = 0;
var useRand = 0;

images = new Array;
images[1] = new Image();
images[1].src = "us1.jpg";
images[2] = new Image();
images[2].src = "us2.jpg";
images[3] = new Image();
images[3].src = "us3.jpg";
images[4] = new Image();
images[4].src = "us4.jpg";
images[5] = new Image();
images[5].src = "us5.jpg";
images[6] = new Image();
images[6].src = "us6.jpg";

function swapPic() {

var imgnum = images.length - 1;
do {
var randnum = Math.random();
rand1 = Math.round((imgnum - 1) * randnum) + 1;
} while (rand1 == useRand);
useRand = rand1;
if(hasRightFlashVersion != true) document.randimg.src = images[useRand].src;
}
