function navRoll(navName,navState) {
	if (document.images) {
		//document.images[navName].src = eval(navState + ".src");
	}
}


/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/


//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"

///////No need to edit beyond here/////

if (preloadimg=="yes" && window.dynimages){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}

function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
	//imghtml='<a href="javascript:" target="'+optlinktarget+'">'
	imghtml ='<img class="img-framed" src="'+theimg[0]+'" border="'+imgborderwidth+'">'
	//if (theimg[1]!="")
		//imghtml+='</a>'
	return imghtml
}

function modifyimage(loadarea, imgindex){
	if (document.getElementById){
		var imgobj=document.getElementById(loadarea)
		if (imgobj.filters && window.createPopup){
			imgobj.style.filter=filterstring
			imgobj.filters[0].Apply()
		}
		imgobj.innerHTML=returnimgcode(dynimages[imgindex])
		if (imgobj.filters && window.createPopup)
			imgobj.filters[0].Play()
		return false
	}
}


function change_image(img_src, image_id, width, height){
			
	if (document.images) {
		document.images[image_id].src = img_src;
		document.images[image_id].width = width;
		document.images[image_id].height = height;
	}
	
}

var img = -1;
function refreshIt() {
	
   src1 = document.images['img'].src;
 
   src1_arr = src1.split("/");
	
   show = img+1;
   if (show >= 0 && show <= images.length-1){
   	 rand1 = show;
   }else{
   	rand1 = 0;
   }
   
   img = rand1;
  
   if (!document.images) return;
   document.images['img'].src = 'files/'+images[rand1];
   setTimeout('refreshIt()',5000);
}

/* Overlayer */

var oTopInit = 150;
	
function getPageScroll(){
     var scrolly = typeof window.pageYOffset != 'undefined' ? window.pageYOffset : document.documentElement.scrollTop;   
     var scrollx = typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement.scrollLeft;   
	
	var arrayScroll = new Array(scrollx, scrolly);
	return arrayScroll;	
}

function getPageSize() {
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;

	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth;
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = xScroll;
	} else {
		pageWidth = windowWidth;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}
 
function showOverlayer(){
	var size = getPageSize();
	var scroll = getPageScroll();

	var obg = document.getElementById('page-bg');
	obg.style.width = size[0]+'px';
	obg.style.height = size[1]+'px';
	
	var ovr = document.getElementById('overlayer');
	ovr.style.top = oTopInit + scroll[1]+'px';
	
	var ovb = document.getElementById('overlayer-bg');
	ovb.style.top = oTopInit + scroll[1]+'px';

	obg.style.display = 'block';
	ovb.style.display = 'block';
	ovr.style.display = 'block';
	
}

function hideOverlayer(){
	var obg = document.getElementById('page-bg');
	var ovr = document.getElementById('overlayer');
	var ovb = document.getElementById('overlayer-bg');

	ovb.style.display = 'none';
	ovr.style.display = 'none';
	obg.style.display = 'none';

}

function showDescription(id, description){
	
	if (document.getElementById){
		obj_id = document.getElementById(id);
		obj_id.innerHTML = description;
	}
		
}

function hideDescription(id){
	
	if (document.getElementById){
		obj_id = document.getElementById(id);
		obj_id.innerHTML = '<p>&nbsp;</p>';
	}
		
}

