window.onresize = function() {
       setupPanelHeights();
    };

window.onload = function() {
       setupPanelHeights();
    }

/* email message */
function showProgress(messageID)
{
	$(messageID).style.visibility ='visible';
	$(messageID).innerHTML =('<img src="/images/gfx_loader_small.gif"/>Sending, please wait.');
}


function updateActiveGalleryLinkx(galleryLinkIndex){
	i=0;
	length = $('gallery').select('a').size();
	for(i;i<length;i++){
	$('gallery').select('a')[i].removeClassName('activeExample')
	}
	$('gallery').select('a')[galleryLinkIndex].addClassName('activeExample')
}

function updateActiveGalleryLink(galleryLinkIndex){
	i=0;
	$('gallery').select('a').each(function(a) {a.removeClassName('activeExample')});
	$('gallery').select('a')[galleryLinkIndex].addClassName('activeExample');
}

function showElement(elementName){
	$(elementName).appear();
}

function hideElement(elementName){
	$(elementName).fade();
}

function setupPanelHeights(){
	WindowDimentions = getWindowSize();
	WindowHeight = WindowDimentions.height;
	NavigationHeight = $('navigationContainer').getDimensions().height
	PanelContainerHeight = WindowHeight - NavigationHeight;
	PanelHeight = ((PanelContainerHeight/2) -82 )+'px';
	PanelHeightFull = ((PanelContainerHeight) -94 )+'px';
	
	panels = $('panelsContainer').select('.wrapper');
	//alert (panels.size());
	panels.each(function(a) {a.setStyle({'height':PanelHeight})});
	
    imagePanel = $('wrapperFull');
	
	imagePanel.setStyle({'height':PanelHeightFull});
	

}

function updatePanelHeight(element,height){
	alert(element);

}

function getWindowSize(w) {
var width, height;
w = w ? w : window;
width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);

return { width: width, height: height };
}

