// JavaScript Document


function show(block){

  //display the section if it's not displayed; hide it if it is displayed 
var element;
element= document.getElementById(block);
  if (element.style.display=="none"){element.style.display=""}

  else{element.style.display="none"}

}


	function hideDiv(secNum) {
var idd = (secNum) ;
				
				var d = document.getElementById(idd);
				if(d.style.display == 'none')
				{    
					d.style.display = 'block';
					
				}
				else
					d.style.display= 'none' 



}
function CheckFormContact()
{
	var sEmpty = "";
	if (document.Form1.fname.value == "")
	{
		sEmpty = sEmpty + "- First Name\n";
	}
	
	if (document.Form1.Comments.value == "")
	{
		sEmpty = sEmpty + "- Comments\n";
	}
	
	if (document.Form1.Email.value == "" || document.Form1.Email.value == null)
	{
		sEmpty = sEmpty + "- Email\n";
	}
	else
	{
		if (document.Form1.Email.value.indexOf ('@',0) == -1 || document.Form1.Email.value.indexOf ('.',0) == -1)
			{
				sEmpty = sEmpty + "The E-Mail field requires a \"@\" and a \".\"be used. Please re-enter your E-Mail address.\n";
			}
	}
	
	
	
	if (sEmpty != "")
	{
			alert("Please Fill in the Following Fields: \n" + sEmpty);
			return false;
	}
	else
		return true;
}

function isRadioButtonChecked()
{
	var cnt = document.getElementsByName("rdEmail").length;
	//alert(cnt)
	for(var i=1; i <= cnt; i++)
	{
		var s = document.getElementById("chk"+i).checked;
		//alert(s)
		if(s==true)
			return true;				
	}
	return false;
}

function RemoveBadChars(fld) 
{ 

	strTemp = fld.value;
    strTemp = strTemp.replace(/\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-/g,"");
	


	fld.value = strTemp;
	
	return false;
  
} 


function chkfocus(box)
{

		box.value='';
	
}
function chktext(box)
{
if (box.value=='')
{
box.value='Search';
}
	
}
function checkstr()
{

if (document.getElementById("txtsearch").value=="" || document.getElementById("txtsearch").value=="Search")
{
alert("Enter text to search");
return false;

}	
else
{
return true;

}

}

function doClick(buttonName,e)
    {
//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
        var key;

         if(window.event)
              key = window.event.keyCode;     //IE
         else
              key = e.which;     //firefox
    
        if (key == 13)
        {
            //Get the button the user wants to have clicked
            var btn = document.getElementById(buttonName);
            if (btn != null)
            { //If we find the button click it
                btn.click();
                event.keyCode = 0
            }
        }
   }
   
   