function ImagePreloader(images, call_back, imurl)

{

   // store the call_back

   this.call_back = call_back;

 

   // initialize internal state.

   this.nLoaded = 0;

   this.nProcessed = 0;

   this.aImages = new Array;

 

   // record the number of images.

   this.nImages = images.length;

 

   // for each image, call preload()

   for ( var i = 0; i < images.length; i++ ) 

      this.preload(images[i], imurl);

}


ImagePreloader.prototype.preload = function(image, imurli)

{

   // create new Image object and add to array

   var oImage = new Image;

   this.aImages.push(oImage);

   

   // set up event handlers for the Image object

   oImage.onload = ImagePreloader.prototype.onload;

   oImage.onerror = ImagePreloader.prototype.onerror;

   oImage.onabort = ImagePreloader.prototype.onabort;

   

   // assign pointer back to this.

   oImage.oImagePreloader = this;

   oImage.bLoaded = false;

   

   // assign the .src property of the Image object

   oImage.src = "http://dea-nilana.bg/" + imurli +image;
//   alert ("http://nilana.bg/" + imurli +image);

}

ImagePreloader.prototype.onComplete = function()

{

   this.nProcessed++;

   if ( this.nProcessed == this.nImages )

   {

      this.call_back(this.aImages, this.nLoaded);

   }

}

ImagePreloader.prototype.onload = function()

{

   this.bLoaded = true;

   this.oImagePreloader.nLoaded++;

   this.oImagePreloader.onComplete();

}

ImagePreloader.prototype.onerror = function()

{

   this.bError = true;

   this.oImagePreloader.onComplete();

}

ImagePreloader.prototype.onabort = function()

{

   this.bAbort = true;

   this.oImagePreloader.onComplete();

}

//end good code



my_images = ("http://www.valdiscomplex.com/banner/banner.png", "http://www.valdiscomplex.com/buttons/home-se.png", "http://www.valdiscomplex.com/buttons/home-onm.png", "http://www.valdiscomplex.com/menu/pause25p.png", "http://www.valdiscomplex.com/buttons/services.png", "http://www.valdiscomplex.com/buttons/services-onm.png", "http://www.valdiscomplex.com/buttons/prices.png", "http://www.valdiscomplex.com/buttons/prices-onm.png", "http://www.valdiscomplex.com/buttons/contacts.png","http://www.valdiscomplex.com/buttons/contacts-onm.png", "http://www.valdiscomplex.com/buttons/rila.png", "http://www.valdiscomplex.com/buttons/rila-onm.png", "http://www.valdiscomplex.com/menu/right.png", "http://www.valdiscomplex.com/effects/leftsmth.png", "http://www.valdiscomplex.com/effects/rightsmth.png", "http://www.valdiscomplex.com/images/loadingy.png");



function Call_me (){
document.getElementById("loading").style.display="none";
document.getElementById('menu').style.visibility = 'visible'; 
document.getElementById('textc').style.visibility = 'visible'; 
if (document.getElementById('img_gallery')){
document.getElementById('img_gallery').style.visibility = 'visible'; 
}
document.getElementById('effects1').style.visibility = 'visible'; 
document.getElementById('effects2').style.visibility = 'visible'; 

} 
document.write('<div id="loading"><br><br><img src="http://valdiscomplex.com/images/loader.gif" alt="" />Please wait...</div>');
window.onload = function(){
var browser=navigator.appName;
if (browser=="Microsoft Internet Explorer"){

document.getElementById('effects1').style.pixelHeight = document.documentElement.clientHeight - 139;
document.getElementById('effects2').style.pixelHeight = document.documentElement.clientHeight - 158;
}else{

 bao = document.documentElement.clientHeight - 139;
 bao1 = document.documentElement.clientHeight - 158;
document.getElementById('effects1').style.height = bao + "px";
document.getElementById('effects2').style.height = bao1 + "px"

}

ip = new ImagePreloader(my_images, Call_me, "");
}


