	//Sets the height of div1 to div2
	function resizeDiv(div1, div2)
	{		
		document.getElementById(div1).style.height = document.getElementById(div2).offsetHeight;
					
	}
	
	//Sets the height of div1 to div2 only if div2's height is larger than the minimum height defined.
	//Others sets the height of div1 to div2
	function resizeDivSetMin(div1, div2, minHeight)
	{		
		
		if (document.getElementById(div2).offsetHeight < minHeight)
		{
			document.getElementById(div1).style.height = minHeight + 'px';		
		}
		else
		{
			//alert(document.getElementById(div2).offsetHeight);
			document.getElementById(div1).style.height = document.getElementById(div2).offsetHeight  + 'px';
			//alert(document.getElementById(div1).offsetHeight);
		}	
	}
	
	//Center div vertically
	function centerDivVertically(divToCenter, divContainer)
	{
		var divContainerHeight = document.getElementById(divContainer).offsetHeight;
		var divToCenterHeight = document.getElementById(divToCenter).offsetHeight;
		var divHeaderHeight = document.getElementById("header").offsetHeight;
		var centreAmount = ((divContainerHeight - divToCenterHeight) / 2) - (divHeaderHeight / 2);
		document.getElementById(divToCenter).style.marginTop = centreAmount;
		//alert(divContainerHeight);
		//alert(centreAmount);
	}
	
	//Resizes div1 to fill to the bottom of the window
	function expandToWindowHeight()
	{
	
		//get browser name
		var browserUserAgent = navigator.userAgent
		var browserAppName = navigator.appName
		
		//alert(browserUserAgent);
		var clientHeight;
        var contentHeight;
        
        var expandWidth;
        var expandHeight;
        
        try
        {
			//IE 
			clientHeight = document.documentElement.clientHeight;
		       
			//Safari
			//clientHeight = window.innerHeight;
	        
			//Opera
			//clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
	        
			contentHeight = document.getElementById("page").offsetHeight - document.getElementById("footer").offsetHeight;

			expandHeight = clientHeight - contentHeight;
	        
			//alert("clientHeight: " + clientHeight + " contentHeight: " + contentHeight);
			//  alert(clientHeight - contentHeight);
			//apply height to footer
			if(browserAppName == "Microsoft Internet Explorer")
			{
				//todo      				
			} else
			{	
				//tillys contact info
				document.getElementById("ContactContainer").style.bottom = expandHeight + 'px';         
			}
			//expand footer to bottom of screen
			document.getElementById("footer").style.height = expandHeight + 'px';    
        }
        catch(ex) {
			//alert (ex.description);
		} finally {
			//nothing
		}
	}
