function swapImage(oldImage, newImage) { var oldImage = document.getElementById(oldImage).src = 'images/'+newImage; }

function ValidatorClient(theForm)
{
  if ((document.getElementById(theForm).clientcode.value == 0) || (document.getElementById(theForm).clientcode.value == "enter client code"))
  {
    alert("Please enter a proposal code.");
    document.getElementById(theForm).clientcode.value = '';
				document.getElementById(theForm).clientcode.focus();
    return (false);
  }
document.getElementById(theForm).submit();
}

function ValidateForm(theForm)
{
specified_form = document.getElementById(theForm); 

	switch (theForm) {
	
		case "submit_article":
		
		if(specified_form.article_title_field.value == '') {
					alert('Please fill in the "Article Title" field.');
					specified_form.article_title_field.focus();
					return (false);
					}
			
		if(specified_form.comments_field.value == '') {
					alert('Please fill in the "Comments" field.');
					specified_form.comments_field.focus();
					return (false);
					}
	
		return (true);
	
	} 
	<!-- end case -->

}

function submit_form(theForm) {
	validate_form = ValidateForm(theForm); <!-- make sure specified form validates -->
	specified_form = document.getElementById(theForm); 
	
	if(validate_form == true) {
				//alert('Thank you');
				}

	else {
				return false;
				}
}

function addBookmark(title,url) { 
 if (window.sidebar) { 
 	window.sidebar.addPanel(title, url,""); 
 } else if( document.all ) { 
 	window.external.AddFavorite(url, title); 
 } else if( window.opera && window.print ) { 
 	return true; 
	}
}

function submit_email() {
var email_address='';
	validate_email = ValidatorClient();
	if(validate_email == true) {
		email_address = document.getElementById('newsletter_field').value;
		http.open("GET", "submit_email.php?email_address="+email_address, true);
  http.onreadystatechange = handleHttpResponse;
		http.send(null);
	}
}

function handleHttpResponse() {
		results='';
		if (http.readyState == 4) {
    // Split the comma delimited response into an array
			results = http.responseText;
			if(results == 'found_no_match') {
			alert('Thank you for subscribing');
				x=0;
				var all_inputs = document.getElementById('newsletter_form').getElementsByTagName('input');
				while (all_inputs[x]) {
					all_inputs[x].disabled = true;
					x++;
				}
			}
			if(results == 'found_match') {
			alert('I\'m sorry, the e-mail address you provided is already in our database. Please enter a different one, thank you.');
			document.getElementById('newsletter_form').reset();
			newsletter_form.newsletter_field.focus();
			}
		}
http.close;
}

function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}
var http = getHTTPObject(); // We create the HTTP Object

