
function get_page_size() {
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
  	}
	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	return arrayPageSizeWithScroll;
}

function expand_page() {
	var content_dimesions=get_page_size();
	document.getElementById('outer_container_id').style.height=content_dimesions[1]+'px';
	document.getElementById('inner_container_id').style.height='100%';
}

function show_gb_form() {
	document.getElementById('form').style.display='';
	document.getElementById('link').style.display='none';
	expand_page();
}

function show_form (form_id) {
	$(form_id).style.display='block';
	expand_page();
}

function character_count(max_count) {
	var used=document.getElementById('description').value.length;
	if (used>max_count) {
		document.getElementById('description').value=document.getElementById('description').value.substring(0,max_count);
	}
	var remaining=max_count-document.getElementById('description').value.length;
	document.getElementById('character_display').innerHTML=remaining+' charaters remaining';
}
