  /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 File: ajaxclientfx.js
 Purpose: 
 1. Contains client side javascript AJAX functions calls
 2. Contains javascript to toggle phone# visibility 
 Date     Name        Description
 8/25/06 erbjorkman  Initial creation
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
     var phone_state = 'hidden';
	function showhide(layer_ref)
	/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Purpose: Toggles client phone# to visible onclicking phone link
	Date     Name        Description
	8/25/06 erbjorkman  Initial creation
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
	{
		if (phone_state == 'hidden') 
		{
		phone_state = 'visible';
		}

		if (document.all) 
		{ //IS IE 4 or 5 (or 6 beta)
		eval( "document.all." + layer_ref + ".style.visibility = phone_state");
		}
		
		if (document.layers) 
		{ //IS NETSCAPE 4 or below
		document.layers[layer_ref].visibility = phone_state;
		}
		
		if (document.getElementById && !document.all) 
		{
		maxwell_smart = document.getElementById(layer_ref);
		maxwell_smart.style.visibility = phone_state;
		}
	}
    function logclick(url)
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Purpose: Asynchronous AJAX call to logclick to insert click
	Date     Name        Description
	8/25/06 erbjorkman  Initial creation
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
    {
	  //known bug. ajax agent drops querystring params after an ampersand. querystrings must 
	  //custom encoded on the client then similarly decoded on the server
      url = replace(url,'&','||')
      //alert(url);

      agent.call('','logclick','',url);
      //agent.call('','logclick','callback_logclick',url);
    }
    function replace(string_source,find_string,replace_string)
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Purpose: String replace 
	Date     Name        Description
	8/25/06 erbjorkman  Initial creation
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
    {
		while(string_source.indexOf(find_string) > -1)
		{
		string_source = string_source.replace(find_string,replace_string);
		}
		return string_source;
	}