// JavaScript Document

function show(subm) {
	var submenu = document.getElementById(subm);
	submenu.style.visibility = "visible";
}

function hide(subm) {
	var submenu = document.getElementById(subm);
	submenu.style.visibility = "hidden";
}

function showgalleries(subm) {
	var submenu = document.getElementById(subm);
	var gallery = document.getElementById('Galleries');
	gallery.style.color = "#fff";
	submenu.style.visibility = "visible";
}

function hidegalleries(subm) {
	var submenu = document.getElementById(subm);
	var gallery = document.getElementById('Galleries');
	gallery.style.color = "#555";	
	submenu.style.visibility = "hidden";
}

function adjustfooter() {
	var div = "footer";
	var minHeight = 70; 
	var minWidth = 760; 
	var maxHeight = 10000; 
	var maxWidth = 1024; 
	var bottom = 0; 
	var right = 0; 


var division = document.getElementById(div);
	var obj = document.getElementById(div);	
	var divTop = 0, divLeft = 0;
	
if (obj.offsetParent) {
		divLeft = obj.offsetLeft
		divTop = obj.offsetTop
		while (obj == obj.offsetParent) {
			divLeft += obj.offsetLeft
			divTop += obj.offsetTop
		}
	}
	
  var WinWidth = 0, WinHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    WinWidth = window.innerWidth;
    WinHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    WinWidth = document.documentElement.clientWidth;
    WinHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    WinWidth = document.body.clientWidth;
    WinHeight = document.body.clientHeight;
  }	
	
	if (WinHeight > (divTop + minHeight)) {
		var newheight = WinHeight - divTop - bottom - 40;
		if (newheight > maxHeight) { newheight = maxHeight; }
		if (newheight < minHeight) { newheight = minHeight; }
		division.style.height = newheight + 'px';
		division.style.overflow = 'hidden';
	}
	if (WinWidth > (divLeft + minWidth)) {
		var newwidth = WinWidth - divLeft - right;
		if (newwidth > maxWidth) { newwidth = maxWidth; }
		//division.style.width = newwidth + 'px';
	}
}
