/*  This script is required to be server-parsed by an SSI engine */

var remote_ip = '<!--#echo var="REMOTE_ADDR"-->'
var taggedSubnets = new Array('^129\.73\.', '^194\.174\.230\.', '^193\.189\.231\.', '^213\.70\.119\.', '^213\.70\.98\.', '^195\.125\.167\.', '^212\.118\.217\.' );

// This function returns 1 to indicate the logo should rotate
// This should only happen if the visitors browser is NOT from an IP that
// matches the above list of subnet regular expressions
function logoRotates()
{
	if ( inSubnet( remote_ip, taggedSubnets ) )
	{
		return 0;
	}
	else
	{
		return 1;
	}
}

// This function determines if a given IP address matches a set of IP 
// subnets (given as an array of regular expressions)
function inSubnet(ip, subnetMatchArray)
{

	for(var i = 1; i < subnetMatchArray.length; i++)
	{
		if ( ip.match(subnetMatchArray[i]) != null )
		{
			return true;
		}
	}

	return false;
}