﻿function showsubnav() {
	var subnav = document.getElementById('subnav');
	if(subnav != null) {
	var maxheight = subnav.scrollHeight;
	var height = subnav.style.height.replace('px','');
	height = parseInt(height);
		if(height < maxheight) {
			height += 2;
			subnav.style.height = height + 'px';
			setTimeout("showsubnav()",10);
		}
	}
	var subsubnav = document.getElementById('subsubnav');
	if(subsubnav != null) {
		var maxheight = subsubnav.scrollHeight;
    	var height = subsubnav.style.height.replace('px','');
	    height = parseInt(height);
		if(height < maxheight) {
			height += 2;
			subsubnav.style.height = height + 'px';
			setTimeout("showsubnav()",10);
		}
	}
}
function showGallery() {
    if(navigator.appVersion.indexOf('MSIE') > -1) {
        document.getElementById('galeryframe').style.width = '685px';
        document.getElementById('galeryframe').style.height = '548px';
    }
    var browserHeight = 0;
    if( typeof( window.innerHeight ) == 'number' ) { 
        browserHeight = window.innerHeight; 
    } else { 
        browserHeight = document.documentElement.clientHeight; 
    }
    document.getElementById('blockdiv').style.height = getDocHeight() + 'px';
    document.getElementById('galerycontainer').style.height = browserHeight + 'px';
    document.getElementById('blockdiv').style.display = 'block';
}
function hideGalery() {
	document.getElementById('blockdiv').style.display = 'none';
}
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
    );
}
