window.onload = function() {

	setTimeout(function() {

/*
		// reference to <head>
		var head = document.getElementsByTagName('head')[0];

		// a new CSS
		var css = document.createElement('link');
		css.type = "text/css";
		css.rel  = "stylesheet";
		css.href = "http://domain.tld/preload.css";

		// a new JS
		var js  = document.createElement("script");
		js.type = "text/javascript";
		js.src  = "http://domain.tld/preload.js";

		// preload JS and CSS
		head.appendChild(css);
		head.appendChild(js);
*/
		// preload image

		new Image().src = "../images/topSlideshow/01.jpg";
		new Image().src = "../images/topSlideshow/02.jpg";
		new Image().src = "../images/topSlideshow/03.jpg";
		new Image().src = "../images/topSlideshow/04.jpg";
		new Image().src = "../images/topSlideshow/05.jpg";
		new Image().src = "../images/topSlideshow/06.jpg";
		new Image().src = "../images/topSlideshow/07.jpg";
		new Image().src = "../images/topSlideshow/08.jpg";
		new Image().src = "../images/topSlideshow/09.jpg";
		new Image().src = "../images/topSlideshow/10.jpg";
		new Image().src = "../images/topSlideshow/11.jpg";
		new Image().src = "../images/topSlideshow/12.jpg";
		new Image().src = "../images/topSlideshow/13.jpg";
		new Image().src = "../images/topSlideshow/14.jpg";
		new Image().src = "../images/topSlideshow/15.jpg";
		new Image().src = "../images/topSlideshow/16.jpg";

	}, 1000);

};




/*
function preloadimages(arr){
    var newimages=[], loadedimages=0
    var arr=(typeof arr!="object")? [arr] : arr
    function imageloadpost(){
        loadedimages++
    }
    for (var i=0; i<arr.length; i++){
        newimages[i]=new Image()
        newimages[i].src=arr[i]
        newimages[i].onload=function(){
            imageloadpost()
        }
        newimages[i].onerror=function(){
        imageloadpost()
        }
    }
}

 
preloadimages([	'../images/topSlideshow/01.jpg', 
				'../images/topSlideshow/02.jpg', 
				'../images/topSlideshow/03.jpg', 
				'../images/topSlideshow/04.jpg', 
				'../images/topSlideshow/05.jpg', 
				'../images/topSlideshow/06.jpg', 
				'../images/topSlideshow/07.jpg', 
				'../images/topSlideshow/08.jpg', 
				'../images/topSlideshow/09.jpg', 
				'../images/topSlideshow/10.jpg', 
				'../images/topSlideshow/11.jpg', 
				'../images/topSlideshow/12.jpg', 
				'../images/topSlideshow/13.jpg', 
				'../images/topSlideshow/14.jpg', 
				'../images/topSlideshow/15.jpg', 
				'../images/topSlideshow/16.jpg']
)
*/
