// navbar.js
google_ad_client = "pub-4639088530133416";
google_ad_width = 728;
google_ad_height = 90;
google_alternate_ad_url = "http://www.osmosislatina.com/adsosmosis/seccion_conectividad_html_banner.html";
google_ad_format = "728x90_as";
google_ad_channel ="3393812831";
google_color_border = "55559B";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "336699";
google_color_text = "333333";
var navURLs  = new Array('bluetooth.htm', 'hubs_switches.htm','tipos_de_conexion.htm','routers.htm','voip.htm');
var Text = new Array('LAN Inal&#225;mbricas y Bluetooth','Hubs y Switches','Tipos de Conexi&#243;n','Routers','Voz sobre IP');

function navbar() {
	var navStr= '<TABLE cellpading=10 align=left border="6">';
        var whereami = '0';
	for (var i = 0; i < navURLs.length; i++) {
		if (location.href.indexOf(navURLs[i]) != -1) {
                   whereami = i;
        }
       }

	for (var i = 0; i < navURLs.length; i++) {
		if (location.href.indexOf(navURLs[i]) == -1) {
			navStr += '<TR><TD align=center bgcolor="#eeeeee"><A HREF="' + navURLs[i] + '">'+ Text[i] + '</A></TD></TR>'; }
			 else {
                        navStr += '<TR><TD align=center bgcolor="#ccceee">'+ Text[i] + '</TD></TR>'; }
	}
        navStr += '<tr><td align="center" bgcolor="#eeeeee">' + libroString("eeeeee",whereami) + '</td></tr><tr><td align="center" bgcolor="#eeeeee">' + libroString("eeeeee",whereami) + '</td></tr></TABLE>';
	document.writeln(navStr);
	}


// ********* INICIA SECCION PRODUCTOS AMAZON  **********
var productos = new Array(5); // Areas por seccion
var cantidadproductos = 5;                 // Numero de libros
for ( var i=0; i < productos.length; i++ )  
  productos[i] = new Array(cantidadproductos);
// ID/ISBN/ASIN  de prodcutos 
productos[0][0] = "0672320584";
productos[0][1] = "0596001835";
productos[0][2] = "0764539108";
productos[0][3] = "0764548883"; 
productos[0][4] = "0596005598"; 


productos[1][0] = "0849320194";
productos[1][1] = "1558608877";
productos[1][2] = "1587051524";
productos[1][3] = "0672320827"; 
productos[1][4] = "1587051435"; 

productos[2][0] = "0201738279";
productos[2][1] = "0138902119";
productos[2][2] = "0789727056";
productos[2][3] = "1402076592"; 
productos[2][4] = "047161954X"; 

productos[3][0] = "0130090263";
productos[3][1] = "0596001665";
productos[3][2] = "1584503351";
productos[3][3] = "0738423432"; 
productos[3][4] = "059600558X"; 

productos[4][0] = "1578701686";
productos[4][1] = "0596008686";
productos[4][2] = "0975999206";
productos[4][3] = "0596000782"; 
productos[4][4] = "0596009623"; 



// Escoger ASIN de libro aleatorio  
    
function pickRandom(range) {
        if (Math.random)
            return Math.round(Math.random() * (range-1));
        else {
            var now = new Date();
            return (now.getTime() / 1000) % range;
        }
}
    
// Definir string de documento 

function libroString(colorFondo,area) { 
     var seleccion = pickRandom(cantidadproductos);
     var libStr = '<b><i>M&#225;s recursos... </i></b><br/><iframe src="http://rcm.amazon.com/e/cm?t=osmosislatina-20&o=1&p=8&l=as1&asins=' + productos[area][seleccion] + '&fc1=000000&lc1=0000ff&bc1=ffffff&npa=1&lt1=_top&IS2=1&bg1=' + colorFondo +'&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>';
     return libStr;	
}

function libro() { 
     var seleccion = pickRandom(cantidadproductos);
     var libStr = '<b><i>M&#225;s recursos... </i></b><br/><iframe src="http://rcm.amazon.com/e/cm?t=osmosislatina-20&o=1&p=8&l=as1&asins=' + productos[0][seleccion] + '&fc1=000000&lc1=0000ff&bc1=ffffff&npa=1&lt1=_top&IS2=1&bg1=ffffff&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>';
     document.writeln(libStr);	
}
