function validate(aform)    // the form is passed as a parameter
{
  
  //var N = parseInt(form.NUMFIELD.value);   // NOTE how to refer to 
                                           //  NUMFIELD in this example
	
                                           
  if ( aform.txtName.value =="")
  {
      alert("Please enter a value for the \"FirstName\"field.");
      aform.txtName.focus();
      return false;         // INVALID FORM, RETURN FALSE
  }
   if (aform.txtName.value.length < 2)
  {
      alert("Please enter at least 2 characters for the \"Name\"field.");
      aform.txtName.focus();
      return false;         // INVALID FORM, RETURN FALSE
  } 
		
if (aform.txtEmail.value.length < 2)
  {
      alert("Please enter a valid e-mail address.");
      aform.txtEmail.focus();
      return false;         // INVALID FORM, RETURN FALSE
  } 		
	
  return true;              // RETURN TRUE IF THE FORM IS VALID
  
}
function rightbar()
{ 

var strrightbar = "<td width='120' VALIGN='TOP'>";
var strrightbar = strrightbar + "<p><img src='http://ennelltech/chamber/images/nlcontent.jpg'></BR>";
var strrightbar = strrightbar + "<img src='http://ennelltech/chamber/images/eilogo.gif'></p>";
var strrightbar = strrightbar + "</td>";
document.write(strrightbar);
}

//Used to confirm an update
function confirmupdate(aform)
{
var agree=confirm("Are you sure you wish to update this record?");
if (agree)
	{
	aform.submit();
	return true;
	}
else
	{
	return false;
	}
	
}


function toptable()
{ 
if ((window.navigator.appName.indexOf("Microsoft")==0) & (window.navigator.appVersion.substring(0,1)>="4"))
	{ 
    var stylecolumn = "<table WIDTH='100%' cellspacing='5' CELLPADDING='0' BORDER='0' >";
	var stylecolumn = stylecolumn + "<tr><td colspan='5' Height='73' align='center'><img SRC='images/topbanner.jpg'></td></tr>";
    var stylecolumn = stylecolumn + "<TR><TD><table WIDTH='100%' cellspacing='0' CELLPADDING='0' BORDER='1' bordercolor='#034E00'><tr class='topnavlink' valign='top'>";
    var stylecolumn = stylecolumn + "<td width='20%' valign='top' align = 'center'  onclick=mclick('default.htm') onmouseover=mover() onmouseout=mout()>Home</td>"; 
    var stylecolumn = stylecolumn +  "<td width='20%' valign='top' align = 'center' onclick=mclick('default.asp') onmouseover=mover() onmouseout=mout()> News Section </td>"; 
    var stylecolumn = stylecolumn +  "<td width='20%' valign='top' align = 'center' onclick=mclick('contacts.asp?action=new') onmouseover=mover() onmouseout=mout()>Contact Us</td>";
    var stylecolumn = stylecolumn +  "<td width='20%' valign='top'  align = 'center' onclick=mclick('gaeilge.asp') onmouseover=mover() onmouseout=mout()> As Gaeilge </td> ";
    var stylecolumn = stylecolumn +  "</tr></table></td></tr></table>";
	}
else
	{
    var stylecolumn = "<table WIDTH='100%' cellspacing='5' CELLPADDING='0' BORDER='0' >";
	var stylecolumn = stylecolumn + "<tr><td colspan='5' Height='73' ><img SRC='images/topbanner.jpg' width='780'></td></tr>";
    var stylecolumn = stylecolumn + "<TR><TD><table WIDTH='780' cellspacing='0' CELLPADDING='0' BORDER='0' bordercolor='#034E00'><tr class='topnavlink' valign='top'>";
    var stylecolumn = stylecolumn + "<td width='20%' valign='top' class='topnavlink'><A href='homepage.htm'>Home</A></td>"; 
    var stylecolumn = stylecolumn + "<td width='20%' valign='top' class='topnavlink'><a href='default.asp'>News Section</a></td>"; 
    var stylecolumn = stylecolumn + "<td width='20%' valign='top' class='topnavlink'><a href='contacts.asp?action=new'>Contact Us</a></td>"; 
    var stylecolumn = stylecolumn + "<td width='20%' valign='top' class='topnavlink'><a href='gaeilge.asp'>As Gaeilge</a></td>"; 
    var stylecolumn = stylecolumn + "</tr></table></td></tr></table>"; 
	}
	document.write (stylecolumn);
}

function mclick(dest){
		window.location.href = dest;			 
	 }
function mover(){

	window.event.srcElement.style.backgroundColor = "#034E00"
	window.event.srcElement.style.color = "white"
	window.event.srcElement.style.cursor = "hand"	
	}
	
function mout(){
window.event.srcElement.style.backgroundColor = "white"
	window.event.srcElement.style.color =  "#034E00"
	window.event.srcElement.style.cursor = "default"

	}
function bottombar(){	
	var strbottombar = "<td valign='bottom' height='20'  align='center' > ";
	var strbottombar = strbottombar + "<table width='520' border='0'>";
    var strbottombar = strbottombar + "<table width='520' border='0'>";
	var strbottombar = strbottombar + "<tr>";
	var strbottombar = strbottombar + "<td width='127' height='15'></td>";
    var strbottombar = strbottombar + "<td width='169' height='15'></td>";
    var strbottombar = strbottombar + "<td width='20' height='15'></td>";
    var strbottombar = strbottombar + "<td width='190' height='15' class='bottombar'>Acc House,</td>";
	var strbottombar = strbottombar + "</tr>";
    var strbottombar = strbottombar + "<tr>";
    var strbottombar = strbottombar + "<td width='127' height='15' class='bottombar'>telephone:</td>";
    var strbottombar = strbottombar + "<td width='169' height='15'class='bottombar'>044-44044</td>";
    var strbottombar = strbottombar + "<td width='20' height='15'></td>";
    var strbottombar = strbottombar + "<td width='190' height='15' class='bottombar'>Dominick St.,</td>";
	var strbottombar = strbottombar + "</tr>";
    var strbottombar = strbottombar + "<tr>";
    var strbottombar = strbottombar + "<td width='127' class='bottombar'>fax:</td>";
    var strbottombar = strbottombar + "<td width='169' class='bottombar'>044-44045</td>";
    var strbottombar = strbottombar + "<td width='20' height='15'></td>";
    var strbottombar = strbottombar + "<td width='190' class='bottombar'>Mullingar,</td>";
    var strbottombar = strbottombar + "</tr>";
    var strbottombar = strbottombar + "<tr>";
    var strbottombar = strbottombar + "<td width='127' class='bottombar'>e-mail:</td>";
    var strbottombar = strbottombar + "<td width='169' class='bottombar'><a href='mailto:info@mullingar-chamber.ie'>info@mullingar-chamber.ie</a></td>";
    var strbottombar = strbottombar + "<td width='20' height='15'></td>";
    var strbottombar = strbottombar + "<td width='190' class='bottombar'>Co. Westmeath</td>";
    var strbottombar = strbottombar + "</tr>";
    var strbottombar = strbottombar + "</table></td>";
    document.write (strbottombar);
      }
      
function stylebar()
{
var topstyle = "<style>";
var topstyle = topstyle + "SPAN    {cursor: hand;color:midnightblue;type:arial;font:bold}";
var topstyle = topstyle + "A       {text-decoration: none}";
var topstyle = topstyle + "A:hover {color: red; text-decoration: underline}";  
var topstyle = topstyle + "</style>";
 document.write (topstyle);
 }
 