//variables con requerimientos minimos
	//parte PC
	var Nversion = 4  //version de netscape necesaria
	var Nbuild   = 6  //Build de netscape necesaria
	var Iversion = 4  //version de explorer necesaria
	var Ibuild   = 0  //Build de explorer necesaria
	//parte mac
	var navmac=1 //1 para netscape, 2 para explorer y netscape.
	var macNversion = 4  //version de netscape machito necesaria
	var macNbuild   = 6  //Build de netscape machito necesaria
	var macIversion = 0  //version de explorer machito necesaria
	var macIbuild   = 0  //Build de explorer machito necesaria
//variables con asignaciones de versiones y subversiones
var b = navigator.appName      				   //CONTENDRA NAVEGADOR
var v =  navigator.appVersion.substring(0,1)   //CONTIEN VERSION X DE NAVEGADOR
var sv = navigator.appVersion.substring(2,3)   //CONTIENE BUILD .X DE NAVEGADOR
var sysop =1 								   //contiene 1 para windows, 2 para machito, 3 para desconocido, por defecto windows
var FlashMode = 0  							   //contendra 1 si validado la version de flash (detecta 4 y 5)
//detectamos sistema operativo
if (navigator.userAgent.indexOf('Mac') != -1){	
	sysop=2}  
else{
	if (navigator.userAgent.indexOf('Windows') == -1) {sysop=3} }
//parche para iexplorer 5
if (navigator.appName.indexOf("Explorer")){
	if (navigator.appVersion.indexOf("MSIE 5")!=-1){
		v=5;
		sv=navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE 5")+7,navigator.appVersion.indexOf("MSIE 5")+8);}}

//tamaņo ventana
var h =400    //altura ventana
var w =650    //anchura ventana
var pagina = "index.htm";
var paginaNonav = "nonav.htm";


//parsea el navegador, si tiene flash y el sistema operativo
function inicio()
{
	// llamada a las funciones para detectar flash
	if (ns4) {flashns()} else {flashie()};
 	
	if (sysop!=2){  //si es pc o desconocido
		if (ie4){ //si explorer
			if (parseInt(v)>Iversion){
				entra()}
			else if ((parseInt(v)==Iversion)&&(parseInt(sv)>=Ibuild)){
				entra()}
			else{
				noentra()}}
		else{ //si netscape
			if (parseInt(v)>=Nversion){
				if (parseInt(sv)>=Nbuild){
					entra()}
				else{
					noentra()}}
			else{
				noentra()}}}
	else{ //si es machito
		if (ns4){ //si netscape
			if (parseInt(v)>=macNversion){
				if (parseInt(sv)>=macNbuild){
					entra()}
				else{
					noentra()}}
			else{
				noentra()}}
		else{ //si explorer
    		if (navmac==2){ //si se le deja entrar
				if (parseInt(v)>=macIversion){
					if (parseInt(sv)>=macIbuild){
						entra()}
					else{
						noentra()}}
				else{
					noentra()}}
			else{
				noentra()}}}
}


function entra()
{
	if((ie4)&&(parseInt(v)>=5)){
		entraIe5()}
	else{
		self.focus();
		s="height="+h+",width="+w;
		hb=Math.random(); hb=hb*1000; hb=hb+" "; aaaa = hb.substring(0,hb.indexOf(".")); 
		eval("var win"+aaaa); c = eval("win"+aaaa);
		pagina = pagina + "?" + FlashMode 
		c = window.open(pagina,aaaa,"status=1,top=0,left=0,location=0,toolbar=0,scrollbars=0,menubar=0,directories=0,"+s);
	}	
}

function noentra()
{
 location.href = paginaNonav
}

function entraIe5()
{
 self.focus();
 s="height="+h+",width="+w;
 hb=Math.random(); hb=hb*10000; hb=hb+" "; aaaa = hb.substring(0,hb.indexOf(".")); c = "win"+aaaa;
 pagina = "indexie5.htm"
 // llamada a chromeless
	theURL = pagina + "?" + FlashMode
	wname = c
	CW = w;
	CH = h;
	windowCERRARa 		= "imagen/close_a.gif"
	windowCERRARd 		= "imagen/close_d.gif"
	windowCERRARo 		= "imagen/close_o.gif"
	windowNONEgrf 		= "imagen/filer.gif"
	windowCLOCK		= "imagen/clock.gif"
	windowREALtit		= "ADRIAN SERVICE"
	windowTIT 	    	= "<font face=verdana size=1>&nbsp;ADRIAN SERVICE</font>"
	windowBORDERCOLOR   	= "#cccccc"
	windowBORDERCOLORsel	= "#bfbfbf"
	windowTITBGCOLOR    	= "#cccccc"
	windowTITBGCOLORsel 	= "#bfbfbf"
	openchromeless(theURL, wname, CW, CH, windowCERRARa, windowCERRARd, windowCERRARo, windowNONEgrf, windowCLOCK, windowTIT, windowREALtit , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)
}
function noentra()
{
 location.href = paginaNonav
}

//deteccion de flash en netscape
function flashns()
  {
      if (navigator.appName == "Netscape" && navigator.plugins) 
	   {
		 numPlugins = navigator.plugins.length;
         if (numPlugins > 0) 
          {          
            for (i = 0; i < numPlugins; i++)
            {
               plugin = navigator.plugins[i];
			   if ((plugin.description.indexOf("Flash 4") != -1)||(plugin.description.indexOf("Flash 5") != -1))               
        		{
				  
				  numTypes = plugin.length;
				  for (j = 0; j < numTypes; j++) 
                  {
                     mimetype = plugin[j];
                     if (mimetype)
                     {     
                        if (mimetype.enabledPlugin && (mimetype.suffixes.indexOf("swf") != -1))
                           FlashMode = 1;
                        // Mac wierdness
                        if (navigator.mimeTypes["application/x-shockwave-flash"] == null)
                           FlashMode = 0;
                     }
                  }
               }
            }
         }                        
      }
}

