// JavaScript Document

var HEIGHT = 0;
var secureInt;

function stretch(){
	var logo    = document.getElementById( 'logo' );
	var wrapper = document.getElementById( 'wrapper' );
	var shadow  = document.getElementById( 'shadow' );
	var middle  = document.getElementById( 'middle' );
	var copy    = document.getElementById( 'copy' );
	var menu    = document.getElementById( 'menu' );
	var header  = document.getElementById( 'header' );
	var newheight = menu.offsetHeight + header.offsetHeight + copy.offsetHeight + 70;
	/*var btm =    document.getElementById( 'btm' );
	var sidebg = document.getElementById( 'sidebg' );
	var side =   document.getElementById( 'side' );
	var sideheight = top.offsetHeight + mid.offsetHeight + btm.offsetHeight;
	var bgheight = top.offsetHeight + mid.offsetHeight + btm.offsetHeight;*/
	
	if( newheight > 570 ){
		if( document.getElementById('contactform') ){
			if( isIE ){
				newheight += 50;
			}
		}
		wrapper.style.height = parseInt( newheight )+"px";
		shadow.style.height = parseInt( newheight )+"px";
		
		logo.style.marginTop = (parseInt( newheight )-80)+"px";
		//sidebg.style.height = parseInt( bgheight )+"px";
	} else {
/*		logo.style.marginTop = "490px";
		midheight = side.offsetHeight - top.offsetHeight - btm.offsetHeight;
		midheight = top.offsetHeight - btm.offsetHeight;
		mid.style.height = parseInt( midheight )+"px";
		sidebg.style.height = parseInt( side.offsetHeight )+"px";*/
	}
}

function focusOn( field ){
	document.contactform[ field ].focus();
}

function enterSecure(){
	clearInterval( secureInt );
}

function leaveSecure(){
	secureInt = setInterval( "hideSecure()",1000 );
}

function displaySecure(){
	div = document.getElementById( 'secure_menu' );
	if( div.style.display == 'none' ){
		div.style.display = 'block';
	} else {
		div.style.display = 'none';
	}
}

function hideSecure(){
	clearInterval( secureInt );
	div = document.getElementById( 'secure_menu' );
	if( div.style.display == 'block' ) div.style.display = 'none';
}
