function toggleSnav(navNumber) {
	if (document.getElementById) {
		for (i = 1; i <= 2; i++) {
			if ('l' + navNumber == 'l' + i) {
				document.getElementById('l' + i).className = 'lnav-select';
			}
			else {
				document.getElementById('l' + i).className = 'lnav';
			}
			if ('subnav' + navNumber == 'subnav' + i) {
				document.getElementById('subnav' + i).style.display = 'block';
			}
			else {
				document.getElementById('subnav' + i).style.display = 'none';
			}
		}
	}
}

function selectSnav1(navNumber) {
	if (document.getElementById) {
		for (i = 1; i <= 7; i++) {
			if ('s1' + navNumber == 's1' + i) {
				document.getElementById('s1' + i).className = 'snav-select';
			}
			else {
				document.getElementById('s1' + i).className = 'snav';
			}
		}
	}
}

function selectSnav2(navNumber) {
	if (document.getElementById) {
		for (i = 1; i <= 4; i++) {
			if ('s2' + navNumber == 's2' + i) {
				document.getElementById('s2' + i).className = 'snav-select';
			}
			else {
				document.getElementById('s2' + i).className = 'snav';
			}
		}
	}
}

function showRolloverBox() {
	if (document.getElementById) {
    	document.getElementById('rollover-box').style.margin = '-15px 0 0 0';
		document.getElementById('rollover-box').style.display = 'block';
	}
}

function hideRolloverBox() {
	if (document.getElementById) {
		document.getElementById('rollover-box').style.display = 'none';
	}
}

function showRSSBox() {
	if (document.getElementById) {
   		document.getElementById('rss-box').style.margin = '-276px 0 0 220';
		document.getElementById('rss-box').style.display = 'block';
	}
}

function hideRSSBox() {
	if (document.getElementById) {
		document.getElementById('rss-box').style.display = 'none';
	}
}
function showRSSBoxTOP() {
	if (document.getElementById) {
   		document.getElementById('rss-boxTOP').style.margin = '5 0 0 314px';
		document.getElementById('rss-boxTOP').style.display = 'block';
	}
}

function hideRSSBoxTOP() {
	if (document.getElementById) {
		document.getElementById('rss-boxTOP').style.display = 'none';
	}
}
function checkLogin() {
	if (document.login.user.value.length < 1) {
		if (document.getElementById) {
			document.getElementById('login').style.padding = '64px 205px 17px 220px';
			document.getElementById('login-error').style.display = 'block';
		}
		document.login.user.focus();
		return false;
	}
	if (document.login.pw.value.length < 1) {
		if (document.getElementById) {
			document.getElementById('login').style.padding = '64px 205px 17px 220px';
			document.getElementById('login-error').style.display = 'block';
		}
		document.login.pw.focus();
		return false;
	}
	return true;
}

function isEmailAddr(Email)
{
  var result = false;
  var theStr = new String(Email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
  result = true;
  }
  return result;
}

function validEmail(formField)
{
  var result = true;

  if (result && ((formField.value.length < 3) || !isEmailAddr(formField.value)) )
  {
    result = false;
  }
   
  return result;

}

function checkContact() {
	if (document.contact.fname.value.length < 1) {
		if (document.getElementById) {
			document.getElementById('contact-error').style.display = 'block';
			document.getElementById('contact-error-span').style.display = 'block';
			document.getElementById('fname').style.color = '#cc0000';
			document.getElementById('contact-error-span').innerHTML = ('* Please enter a value in the First Name field');
			document.getElementById('Button1').src = '../images/button-submit-error.gif';
			}
		document.contact.fname.value = 'Please enter your first name here';
		return false;
	}
	if (document.contact.company.value.length < 1) {
		if (document.getElementById) {
			document.getElementById('contact-error').style.display = 'block';
			document.getElementById('contact-error-span').style.display = 'block';
			document.getElementById('company').style.color = '#cc0000';
			document.getElementById('contact-error-span').innerHTML = ('* Please enter a value in the Company field');
			document.getElementById('Button1').src = '../images/button-submit-error.gif';
		}
		document.contact.company.value = 'Please enter your company\'s name here';
		return false;
	}
//	/////////////////////country//////////////////
//	if (document.contact.country.options[0].selected) {
//		if (document.getElementById) {
//			document.getElementById('contact-error').style.display = 'block';
//			document.getElementById('contact-error-span').style.display = 'block';
//			document.getElementById('contact-error-span').innerHTML = ('* Please selct a country from the dropdown menu');
//			document.getElementById('imgButton').src = '../images/button-submit-error.gif';
//		}
//		document.contact.country.focus();
//		return false;
//	}
//	//////////////////////
//	
	
	if (document.contact.subj.value=='Other' && document.contact.subject2.value=='') {
	    if (document.getElementById) {
			document.getElementById('contact-error').style.display = 'block';
			document.getElementById('subject2').style.color = '#cc0000';
			document.getElementById('contact-error-span').style.display = 'block';
			document.getElementById('contact-error-span').innerHTML = ('* Please select a subject or specify custom subject');
			document.getElementById('Button1').src = '../images/button-submit-error.gif';
		}
		document.contact.subject2.focus();
		return false;
	}
	if (document.contact.comments.value == '') {
		if (document.getElementById) {
			document.getElementById('contact-error').style.display = 'block';
			document.getElementById('contact-error-span').style.display = 'block';
			document.getElementById('contact-error-span').innerHTML = ('* Please enter your comment(s) or question(s) in the box below');
			document.getElementById('Button1').src = '../images/button-submit-error.gif';
		}
		document.contact.comments.focus();
		return false;
	}
	return true;
}



