
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ENP-PJH JavaScript Support File
	Purpose: Holds all Javascript code for ENP-PJH in the root directory.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AD IMAGE DISPLAY RANDOMIZER
	Purpose: Creates a random number to display rotation on ads.
	Date     Name        Description
	2/22/07  bjhansen    Added comments here for designation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
function ExecutePage(url) {
  if(window.XMLHttpRequest) {
    try { req = new XMLHttpRequest(); } catch(e) { req = false; }
  }
  else if(window.ActiveXObject)
  {
    try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {
    try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } }
  }

  if(req) {
    req.open("GET", url, true);
    req.send("");
  }
}

function randInt(min,max)
{
     var div = (max - min) + 1
     var randNum = Math.random()
     for (var i = 0; i <= div - 1; i++)
     {
          if (randNum >= i / div && randNum < (i+1) / div)
          {return i + min}
     }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PHONE NUMBER HIDING
	Purpose: Toggles client phone# to visible onclicking phone link
	Date     Name        Description
	8/25/06  erbjorkman  Initial creation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

var phone_state = 'hidden';
    
	function showhide(layer_ref)
	{
		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)
    {
        var ajaxManager = RadAjaxManager1;
        //alert(url);
        ajaxManager.AjaxRequest(url);
    }
