/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousedown = gsn_close;
var is_over = false;

function gsn_show(p)
{
var w_width=0, w_height=0;if(parseInt(navigator.appVersion) > 3){if(navigator.appName == "Netscape"){w_width = window.innerWidth;w_height = window.innerHeight;}if (navigator.appName.indexOf("Microsoft") != -1){w_width = document.body.offsetWidth;w_height = document.body.offsetHeight;}
}
	var leftpos = p.offsetLeft, toppos = p.offsetTop, width = p.offsetWidth, t = p; 
	do {
		t = t.offsetParent;
		leftpos += t.offsetLeft;
		toppos  += t.offsetTop;
	} while (t.tagName != 'BODY');
	
	//alert(leftpos + '|' + toppos);
	var csn = document.getElementById('site_navigation');
	csn.style.display = 'block';
	csn.style.left = leftpos;
	csn.style.top = toppos;
	var ScrollTop = document.body.scrollTop;
	if (ScrollTop == 0)
	{
		if(window.pageYOffset) ScrollTop = window.pageYOffset;
		else ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
	}
	csn.style.left = (w_width - csn.clientWidth) / 2;
	return (false);
}
function gsn_close(e, k)
{
	if(!is_over || k)
	{
		var csn = document.getElementById('site_navigation');
		csn.style.display = 'none';
	}
	if(k == 1)
		return (false);
	return (true);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


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)
	{
		var szDate = '';
		// alert(get('archive_year'));
		// alert(get('archive_month'));
		// alert(get('archive_day'));
		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('archive_year', ab.year.value, 0);
			set('archive_month', ab.month.value, 0);
			set('archive_day', ab.day.value, 0); */
		}
		// cStatus = document.getElementById('archive');
		// if(cStatus)
		// {
			// cStatus.innerHTML = '<img src="images/loader_refresh_blue.gif" border="0" title="Please wait..">';
		// }
		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');
		// if(cStatus)
		// {
			// cStatus.innerHTML = '<img src="images/loader_refresh_blue.gif" border="0" title="Please wait..">';
		// }
		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() - 1);
		//setCBItemByValue('year', (get('archive_year') ? get('archive_year') : year));
		//setCBItemByValue('month', (get('archive_month') ? get('archive_month') : month));
		//setCBItemByValue('day', (get('archive_day') ? get('archive_day') : day));
		//alert(year + '=' + month + '=' + day);
		
		setCBItemByValue('year', year);
		
		setCBItemByValue('month', month);
		
		setCBItemByValu e('day', day);*/
		Load(false);
	}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////