/******************************************************
** lib.js version 1.0 Dec 10, 2004
*******************************************************/

// onload=init;


	//var locationAfterPreload = "http://www.aritem.com/accueil.html" // URL of the page after preload finishes
	var locationAfterPreload = "accueil.html" // URL of the page after preload finishes
	var lengthOfPreloadBar = 200 // Length of preload bar (in pixels)
	var heightOfPreloadBar = 20 // Height of preload bar (in pixels)
	// Put the URLs of images that you want to preload below (as many as you want)
	var yourImages = new Array("Accueil1.png","Accueil2.png","Lentreprise1.png","Lentreprise2.png","NosOffres1.png","NosOffres2.png",
							   "References1.png","References2.png","Contact1.png", "Contact2.png",
							   "anim/vaa.gif","BarreGauche1.gif","BarreGauche2.gif", "BarreGauche3.gif","cailloux1.gif","pubGauche.gif",
							   "metier.gif", "VosProjets.gif","notrevaleurajoutee.gif");
	var images="images/";
	var libJs="js/";
	
	var waiting = 15;
if (document.images) {
	var dots = new Array() 
	dots[0] = new Image(1,1)
	dots[0].src = libJs+"black.gif" // default preloadbar color (note: You can substitute it with your image, but it has to be 1x1 size)
	dots[1] = new Image(1,1)
	dots[1].src = libJs+"blue.gif" // color of bar as preloading progresses (same note as above)
	var preImages = new Array(),coverage = Math.floor(lengthOfPreloadBar/yourImages.length),currCount = 0
	var loaded = new Array(),i,covered,timerID
	var leftOverWidth = lengthOfPreloadBar%coverage
}



var message="Sorry, this page is copyrighted by ARITEM";
var isClickDone=0;
 
	function click(e) {
		if (document.all) {
			if (event.button == 2) {
				alert(message);
	            return false;
            }
        }
        if (document.layers) {
            if (e.which == 3) {
				alert(message);
                return false;
            }
        }
    }
    if (document.layers) {
        document.captureEvents(Event.MOUSEDOWN);
    }
    document.onmousedown=click;

function OPENWIN(theURL,theName)
{/*
 var option;
 option = 'menubar=no,toolbar=no,status=no,scrollbars=no,left=25,top=50';
 alert(theUrl+" - "+theName+" - "+option);
 newWin = window.open(theURL,theName,option);
 newWin.focus();  */
   var option;
  option ='resizable=no,toolbar=no,directories=no,menubar=no,top=20,left=20,scrollbars=no';
  newWin = window.open(theURL,theName,option);
  newWin.focus();  

}

function init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}

function loadImages() { 
	for (i = 0; i < yourImages.length; i++) { 
		preImages[i] = new Image()
		preImages[i].src = images+yourImages[i]
	}
	for (i = 0; i < preImages.length; i++) { 
		loaded[i] = false
	}
	checkLoad()
}
function checkLoad() {
	if (currCount == preImages.length) { 
		location.replace(locationAfterPreload)
		return
	}
	for (i = 0; i <= preImages.length; i++) {
		if (loaded[i] == false && preImages[i].complete) {
			loaded[i] = true
			eval("document.img" + currCount + ".src=dots[1].src")
			currCount++
		}
	}
	timerID = setTimeout("checkLoad()",waiting) 
}

