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(){
//	  alert("Ec-Red");
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='468' height='60'> " + 
 		  "<param name='movie' value='http://www.ec-red.com/swf/bannerPizza2.swf'>" +
		  "<param name='quality' value='high'>" +
		  "<embed src='swf/bannerPizza2.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='468' height='60'></embed>" +
		  "</object>");
//return true;
}

function loadImage2() {
//RangeLimit =1;
// RangeLimit =10 ;

//banners = new Array()
//banners[0]="<object classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"" width=""468"" height=""60"">
//           <param name=""movie"" value=""ec-timer.swf"">
//           <param name=""quality"" value=""high"">
//           <embed src=""ec-timer.swf"" quality=""high"" pluginspage=""http://www.macromedia.com/go/getflashplayer"" type=""application/x-shockwave-flash"" width=""468"" height=""60""></embed>
//           </object>";
//banners[1]="<IMG SRC=http://www.ec-red.com/ec-timer.gif border=0 alt=";


Number = Math.round(RangeLimit * Math.random());
//Number =7;
TheImage = banners[Number]

links = new Array()
links[0] = "ec-timer/index.html";
links[1] = "ec-timer/index.html";
links[2] = "www.ec-red.com/sorteo/";
//links[3] = "http://www.ec-red.com/soat";
TheLink = links[Number]

Description = new Array()
Description[0] = "EC Timer";
Description[1] = "EC Timer";
Description[2] = "";

//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('http://www.ec-red.com/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>"); }
}
