var org_width = screen.width;
var org_height = screen.height;
var cw = (org_width-690)/2;
var ch = (org_height-492)/2;

function openNewWindow(URLtoOpen, windowName, windowFeatures)
        {
                newWindow=window.open(URLtoOpen, windowName, windowFeatures);
        }

function openWindow(theURL,winName,features) {
    all_features = features+',top='+ch+',left='+cw;
    window.open(theURL,winName,all_features);
}

function loadImage() {
RangeLimit =1;
// RangeLimit =10 ;

banners = new Array()
banners[0]="<IMG SRC=http://www.ec-red.com/BannerBagleBC.gif border=0 alt=";
banners[1]="<IMG SRC=http://www.ec-red.com/BannerBagleBC.gif border=0 alt=";
//banners[1]="<IMG SRC=http://www.ec-red.com/bmigracion.gif border=0 alt=";
//banners[2]="<IMG SRC=http://www.ec-red.com/bmigracion.gif border=0 alt=";
//banners[4]="<IMG SRC=http://www.ec-red.com/panda.gif border=0 alt=";
//banners[5]="<IMG SRC=http://www.ec-red.com/banner05.gif border=0 alt=";
// SOAT >> banners[3]="<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 width=468 height=60>    <param name=movie value=http://www.ec-red.com/banners/soat.swf>    <param name=quality value=high>    <embed src=http://www.ec-red.com/banners/soat.swf quality=high       pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=468 height=60></embed> </object>";


Number = Math.round(RangeLimit * Math.random());
//Number =7;
TheImage = banners[Number]

links = new Array()
links[0] = "http://www.qnet.com.pe/empresariales/shtml/sindividuales.shtml";
links[1] = "http://www.qnet.com.pe/empresariales/shtml/sindividuales.shtml";
//links[1] = "http://www.ec-red.com/sorteo/";
//links[2] = "http://www.ec-red.com/pconfiguracion.html";
//links[3] = "http://www.ec-red.com/soat";
TheLink = links[Number]

Description = new Array()
Description[0] = "Protégete ahora";
Description[1] = "Protégete ahora";
//Description[2] = "7192000 - tu nuevo número de acceso";
//Description[3] = "";
TheDescription = Description[Number]
 if(Number>1){TheImageAll= TheImage;} else{
TheImageAll = TheImage + "'" + TheDescription + "'" + ">";
}
if (TheLink == "calculadora/index.htm") {
        document.write("<a onclick=openWindow('calculadora/index.htm','calculadora','width=528,height=400,scrollbars=yes,resizable=no') href=javascript:;>" + TheImageAll + "</a>"); }
        else {
              if(TheLink == "panda/index.html")
              {
               document.write("<a onclick=openWindow('panda/index.html','Panda','width=630,height=402') href=javascript:;>" + TheImageAll + "</a>");
              }
              else {

                        if(TheLink=="ec-timer/index.html")
                        {
                          document.write("<a onclick=openWindow('ec-timer/index.html','ECTimer','width=520,height=480') href=javascript:;>" + TheImageAll + "</a>");
                        }
                        else {
                               document.write("<a href="+TheLink+">" + TheImageAll + "</a>");
                             }
                        }
              }
}

function loadImageChico() {
RangeLimit = 3;

bannersCh = new Array()
bannersCh[0]="<IMG SRC=banner-left1.gif border=0 alt=";
bannersCh[1]="<IMG SRC=banner-left2.gif border=0 alt=";
bannersCh[2]="<IMG SRC=banner-left1.gif border=0 alt=";
bannersCh[3]="<IMG SRC=banner-left2.gif border=0 alt=";

Numbers = Math.round(RangeLimit * Math.random());
TheImage = bannersCh[Numbers]

linksCh = new Array()
linksCh[0] = "calculadora/index.htm";
linksCh[1] = "calculadora/index.htm";
linksCh[2] = "calculadora/index.htm";
linksCh[3] = "calculadora/index.htm";
TheLink = linksCh[Numbers]

DescriptionCh = new Array()
DescriptionCh[0] = "Calculadora";
DescriptionCh[1] = "Calculadora";
DescriptionCh[2] = "Calculadora";
DescriptionCh[3] = "Calculadora";
TheDescription = DescriptionCh[Numbers]

TheImageAll = TheImage + "'" + TheDescription + "'" + ">";

if (TheLink == "calculadora/index.htm") {
        document.write("<a onclick=openWindow('calculadora/index.htm','calculadora','width=528,height=400,scrollbars=yes,resizable=no') href=javascript:;>" + TheImageAll + "</a>"); }
        else { document.write("<a href="+TheLink+">" + TheImageAll + "</a>"); }
}