/********************************************************/
/*               Conexiones & Destinos                  */
/* * Esta pagina usa el framework Magic DHTML           */
/* * Version: 0.4                                       */
/* * Sistema y diseño, hecho por ClubIce                */
/********************************************************/
 
/********************************************************/
/* > Inicamos con la conguracion para M.DHTML           */
/********************************************************/
dhtConfig={
  imageRoot:"cyd/images/",
  soundRoot:"cyd/sounds/",
  CSSRoot:"styles/",
  scriptRoot:"scripts/",
  preloadImages:["logo.png","corners.png","backgrunds.png",
                 "cyd_form_elements.png",9,"big_logo.png","loader.png",10],
  preloadSound:["click.wav","bgsound.mp3","flash.wav","welcome.mp3",9],
  preloadScript:["cyd_styles.js",10],
  loadComponents:["box.dht",9],
  disableRightClick:true,
  enambleSound:true,
  onReadyData:{10,makeLoaderProgressbar,9,startPage},
  onLoaderProgressChange:UpdateLoader
  showDefaultLoader:false,
  usePopUpMode:true
}
/********************************************************/
/* > Función que genera la barra de precarga            */
/********************************************************/
function makeLoaderProgressbar () {
  LoaderImage=new lyrStaticImage("loader.png",200,30)
  LoaderImage.depth=-1
  LoaderProgressImage=new lyrDinamicImage("loader.png",200,0,0,0)
  LoaderProgressImage.depth=1
  Loader=new dhtComponent()
  Loader.insert(dhtLayer,LoaderProgressImage)
  Loader.insert(dhtLayer,LoaderImage)
  Logon=new lyrStaticImage("big_logo.png",300,200)
  FooterText=new lyrText ("© 2010 ClubIce And Conexiones & Destinos",cydFooterText)
  dhtWorkSpace.clear()
  dhtWorkSpace.insert(dhtLayer,Logon, dhtCenter, dhtMiddle)
  dhtWorkSpace.insert(dhtComponent,Loader, dhtCenter, dhtMiddle)
  dhtWorkSpace.insert(lyrText, FooterText, dhtRight, dhtBottom)
}
/*********************************************************/
/* > Función que actualiza el estado de carga de la      */
/*   barra de precarga.                                  */
/*                                                       */
/* * Progress: Indica el porcentaje de carga de la       */
/*   pagina. Este parametro es enviado automaticamente   */
/*   por onLoaderProgressChange.                         */
/*********************************************************/
function UpdateLoader (progress) {
  Loader.LoaderProgressImage.move(progress*2,0)
}
/*********************************************************/
/* > Función que inica el dibujado de los elemento de la */
/*   pagina.                                             */
/*********************************************************/
function StartPage () {
  AjustToScreen=new dhtFix (dhtSize,screen.width,screen.height)
  
  Container=new lyrDIV()
  dhtWorkSpace.clear()
}
/*********************************************************/
/* > Definimos elemento personalizados para C&D.         */
/*                                                       */
/* Comenzamos con las ventanas de interface              */
/*********************************************************/
cydBox=function (boxStyle,boxWidth,boxHeight, boxX, boxY) {
  this.images=new dhtSprite ("corners.png", 10,10,0,0,0,0,4,8)
  this.box=new dhtBox ()
  that=this
  if (boxStyle==cydGreen) {
   this.box.images={
    cor1:that.images.draw(0),
    cor2:that.images.draw(1),
    cor3:that.images.draw(4),
    cor4:that.images.draw(5),
    bor1:new dhtLoopedBG ("corners.png",9,0,11,10).draw(),
    bor2:new dhtLoopedBG ("corners.png",0,9,10,11).draw(),
    bor3:new dhtLoopedBG ("corners.png",10,9,20,11).draw(),
    bor4:new dhtLoopedBG ("corners.png",9,10,11,20).draw(),
    bgColor:new dhtColor (dhtRGB, 0,180,0)
   }
  } else if (boxStyle==cydOrange) {
   this.box.images={
    cor1:that.images.draw(2),
    cor2:that.images.draw(3),
    cor3:that.images.draw(6),
    cor4:that.images.draw(7),
    bor1:new dhtLoopedBG ("corners.png",29,0,31,10).draw(),
    bor2:new dhtLoopedBG ("corners.png",20,29,30,31).draw(),
    bor3:new dhtLoopedBG ("corners.png",30,9,40,11).draw(),
    bor4:new dhtLoopedBG ("corners.png",29,10,31,20).draw(),
    bgColor:new dhtColor (dhtRGB, 255,180,0)
   }
  }
}.prototype={
  draw:function (drwX,drwY) {
   return this.box.draw(drwX,drwY)
  },
  insert:function (insType,insItem,insX,insY) {
   this.box.insert(insType,insItem,insX,insY)
  }
}
 
window.onload=function() {dhtml.start()}