	function submitForm(sTask,sTaskID)
	{	
		if(checkEmail())
		{
			document.forms[0].task.value=sTask;
			document.forms[0].taskid.value=sTaskID;
			
			document.forms[0].count.value = parseInt(document.forms[0].count.value) + 1;
			
			document.forms[0].submit();
		}
	}


    function checkEmail(){ //reference to email field passed as argument

	
    var fieldValue = document.forms[0].email.value // store field's entire value in variable
    var fieldtxtName = document.forms[0].txtName.value
    var fieldMessage = document.forms[0].txtmessage.value
    
    if (fieldtxtName =="" )
    {
    alert("Name is a required field.")
    return false
    }    
     
     

    // Begin Valid Email Address Tests

    //if field is not empty
    if(fieldValue =="")
    {
    alert("E-mail address is a required field.")
    return false
    }
    if(fieldValue != ""){
    var atSymbol = 0

    //loop through field value string
    for(var a = 0; a < fieldValue.length; a++){

    //look for @ symbol and for each @ found, increment atSymbol variable by 1
    if(fieldValue.charAt(a) == "@"){
    atSymbol++
    }

    }

    // if more than 1 @ symbol exists
    if(atSymbol > 1){
    // then cancel and don't submit form
    alert("Please enter a valid e-mail address.")
    return false
    }

    // if 1 @ symbol was found, and it is not the 1st character in string
    if(atSymbol == 1 && fieldValue.charAt(0) != "@"){
    //look for period at 2nd character after @ symbol
    var period = fieldValue.indexOf(".",fieldValue.indexOf("@")+2)

    // "." immediately following 1st "." ?
    var twoPeriods = (fieldValue.charAt((period+1)) == ".") ? true : false

    //if period was not found OR 2 periods together OR field contains less than 5 characters OR period is in last position
    if(period == -1 || twoPeriods || fieldValue.length < period + 2 || fieldValue.charAt(fieldValue.length-1)=="."){
    // then cancel and don't submit form
    alert("Please enter a valid e-mail address.")
    return false
    }

    }
    // no @ symbol exists or it is in position 0 (the first character of the field)
    else{
    // then cancel and don't submit form
    alert("Please enter a valid e-mail address.")
    return false
    }
    }
    // if field is empty
    else{
    // then cancel and don't submit form
    alert("Please enter a valid e-mail address.")
    return false
    }
	if(fieldMessage =="")
    {
    alert("Message is a required field.")
    return false
    }
    //all tests passed, submit form
    //alert("VALID EMAIL ADDRESS!")
    return true
    }

//div function 
function showHide(sDivID, sColor)
	{
	var color="";
	var leftimg="";
	var Rightimg="";
	var bottomSpacer = "", leftimg_thin = "", Rightimg_thin = "";
	
	if (sColor=="green")
		{
			color="#009DB0";
			leftimg="left_bottom_green_curve.jpg";
			Rightimg="right_bottom_green_curve.jpg";			
			leftimg_thin="about_div_left_corner.gif";
			Rightimg_thin="about_div_right_corner.gif";				
			bottomSpacer = "about_div_bottom_spacer.gif";
		}
		else if(sColor=="blue")
		{
			color="#86B8D3";
			leftimg="left_bottom_blue_curve.jpg";
			Rightimg="right_bottom_blue_curve.jpg";
			leftimg_thin="blue_bottom_left_corner.jpg";
			Rightimg_thin="blue_bottom_right_corner.jpg";			
			bottomSpacer = "blue_bottom_spacer.jpg";
		}
		
	
		
		if(document.getElementById(sDivID).style.display == "none")
		{
			eval("document.getElementById('"+ sDivID +"').style.display = 'block'"); 
			eval("document.getElementById('TD_"+ sDivID +"').style.backgroundColor = 'white'"); 
			eval("document.getElementById('img_"+ sDivID +"').src = 'images/collapse_icon_"+ sColor +".jpg'"); 
			eval("document.getElementById('bottom_"+ sDivID +"').innerHTML = '<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">      <tr>      <td width=\"6\"><img src=\"images/"+ leftimg_thin +"\" ></td>        <td background=\"images/"+ bottomSpacer +"\"><img src=\"images/spacer.gif\" width=\"1\" height=\"8\"></td>        <td align=\"right\" width=\"6\"><img src=\"images/"+ Rightimg_thin +"\" ></td>      </tr>    </table>'");
			eval("document.getElementById('expandCollapse_img_"+ sDivID +"').src = 'images/collapse_"+ sColor +".jpg'"); 
		}
		else
		{
			
			eval("document.getElementById('"+ sDivID +"').style.display = 'none'"); 
			eval("document.getElementById('TD_"+ sDivID +"').style.backgroundColor = '"+ color +"'"); 
			eval("document.getElementById('img_"+ sDivID +"').src = 'images/expand_icon_"+ sColor +".jpg'"); 
			eval("document.getElementById('bottom_"+ sDivID +"').innerHTML = '<table width=\"100%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">      <tr>        <td width=\"6\"><img src= \"images/"+ leftimg +"\"></td>        <td bgcolor=\""+ color +"\"><img src=\"images/spacer.gif\" width=\"1\" height=\"5\"></td>        <td align=\"right\" width=\"6\"><img src= \"images/"+ Rightimg +"\"></td>      </tr>    </table>'");
			eval("document.getElementById('expandCollapse_img_"+ sDivID +"').src = 'images/expand_"+ sColor +".jpg'"); 
		}
	}
	
// div function end

//image  swap function
function swapImage(imageNumber)
{

	switch(imageNumber)
	{
		case 1:
		document.forms[0].img1.src = "images/Button_home_mo.gif";
		break;
		case 2:
		document.forms[0].img2.src = "images/compare_books_mo.gif";
		break;
		case 3:
		document.forms[0].img3.src = "images/exp_handbook_mo.gif";
		break;
		case 4:
		document.forms[0].img4.src = "images/top_twenty_mo.jpg";
		break;
	}
}

function restoreImage(imageNumber)
{
	switch(imageNumber)
	{
		case 1:
		document.forms[0].img1.src = "images/Button_home.gif";
		break;
		case 2:
		document.forms[0].img2.src = "images/compare_books.gif";
		break;
		case 3:
		document.forms[0].img3.src = "images/exp_handbook.gif";
		break;
		case 4:
		document.forms[0].img4.src = "images/top_twenty.jpg";
		break;
		
	}
}
//end


function doOpenPopWindow(FileNameWithPath,Title,Width,Height)
{

	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=250,top=150,scrollbars=no,resizable=no,status=no');
}
function doOpenPopWindow1(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=160,top=250,scrollbars=no,resizable=no,status=no');
}
function CheckMailConfirmation()
{
alert(document.forms[0].isConfirm.value);
	if(document.forms[0].isConfirm.value == "1")
	doOpenPopWindow1('Lunsford_Email_Confirmation.aspx', 'Lunsford_Handbooks', 680, 255);
}
		
function doOpenPopWindowWithScroll(FileNameWithPath,Title,Width,Height)
{
	window.open(FileNameWithPath,Title,'menubar=no,width='+Width+',height='+Height+',left=50,top=50,scrollbars=no,resizable=yes,status=no');
}