<!--
var vCompanyList = '';

function SwapImage(img,path)
{
	docuemtn.getElementById(img).src = path;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
// Misc
//////////////////////////////////////////////////////////////////////////////////////////////////////////
function notYet()
{
	alert("This feature is not yet activated");
}
function stripSpaces(searchTerm)
{
	/* Strip our searchTerm from all extra spaces that makes the keyword search crash */
	while (searchTerm.value.substring(0,1) == ' ')
	{
		searchTerm.value = searchTerm.value.substring(1, searchTerm.value.length);
	}	
	var c, charplus1;
	for (var i=0; i < searchTerm.value.length-1; i++)
	{
		c      = searchTerm.value.substring(i, i+1);
		charplus1 = searchTerm.value.substring(i+1, i+2);
		if (c == ' ' && charplus1 == ' ')
		{
			searchTerm.value = searchTerm.value.substring(0, i) + searchTerm.value.substring(i+1, searchTerm.value.length);
			i--;
		}	
	}	
	while (searchTerm.value.substring(searchTerm.value.length-1, searchTerm.value.length) == ' ')
	{
		searchTerm.value = searchTerm.value.substring(0, searchTerm.value.length-1);
	}	
	/***************************************************************************************/
}
function stripSpecialChars(str)
{
	/* Escape all special characters from str that makes the mail form crash */
	var c;
	for (var i=0; i < str.length; i++)
	{
		c = str.substring(i, i+1);
		if (c == '&')
		{
			str = str.substring(0, i) + 'and' + str.substring(i+1, str.length); i++;
		}
		else if (c == '^')
		{
			str = str.substring(0, i) + '\'' + str.substring(i+1, str.length);
		}				
		else if (c == "'")
		{
			str = str.substring(0, i) + '\'' + str.substring(i+1, str.length);
		}
	}
	return str;
	/***************************************************************************************/
}


// called from the email links, calling the asp email popup
function goToMailForm(str,mail)
{
	str = stripSpecialChars(str);
	//window.open('http://www.almexperts.com/ExpertWitness/EmailExpert.asp?recipient=' + str + '&mail=' + mail,'new_window','width=400,height=560,scrollbars=no');
	window.open('http://solis2.365media.com/ExpertWitness/EmailExpert.asp?recipient=' + str + '&mail=' + mail,'new_window','width=410,height=490,scrollbars=no');
}

// checking if the minimum number of characters has been entered before launching the search
function validateSrchString(srchTyp)
{
	if(srchTyp == 'basic' && document.forms['frmKeywordSearch'].keyword.value.length < 3)
	{
		alert('Please enter 3 characters minimum');
		document.forms['frmKeywordSearch'].keyword.focus();
		return false;
	}
	else if(srchTyp == 'lnBasic' && document.forms['frmLNSearch'].keyword.value.length <3)
	{
		alert('Please enter 3 characters minimum');
		document.forms['frmLNSearch'].keyword.focus();
		return false;
	}
	else if(srchTyp == 'advanced')
	{
		var totalLength = 0;
		
		if(document.forms['frmAdvancedSearch'].geo.value.length > 0) totalLength += 3;
		if(document.forms['frmAdvancedSearch'].loc.value.length > 0) totalLength += 3;
		totalLength += document.forms['frmAdvancedSearch'].aoe.value.length;
		totalLength += document.forms['frmAdvancedSearch'].company.value.length;
		totalLength += document.forms['frmAdvancedSearch'].first.value.length;
		totalLength += document.forms['frmAdvancedSearch'].last.value.length;
		totalLength += document.forms['frmAdvancedSearch'].keyword.value.length;
		
		if(totalLength < 3)
		{
			alert('Please enter 3 characters minimum and/or choose a state location');
			return false;
		}
	}
}

// submit a valid search category (actual category has been selected, not the 'Please Select' value list header
function submitValidSrchCategory()
{
	if(document.forms['frmLNcatSearch'].keyword.value != 'pleaseSelect')
	{
		document.forms['frmLNcatSearch'].submit();
	}
}
//-->