function initPage() {
	setHeight();
	window.onresize = function(){setHeight();}
	loadRollover();
}

function loadRollover() {
	var preload0 = new Image;
	preload0.src = '/cdf/images/nav-bar-shim-over.gif';
}

blogbutton = new Object;
function initBlogButton(bbstart) {
	blogbutton = document.getElementById('topblogbutton');
	blogbutton.pushup = pushUp;
	blogbutton.xpos = 0;
	blogbutton.ypos = 41;
	if (bbstart) {
		blogbutton.style.left = '0px';
		blogbutton.style.top = '41px';
		blogbutton.style.visibility = 'visible';
		for(var i = 0; i < 41; i++) {
			setTimeout("blogbutton.pushup()", ((i * 30) + bbstart));
		}
	} else {
		blogbutton.style.left = '0px';
		blogbutton.style.top = '0px';
		blogbutton.style.visibility = 'visible';
	}
}

function pushUp() {
	if (this.ypos) {
		this.ypos -= 1;
		this.style.left = this.xpos + 'px';
		this.style.top = this.ypos + 'px';
	}
}

function setHeight() {
	var string1, string2;
	if (document.all) {
		string1 = "document.all['";
		string2 = "']";
	} else if (document.getElementById) {
		string1 = "document.getElementById('";
		string2 = "')";
	}

	myHeight = 0;
	if(document.documentElement && document.documentElement.clientHeight) {
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	} else if(document.body && document.body.clientHeight) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	} else if( typeof( window.innerHeight ) == 'number' ) {
		//Non-IE
		myHeight = window.innerHeight;
	}

	var fullpage = eval(string1 + "fullpage" + string2);
	var topsection = eval(string1 + "topsection" + string2);
	var bottomsection = eval(string1 + "bottomsection" + string2);
	var topdeco = eval(string1 + "topdeco" + string2);
	var maincontenttbl = eval(string1 + "maincontenttbl" + string2);

	if (fullpage.offsetHeight < myHeight) {
		maincontenttbl.style.height = (myHeight - (topsection.offsetHeight + topdeco.offsetHeight)) + 'px';
	}
}

function isblank(s) {
	for (var i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if ((c != ' ') && (c != '\n') && (c != '\t'))
			return(false);
	}
	return(true);
}

function quoteVerify(quote) {
	var string1, string2;
	if (document.all) {
		string1 = "document.all['";
		string2 = "']";
	} else if (document.getElementById) {
		string1 = "document.getElementById('";
		string2 = "')";
	}

	var q;
	var errors;
	for (var i = 0; i < quote.length; i++) {
		q = quote.elements[i];
		if (q.name == 'contactname') {
			if ((q.value == null) || (q.value == '') || isblank(q.value)) {
				var elem = eval(string1 + "rqdname" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		} else if (q.name == 'request') {
			if ((q.value == null) || (q.value == '') || isblank(q.value) || (q.value == 'Enter a summary of your project.')) {
				var elem = eval(string1 + "rqdrequest" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		} else if (q.name == 'email') {
			if ((q.value == null) || (q.value == '') || isblank(q.value)) {
				var elem = eval(string1 + "rqdemail" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		} else if (q.name == 'mv_captcha_guess') {
			if ((q.value == null) || (q.value == '') || isblank(q.value)) {
				var elem = eval(string1 + "rqdcode" + string2);
				elem.style.color = 'red';
				errors = true;
			}
		}
	}

	if (errors) {
		var elem = eval(string1 + "quoteerror" + string2);
		elem.style.display = "inline";
		elem.style.visibility = "visible";
		return(false);
	}
}

