// JavaScript Document

var good;

	function checkEmailAddress(field) {
	
		var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
		
		if (goodEmail) {
			good = true;
		}
		else {
			alert('Please enter a valid address.');
			field.focus();
			field.select();
			good = false;
		}		
	}			
	
	function mailThisUrl() {
		
		var initialsubj="Check out Fashion4Nerds.com!"
		var initialmsg="Hey Nerd! :)   The sender of this email thinks you should check out this site, http://www.fashion4nerds.com, to see if YOU need a fashion overhaul. The site polled over 30 women about what they liked and disliked about current male fashion, particularly with respect to Nerds and Geeks. The results may surprise you!";
		
		good = false		
		checkEmailAddress(document.eMailer.email);
				
		if (good) {
			window.location = "mailto:"+document.eMailer.email.value+"?subject="+initialsubj+"&body="+initialmsg
		}
	}


	function toggleQuestion(tName, qName, aName)
  	{
        var title = document.getElementById(tName);	// selects the row
        if (title == null) return;
		
        var ans = document.getElementById(aName);	// gets answer name
        if (ans == null) return;
		
        var que = document.getElementById(qName);	// gets question
		
        //if (ans.style.display == '')
        //{
       	//	ans.style.display = 'none';	// display = 'none' mean element is hidden
        //}
        //else
        //{
        	ans.style.display = '';
        //}
	}
	