/* ================================================================ 
This copyright notice must be untouched at all times.

The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/various/tabbed_pages.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */


function tabs() {
	var e, i = 0;

	while (e = document.getElementById('gallery').getElementsByTagName ('DIV') [i++])
	{
		if (e.className == 'on' || e.className == 'off')
		{
			e.onclick = function () {

				var getEls = document.getElementsByTagName('DIV');
					for (var z=0; z<getEls.length; z++) {
					getEls[z].className=getEls[z].className.replace('show', 'hide');
					//getEls[z].className=getEls[z].className.replace('on', 'off');
					}

				this.className = 'on';
				var max = this.getAttribute('title');
				
				document.getElementById(max).className = "show";

				var statTest = max.indexOf('_stats');
				
				if(statTest == -1)
				{
					var trafficReportingURL = 'http://www.hotwatercasino.com/TheShow/starReport.cgi?access_by=direct&starName=' + max;
					var logTraffic = getURL(trafficReportingURL);
				}
			}
		}
	}
}

function getURL(passURL)
{
	var browserName = navigator.appName;
	var browserVer  = parseInt(navigator.appVersion);
	var req = '';

	if (browserName == "Microsoft Internet Explorer")
	{
		if(browserVer <= 4)
		{
			req = new ActiveXObject("Microsoft.XMLHTTP");
		}
		else
		{
			req = new XMLHttpRequest();
		}
	}
	else
	{
		req = new XMLHttpRequest();
	}

	req.open('GET',passURL, false);
	req.send(null);

	var urlResult = ''

	if(req.status == 200)
	{
		urlResult = req.responseText;
	}

	return urlResult;
}


