<!--


	var preloaded = new Array(16);
	var images = new Array(16);
	
	images[0] = 'zpimages/group_grey.png';
	images[1] = 'zpimages/grouptl_grey.png';
	images[2] = 'zpimages/grouptr_grey.png';
	images[3] = 'zpimages/groupbl_grey.png';
	images[4] = 'zpimages/groupbr_grey.png';
	images[5] = 'zpimages/group_white.png';
	images[6] = 'zpimages/grouptl_white.png';
	images[7] = 'zpimages/grouptr_white.png';
	images[8] = 'zpimages/groupbl_white.png';
	images[9] = 'zpimages/groupbr_white.png';
	images[10] = 'zpimages/navbgleft.png';
	images[11] = 'zpimages/navbgcentre.png';
	images[12] = 'zpimages/navbgright.png';
	images[13] = 'zpimages/logo.png';
	images[14] = 'zpimages/loading.gif';
	images[15] = 'zpimages/heading.png';

	load_images(images);

// var g_dse = false;
window.onload = function () {
}

var tabs = new Array();
tabs[0] = "tab0";
tabs[1] = "tab1";
tabs[2] = "tab2";
var tabsh = new Array();
tabsh[0] = "tabh0";
tabsh[1] = "tabh1";
tabsh[2] = "tabh2";

var ctab = 0;
var timer = null;
function roll()
{
	var tabCurrent = document.getElementById(tabs[ctab]);
	if(tabCurrent)
	{
		tabCurrent.style.display = 'none';
	}
	var tabhCurrent = document.getElementById(tabsh[ctab]);
	if(tabhCurrent)
	{
		tabhCurrent.style.display = 'block';
	}
	ctab = (ctab >= (tabs.length - 1) ? 0 : (ctab + 1));
	var tabNext    = document.getElementById(tabs[ctab]);
	if(tabNext)
	{
		tabNext.style.display = 'block';
	}
	var tabhNext    = document.getElementById(tabsh[ctab]);
	if(tabhNext)
	{
		tabhNext.style.display = 'none';
	}
	timer = setTimeout("roll()", 10000);
}

function show($i)
{
	clearTimeout(timer);
	var tabCurrent = document.getElementById(tabs[ctab]);
	if(tabCurrent)
	{
		tabCurrent.style.display = 'none';
	}
	var tabhCurrent = document.getElementById(tabsh[ctab]);
	if(tabhCurrent)
	{
		tabhCurrent.style.display = 'block';
	}
	ctab = $i;
	var tabNext    = document.getElementById(tabs[ctab]);
	if(tabNext)
	{
		tabNext.style.display = 'block';
	}
	var tabhNext    = document.getElementById(tabsh[ctab]);
	if(tabhNext)
	{
		tabhNext.style.display = 'none';
	}
	timer = setTimeout("roll()", 10000);
	return (false);
}
	
function load_images(imagearray)
{
	for( i=0; i<imagearray.length; i++ )
	{
		preloaded[i] = new Image()
		preloaded[i].src = imagearray[i]
	}
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	var done = false;
	var httpObject = null;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	// Get the HTTP Object
	function getHTTPObject()
	{
		if(window.ActiveXObject)
			return new ActiveXObject("Microsoft.XMLHTTP");
		else if(window.XMLHttpRequest)
			return new XMLHttpRequest();
		else
		{
			alert("Your browser does not support AJAX.");
			return null;
		}
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	// Change the value of the outputText field
	function setOutput()
	{
		if(httpObject.readyState == 4)
		{
			//alert(httpObject.responseText);
			cStatus = document.getElementById('archive');
			if(cStatus)
			{
				cStatus.innerHTML = httpObject.responseText;
				done = true;
			}
		}
		if(done == true)
		{
			done = false;
			// setTimeout('LoadStatus()', 60000);
		}
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	// Implement business logic
	function Load(c)
	{
		
		cStatus = document.getElementById('archive');
		cStatus.innerHTML = '<div style="text-align: center;"><img src="zpimages/loading.gif" align="center" /></div>';
		var szDate = '';
		// if(c !== false)
		{
			szDate = ab.year.value + '-' + (ab.month.value < 10 ? '0' + ab.month.value : ab.month.value) + '-' + (ab.day.value < 10 ? '0' + ab.day.value : ab.day.value);
			set('arcy', ab.year.value, 0);
			set('arcm', ab.month.value, 0);
			set('arcd', ab.day.value, 0);
		}
		httpObject = getHTTPObject();
		if(httpObject != null)
		{
			httpObject.open("POST", "scripts/list.php?date=" + szDate, true);
			httpObject.send(null);
			httpObject.onreadystatechange = setOutput;
		}
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	// Implement business logic
	function LoadByYear()
	{
		cStatus = document.getElementById('archive');
		httpObject = getHTTPObject();
		if(httpObject != null)
		{
			httpObject.open("POST", "scripts/list.php", true);
			httpObject.send(null);
			httpObject.onreadystatechange = setOutput;
		}
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function set(name,value,days)
	{
		if (days)
		{
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function get(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function del(name) {
		createCookie(name,"",-1);
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function setCBItemByValue(id, val)
	{
		if((list = document.getElementById(id)))
		{
			for(x=0; x<list.options.length; x++)
			{
				if(list.options[x].value == val)
				{
					list.selectedIndex = x;
					return;
				}
			}
		}
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function initialise()
	{
		var d = new Date();
		var year = d.getFullYear();
		var month = (d.getMonth() + 1);
		var day = d.getDate();
		setCBItemByValue('year', (get('arcy') ? get('arcy') : year));
		setCBItemByValue('month', (get('arcm') ? get('arcm') : month));
		setCBItemByValue('day', (get('arcd') ? get('arcd') : day));
		// alert(year + '=' + month + '=' + day + "\n" + get("arcy") + "=" + get("arcm") + "=" + get('arcd'));
		Load(false);
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	function form_submit_standard(action)
	{
		switch(action)
		{
			case 'reset':
				if(confirm('All fields will be cleared!!\nAre you sure you want to reset the form?'))
					return (true);
				break;
			default:
				return (true);
		}
		return (false);
	}
	
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	var preloaded = new Array(8);
	
	function load_images(imagearray)
	{
		for( i=0; i<imagearray.length; i++ )
		{
			preloaded[i] = new Image()
			preloaded[i].src = imagearray[i]
		}
	}
	
	var images = new Array(8);
	
	images[0] = 'zpimages/awbg.png';
	images[1] = 'zpimages/awtl.png';
	images[2] = 'zpimages/awtr.png';
	images[3] = 'zpimages/awbl.png';
	images[4] = 'zpimages/awbr.png';
	images[5] = 'zpimages/loader.gif';
	images[6] = 'zpimages/transbg.png';
	images[7] = 'zpimages/close.png';

	load_images(images);
	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function centre_it(c)
{
	var ScrollTop = document.body.scrollTop;
	if (ScrollTop == 0)
	{
		if(window.pageYOffset) ScrollTop = window.pageYOffset;
		else ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	var W = xWindow();
	// alert('WW: '  + W.Width + ' WH: ' + W.Height);
	// alert('CW: '  +  c.clientWidth + ' WH: ' +  c.clientHeight);
	c.style.left = (W.Width - c.clientWidth) / 2;
	c.style.top = ScrollTop + (W.Height - c.clientHeight) / 2;
	// alert(c.style.left + '|' + c.style.top);
}

function xWindow()
{
	var O = new Object;
	if(parseInt(navigator.appVersion) > 3)
	{
		if(navigator.appName == "Netscape")
		{
			O.Width = window.innerWidth;
			O.Height = window.innerHeight;
		}
		if (navigator.appName.indexOf("Microsoft") != -1)
		{
			O.Width = document.body.offsetWidth;
			O.Height = document.body.offsetHeight;
		}
	}
	return (O);
}

function getQueryString(formname)
{
    var form = document.forms[formname];
	var qstr = "";

    function GetElemValue(name, value) {
        qstr += (qstr.length > 0 ? "&" : "")
            + name + "="
            + safeString(value);
            // + value;
            // + escape(value ? value : "").replace(/\+/g, "%2B");
			//+ escape(value ? value : "").replace(/\n/g, "%0D");
    }
	
	var elemArray = form.elements;
    for (var i = 0; i < elemArray.length; i++) {
        var element = elemArray[i];
        var elemType = element.type.toUpperCase();
        var elemName = element.name;
        if (elemName) {
            if (elemType == "TEXT"
                    || elemType == "TEXTAREA"
                    || elemType == "PASSWORD"
					|| elemType == "BUTTON"
					|| elemType == "RESET"
					|| elemType == "SUBMIT"
					|| elemType == "FILE"
					|| elemType == "IMAGE"
                    || elemType == "HIDDEN")
                GetElemValue(elemName, element.value);
            else if (elemType == "CHECKBOX" && element.checked)
                GetElemValue(elemName, 
                    element.value ? element.value : "On");
            else if (elemType == "RADIO" && element.checked)
                GetElemValue(elemName, element.value);
            else if (elemType.indexOf("SELECT") != -1)
                for (var j = 0; j < element.options.length; j++) {
                    var option = element.options[j];
                    if (option.selected)
                        GetElemValue(elemName,
                            option.value ? option.value : option.text);
                }
        }
    }
    return qstr;
}

function safeString(s)
{
	s = s.replace(/\&/g, "%26");
    s = s.replace(/\+/g, "%2B");
	return (s);
}

function popup(strURL, container, query, destroy) {
	if(destroy !== false)
		popup_create(container);
	xmlhttpPost(strURL, container, query);
}

function request(strURL, container, query) {
	xmlhttpPost(strURL, container, query);
}

function xmlhttpPost(strURL, container, query) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(container, self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(query);
	return (false);
}

function getquerystring() {
    var form     = document.forms['f1'];
    var word = form.word.value;
    qstr = 'w=' + escape(word);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(container, str){
    document.getElementById(container).innerHTML = str;
	centre_it(document.getElementById(container));
}
var popup_layer = null;
var popup_container = null;
function popup_create(container_id)
{
	popup_layer = document.createElement("DIV");
	popup_layer.setAttribute("id", "layer");
	// popup_layer.innerHTML = '';
	popup_layer.style.height = document.body.scrollHeight
	document.body.appendChild(popup_layer);
	
	if(popup_container != null)
		document.body.removeChild(popup_container);
	popup_container = document.createElement("DIV");
	popup_container.setAttribute("id", container_id);
	popup_container.innerHTML = '<img src="zpimages/loader.gif" align="center" />';
	document.body.appendChild(popup_container);
	centre_it(popup_container);
	document.body.style.overflow = 'hidden';
	// g_dse = true;
}

function popup_close(do_confirm)
{
	if((do_confirm !== true) || (confirm('Are you sure you want to close?')))
	{
		// g_dse = false;
		if(popup_container != null) {
			document.body.removeChild(popup_container);
			popup_container = null;
		}
		if(popup_layer != null) {
			document.body.removeChild(popup_layer);
			popup_layer = null;
		}
		document.body.style.overflow = 'auto';
	}
	return (false);
}

function display_tribute(tribute_id)
{
	popup('scripts/load_tribute.php', 'popup', 'tribute_id=' + tribute_id, true);
	return (false);
}

function get_hits(container, ct, ni)
{
	request('scripts/agent_hits.php', container, 'ct=' + ct + '&ni=' + ni);
	return (false);
}

function form_load(auth_code, url)
{
	popup('scripts/ajax_form_loader.php', 'popup', 'auth_code=' + auth_code + '&url=' + url, true);
	return (false);
}

function form_submit(form, auth_code)
{
	var query_string = getQueryString(form);
	popup('scripts/ajax_form_loader.php', 'popup', query_string + '&auth_code=' + auth_code, false);
	return (false);
}

function form_reset(auth_code)
{
	if(confirm('All data will be lost!\nAre you sure you want to reset the form?'))
		popup('scripts/ajax_form_loader.php', 'popup', 'auth_code=' + auth_code, false);
	return (false);
}

--> 
