/* <![CDATA[ */
function submitForm(input)
{
// create dom form object
//var f = getForm('POST', 'http://www.house.gov/htbin/wrep_findrep');
var f = getForm(input.form.method, input.form.action);

// create dom hidden field objects and attach to form
for (var e in input.data)
{
f.appendChild(getHiddenField(e,input.data[e]));
}
var myTextField = document.getElementById('eadd');

f.appendChild(copyEA(myTextField.value));
// attach form to page dom (after the main form because forms cannot be nested).
document.body.appendChild(f);
// call submit() on the form
f.submit();
}

function getForm(method, action, textInput)
{
var f = document.createElement('form');
f.setAttribute('method', method);
f.setAttribute('action', action);

return f;
}
function getHiddenField(key, value)
{

var i = document.createElement('input');
i.setAttribute('type', 'hidden');
i.setAttribute('name', key);
i.setAttribute('value', value);
return i;

}
function copyEA(value)
{

var j = document.createElement('input');
j.setAttribute('type', 'hidden');
j.setAttribute('name', 'ea');
j.setAttribute('value', value);
return j;

}



/* the following adds wmode transparent to the Flash Calendar module in the Sidebar */


// Function to toggle items open and closed

//function toggle(theDiv,theImg) {
	function toggle(theDiv1,theDiv2) {
	//	alert(theDiv1);
    var elem1 = document.getElementById(theDiv1);
		var elem2 = document.getElementById(theDiv2);
//    var img = document.images[theImg];
//    var plusSrc = "/Portals/0/Skins/gsnetx/images/collapse.gif";
//    var minusSrc = "/Portals/0/Skins/gsnetx/images/expand.gif";
    elem1.style.display = (elem1.style.display == "none")?"":"none";
    elem2.style.display = (elem2.style.display == "none")?"":"none";
//	img.src = (elem.style.display != "none")?minusSrc:plusSrc;
	}

// FUNCTION TO RESTRICT FIELD IN INPUT TO ONLY NUMBERS AND SPECIAL CHARACTERS.
// 1 ALLOWS NUMBERS AND PERIODS ONLY.
// 2 ALLOWS NUMBERS AND DASHES ONLY.
// 3 ALLOWS NUMBERS, PERIODS AND DASHES
// 4 ALLOWS ONLY NUMBERS.
	function onlyNumbers(negs) 
	{
		var e = event || evt; // for trans-browser compatibility
		var charCode = e.which || e.keyCode;
		if (negs == 1) {
			if ((charCode < 48 || charCode > 57) & (charCode != 46)) 
			return false;
		} else if (negs == 2) {
			if ((charCode < 48 || charCode > 57) & (charCode != 45)) 
			return false;
		} else if (negs == 3) {
			if ((charCode < 48 || charCode > 57) & (charCode != 45) & (charCode != 46)) 
			return false;
		} else {
			if (charCode < 48 || charCode > 57)
			return false;
		}
		return true;
	}

	function clearZipCode(theField) {
//		if (theField.defaultValue==theField.value)
			document.getElementById(theField).value = ""
//}
	}

function __doExternalPost(targetUrl) {
   theForm.encoding = "application/x-www-form-urlencoded";
   theForm.action = targetUrl;
   theForm.submit();
}

/* ]]> */


