// JavaScript Document

function getQryStr(variable) {

  var qry = window.location.search.substring(1);
  var vrs = qry.split("&");

  for (var i=0;i<vrs.length;i++) {

  var pair = vrs[i].split("=");

	if (pair[0] == variable) {
      return pair[1];
    }

  }

}


function showSubmit(disable) {
	//safe function to show an element with a specified id

	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(disable).style.display = 'block';
	}

}

function hideSubmit(disable) {
	//safe function to show an element with a specified id

	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(disable).style.display = 'none';
	}

}

function checkForm(disable) {

	var FirstName = document.subscribeForm.elements['First Name'].value;
	var LastName = document.subscribeForm.elements['Last Name'].value;

	document.subscribeForm.elements['Full Name'].value = FirstName +" "+ LastName;

	if (document.subscribeForm.elements['Email Address'].value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) {

		document.subscribeForm.elements['Email Address'].blur();
		document.subscribeForm.elements['Email Address'].className = "fieldsizeok";

	} else {

		document.subscribeForm.elements['Email Address'].focus();
		document.subscribeForm.elements['Email Address'].className = "fieldsizeerr";
		hideSubmit(disable);

	return false;
	}



	if (document.subscribeForm.elements['SubAction'].checked) {

		showSubmit(disable);

		return true;

	} else {

		document.subscribeForm.elements['SubAction'].focus();
		hideSubmit(disable);

	return false;
	}

}
