///////////////////////////////////////////////////
///// COPYRIGHT: 2007 DESIGN OF A DECADE
///// PROGRAMER: Paul Smiechowicz
///// EMAIL: paul@designofadecade.com
///////////////////////////////////////////////////

// openPrivew = 'Image';
// loadImage (fileURL);


var imgnum = '';
var img = new Image();

var videoFullOpen = 'no';
var imageFile;
var openPrivew;
var isIE = 0;
var isFireFox = 0;
var isNetscape = 0;
var agnt = navigator.userAgent.toLowerCase();
if(agnt.indexOf("msie")!=-1){isIE = 1;}
if(agnt.match(/firefox/i)){isFireFox = 1;}
if(agnt.match(/netscape/i)){isNetscape = 1;}


var ImageName;
var showpic = 'no';
var displayedImages = '';
function loadImage (fileURL) {
document.getElementById('imageHolder'+loadInto).src = 'siteimages/preloading'+loadInto+'.gif';
ImageName = fileURL;
imageFile = ImageName;
if (isIE) {
var randNum = Math.floor(Math.random()*11000);
document.getElementById('functionFRM').src = 'viewimage.html?file='+fileURL+'&num='+randNum;
showpic = 'yes';
} else {

img.onload = showImage;
img.src = imageFile;
showpic = 'yes';
if (!isFireFox && !isNetscape) {
if (img.complete) {
showImage ();	
}
}


}
}

function showImage () {
if (isIE) {
img.src = imageFile;	
}

if (showpic == 'yes') {
showpic = 'no';
document.getElementById('imageHolder'+loadInto).style.top = '0px';
document.getElementById('imageHolder'+loadInto).style.left = '0px';
document.getElementById('imageHolder'+loadInto).src = imageFile;

document.getElementById('imageHolder'+loadInto).style.top = '0px';
document.getElementById('imageHolder'+loadInto).style.left = '0px';
}
document.getElementById('imageHolder'+loadInto).style.visibility = "visible";
}