// JavaScript Document
var isBigPhotoDisplayed = false;
var heightBigPhoto = 0;


function preloadImagesGallery() {
  var d=document;

  if(d.images)
  { 
  if(!d.MM_q) d.MM_q=new Array();
    var i,j=d.MM_q.length,a=preloadImagesGallery.arguments;
	for(i=0; i<a.length; i++)
    {
	if (a[i].indexOf("#")!=0){ d.MM_q[j]=new Image; d.MM_q[j++].src=a[i];}
	}
	
  }
}



function DisplayGalleryFlash()
{

if (document.getElementById)
{
// this is the way the standards work
document.getElementById('bigswf_div').style.display = "block";
}else if (document.all){
// this is the way old msie versions work
document.all['bigswf_div'].style.display = "block";
}else if (document.layers){
// this is the way nn4 works
document.layers['bigswf_div'].style.display = "block";
}

//isBigPhotoDisplayed = true;
//heightBigPhoto = document.getElementById('big_gallery_picture').height;
}

function closeGalleryFlash()
{
	if (document.getElementById)
{
// this is the way the standards work

document.getElementById('bigswf_div').style.display = "none";
}else if (document.all){
// this is the way old msie versions work
document.all['bigswf_div'].style.display = "none";
}else if (document.layers){
// this is the way nn4 works
document.layers['bigswf_div'].style.display = "none";
}
}


function DisplayGalleryPicture(currentimage,picturesrc)
{

if (document.getElementById)
{
// this is the way the standards work
document.getElementById('big_gallery_picture').src = picturesrc;
document.getElementById('bigphoto_div').style.display = "block";
}else if (document.all){
// this is the way old msie versions work
document.all['big_gallery_picture'].src = picturesrc;
document.all['bigphoto_div'].style.display = "block";
}else if (document.layers){
// this is the way nn4 works
document.layers['big_gallery_picture'].src = picturesrc;
document.layers['bigphoto_div'].style.display = "block";
}

isBigPhotoDisplayed = true;
heightBigPhoto = document.getElementById('big_gallery_picture').height;
}

function closeGalleryImage()
{
	if (document.getElementById)
{
// this is the way the standards work

document.getElementById('bigphoto_div').style.display = "none";
document.getElementById('big_gallery_picture').removeAttribute("height");
document.getElementById('big_gallery_picture').removeAttribute("width");
}else if (document.all){
// this is the way old msie versions work
document.all['bigphoto_div'].style.display = "none";
}else if (document.layers){
// this is the way nn4 works
document.layers['bigphoto_div'].style.display = "none";
}

	isBigPhotoDisplayed = false;
	}
	
	//function for resizing the big image in the pop up window depending on the size of the window
	
function resizeImage()
{


if(!isBigPhotoDisplayed){
	return;
}else
{
	var mywin_height;
	var myimg;
	
		
	if (document.getElementById)
	{
		// this is the way the standards work (Firefox)
	    //document.getElementById('big_gallery_picture').src = thumbs[i+1];
		mywin_height = window.innerHeight;
		myimg = document.getElementById("big_gallery_picture");
		
	}
	else if (document.all)
	{
		// this is the way old msIE versions work
		//document.all['big_gallery_picture'].src = thumbs[i+1];
		mywin_height = document.body.clientHeight;
		myimg = document.all['big_gallery_picture'];
	
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		//document.layers['big_gallery_picture'].src = thumbs[i+1];
		mywin_height = window.innerHeight;
		myimg = document.layers['big_gallery_picture'];
	
	}
	
	

	myimg.height = (mywin_height >= heightBigPhoto + 100) ? heightBigPhoto : (mywin_height - 100);
	
}
	
	}
	
	
	
