browserName=navigator.appName;
browserVer=parseInt(navigator.appVersion);
  if ((browserName=="Netscape" && browserVer>=3) || (browserName=="Microsoft Internet Explorer" && browserVer>=4))   
  version="n3";
  else
    version="n2";
  if (version=="n3")
     {pic1on= new Image(75,94);
     pic1on.src="botones/boton_principal2.jpg"; 
     pic1off= new Image(75,94);
     pic1off.src="botones/boton_principal1.jpg";
     pic2on= new Image(90,143);
     pic2on.src="botones/boton_marcos2.jpg"; 
     pic2off= new Image(90,143);
     pic2off.src="botones/boton_marcos1.jpg";
     pic3on= new Image(75,94);
     pic3on.src="botones/boton_posters2.jpg";
     pic3off= new Image(75,94);
     pic3off.src="botones/boton_posters1.jpg";
     pic4on= new Image(75,94);
     pic4on.src="botones/boton_poliester2.jpg"; 
     pic4off= new Image(75,94);
     pic4off.src="botones/boton_poliester1.jpg";
     pic5on= new Image(75,101);
     pic5on.src="botones/boton_faq2.jpg"; 
     pic5off= new Image(75,101);
     pic5off.src="botones/boton_faq1.jpg";
     pic6on= new Image(75,94);
     pic6on.src="botones/boton_mapa2.jpg";
     pic6off= new Image(75,94);
     pic6off.src="botones/boton_mapa1.jpg";
     pic7on= new Image(75,94);
     pic7on.src="botones/boton_busqueda2.jpg"; 
     pic7off= new Image(75,94);
     pic7off.src="botones/boton_busqueda1.jpg";
     pic8on= new Image(75,94);
     pic8on.src="botones/boton_contacto2.jpg"; 
     pic8off= new Image(75,94);
     pic8off.src="botones/boton_contacto1.jpg";
}

function encend(imgName)
 {
   if (version=="n3")
    {
      imgOn=eval(imgName + "on.src");
      document[imgName].src= imgOn;
    }
 }

function apagar(imgName)
 {
   if (version=="n3")
    {
      imgOff=eval(imgName + "off.src");
      document[imgName].src= imgOff;
    }
 }

var requiredVersion = 4;
var useRedirect = false;
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var maxVersion = 5;
var actualVersion = 0;
var hasRightVersion = 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){ // don't write vbscript tags on anything but ie win
	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('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

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;
		}
	}
	for (var i = 2; i <= maxVersion; i++) {	
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}
	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;	
	if (actualVersion >= requiredVersion) {
		hasRightVersion = true;
		if (useRedirect) {
			if(jsVersion > 1.0) {
				window.location.replace(flashPage);
			} else {
				window.location = flashPage;
			}
		}
	} else {
		if (useRedirect) {
			if(jsVersion > 1.0) {
				window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
			} else {
				window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
			}
		}
	}
}
detectFlash();

// Copyright 2001 Flat Earth Communications
function random_image() {
	var num = Math.floor(Math.random() * 29) + 1;
	document.i1.src='images_cj_v-c/' + num + '.jpg'

	var num4 = Math.floor(Math.random() * 19) + 1;
	document.i4.src='images_cj_h-c/' + num4 + '.jpg'

	resetTime()
}

function resetTime(){
    setTimeout("random_image()",8000)
}