// detect browser
var detect = navigator.userAgent.toLowerCase();


function changeTableRow( table, row, column, image1, image2Src, image2, stly, mousec ) {
   
   document.getElementById(table).rows[row].cells[column].className=stly;
   document.getElementById(image2Src).src=image2;

   if (checkBrowser('msie')) {
      document.getElementById(table).style.cursor = mousec;
      document.getElementById(table).background=image1;	  
   }
   else {
     document.getElementById(table).setAttribute("background", image1 );
	 if ( mousec == 'hand' ) {
	   document.getElementById(table).style.cursor = "pointer";
	 }
	 else
       document.getElementById(table).setAttribute("cursor", mousec );
   }
}

function checkBrowser(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function openWindows( GoToThisURL ) {
	window.open(GoToThisURL,"infoWin","width=600,height=500,scrollbars=1,top=100,left=100");
}

function ValidaSearchFields( f ) {

  var errorMsg = "You need at less 5 characters to perform a search";
  var minCars = 5;
  
  if ( f.searchBy.value == 'Member' ) {
     if ( f.memberName.value.length < minCars ) {
	    alert(errorMsg);
		return false;
	 }
  }
  else
  if ( f.searchBy.value == 'Area' ) {
     if ( f.area.value.length < minCars ) {
	    alert(errorMsg);
		return false;
	 }
  }

  return true;
 // function to Validate Search
}