function showTestimonial(index, cnt)
{
   for (i=1; i<=cnt; i++)
   {
      _tl = document.getElementById("testimonial_lead_"+i);
      _tt = document.getElementById("testimonial_text_"+i);
      _ts = document.getElementById("testimonial_sender_"+i);
      if (_tl)
          _tl.style.display = ((i==index)?"none":"block");
      if (_tt)
          _tt.style.display = ((i==index)?"block":"none");
      if (_ts)
          _ts.style.display = ((i==index)?"block":"none");
   }
}
function showElementEx(sender, objectName, leaveVisible)
{
   var show_obj = document.getElementById(objectName);
   if (show_obj)
   {
      if (leaveVisible != true)
         sender.style.display = 'none';
      show_obj.style.display  = 'block';
   }
}
function hideElement(objectName)
{
   var hide_obj = document.getElementById(objectName);
   if (hide_obj)
       hide_obj.style.display = 'none';
}
function showHideElement(objectName)
{
   var _obj = document.getElementById(objectName);
   if (_obj)
   {
       _obj.style.display = (_obj.style.display!='block')?'block':'none';
       return _obj.style.display;
   }
   else
       return false;
}

function fullScr(mode)
{
   var _obj = document.getElementById('menu'); 
   var _fobj = document.getElementById('flashcontent');
   if (_obj && _fobj) 
   {
      _obj.style.display = ((mode=='yes')?'none':'block');
      if (mode=='yes')
         _fobj.style.marginLeft = '-100px';
      else            
         _fobj.style.marginLeft = '-50px';
   }
   
}

//added for telephone # formatting
function fmttel(t){
	var patt = /(\d{3}).*(\d{3}).*(\d{4})/;
	var donepatt = /^(\d{3})-(\d{3})-(\d{4})/;
	var str = t.value;
	var result;

	if (!str.match(donepatt)){

	result = str.match(patt);

		if (result!= null){
			t.value = t.value.replace(/[^\d]/gi,'');
			str = result[1] + '-' + result[2] + '-' + result[3];
			t.value = str;
		}
		else{
		if (t.value.match(/[^\d]/gi)){
			t.value = t.value.replace(/[^\d]/gi,'');
			}
		}
	}
}
