function prepareImageSwap(elem,mouseOver,mouseOutRestore,mouseDown,mouseUpRestore,mouseOut,mouseUp) { 
//This allows for image rollover effects
    if (typeof(elem) == 'string') elem = document.getElementById(elem); 
    if (elem == null) return; 
    var regg = /(.*)(_nm\.)([^\.]{3,4})$/ 
    var prel = new Array(), img, imgList, imgsrc, mtchd; 
    imgList = elem.getElementsByTagName('img'); 
    for (var i=0; img = imgList[i]; i++) { 
        if (!img.rolloverSet && img.src.match(regg)) { 
            mtchd = img.src.match(regg); 
            img.hoverSRC = mtchd[1]+'_hv.'+ mtchd[3]; 
            img.outSRC = img.src; 
            if (typeof(mouseOver) != 'undefined') { 
                img.hoverSRC = (mouseOver) ? mtchd[1]+'_hv.'+ mtchd[3] : false; 
                img.outSRC = (mouseOut) ? mtchd[1]+'_ou.'+ mtchd[3] : (mouseOver && mouseOutRestore) ? img.src : false; 
                img.mdownSRC = (mouseDown) ? mtchd[1]+'_md.' + mtchd[3] : false; 
                img.mupSRC = (mouseUp) ? mtchd[1]+'_mu.' + mtchd[3] : (mouseOver && mouseDown && mouseUpRestore) ? img.hoverSRC : (mouseDown && mouseUpRestore) ? img.src : false; 
                } 
            if (img.hoverSRC) {preLoadImg(img.hoverSRC); img.onmouseover = imgHoverSwap;} 
            if (img.outSRC) {preLoadImg(img.outSRC); img.onmouseout = imgOutSwap;} 
            if (img.mdownSRC) {preLoadImg(img.mdownSRC); img.onmousedown = imgMouseDownSwap;} 
            if (img.mupSRC) {preLoadImg(img.mupSRC); img.onmouseup = imgMouseUpSwap;} 
            img.rolloverSet = true; 
        } 
    } 
    function preLoadImg(imgSrc) { 
        prel[prel.length] = new Image(); prel[prel.length-1].src = imgSrc; 
    } 
} 
function imgHoverSwap() {this.src = this.hoverSRC;} 
function imgOutSwap() {this.src = this.outSRC;} 
function imgMouseDownSwap() {this.src = this.mdownSRC;} 
function imgMouseUpSwap() {this.src = this.mupSRC;}


function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
     var xmlHttp = getXMLHttp();

xmlHttp.onreadystatechange = function()
  {
    if(xmlHttp.readyState == 4)
    {
      HandleResponse(xmlHttp.responseText);
    }
  }

xmlhttp.open("GET", "http://www.box-six.com/inquire.php", true);
xmlhttp.send(null); try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        alert("Your browser does not support AJAX!")
        return false;
      }
    }
  }
  return xmlHttp;
}





function checkAndSubmit(){
	//This function handles the "Submit" button
	//The variables represent field value lengths to verify that required fields are filled
	//If not, it displays the inline error text.

var xmlHttp = getXMLHttp();


	gName=document.getElementById('GroupName').value.length;
	dName=document.getElementById('DirectorName').value.length;
	eAdd=document.getElementById('EmailAddress').value.length;
	vAdd=document.getElementById('VerifyEmail').value.length;

url = "http://www.box-six.com/inquire.php?title=";
url = url +document.getElementById('ShowTitle').value + "&groupname="+document.getElementById('GroupName').value;
url = url + "&directorname="+document.getElementById('DirectorName').value + "&email="+document.getElementById('EmailAddress').value;
url = url + "&verifyemail="+document.getElementById('VerifyEmail').value + "&city="+document.getElementById('City').value;
url = url + "&state="+document.getElementById('State').value + "&circuit="+document.getElementById('Circuit').value;
url = url + "&class="+document.getElementById('Class').value;



	if(gName=="0"||dName=="0"||eAdd=="0"||vAdd=="0")
	{
		document.getElementById('errorText').style.display='block';
	}
	else
	{
		document.getElementById('successText').style.display='block';
		document.getElementById('errorText').style.display='none';

		xmlHttp.onreadystatechange = function()
		  {
		    if(xmlHttp.readyState == 4)
		    {
		      //HandleResponse(xmlHttp.responseText);
		    }
		  }

		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);

		setTimeout("document.getElementById('showModal').style.display='none'",1500);
	}
}

function emailStore(){
       

       var xmlHttp = getXMLHttp();
       
        vemail=document.getElementById('emailThanks').value;
	
	url = "http://www.box-six.com/insert.php?email=";	
	url = url + document.getElementById('emailThanks').value;



	
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);
        document.getElementById('emailThanks').innerHTML="<b>thanks- we'll keep in touch!</b>";	
		
	
	
}

function thanksAndClose(){

        var xmlHttp = getXMLHttp();
       
        	
	url = "http://www.box-six.com/insert.php?email=";	
	url = url + document.getElementById('KeepUpdatedEmail').value;

url = "http://www.box-six.com/insert.php?email=";
url = url +document.getElementById('KeepUpdatedEmail').value + "&fname="+document.getElementById('KeepUpdatedFName').value;
url = url + "&lname="+document.getElementById('KeepUpdatedLName').value;


                xmlHttp.onreadystatechange = function()
		  {
		    if(xmlHttp.readyState == 4)
		    {
		      //HandleResponse(xmlHttp.responseText);
		    }
		  }

	
		xmlHttp.open("GET", url, true);
		xmlHttp.send(null);
       

	setTimeout("document.getElementById('emailForm').style.display='none'",1500);
	
}

function openLogin(url){
	loginWindow = window.open(url,'Login','top=50,left=50,width=1000,height=600,toolbar=no,location=no,menubar=no,location=no,status=no,resizable=yes,scrollbars=yes');
	}