// JavaScript Document

var showEventDetailXmlhttp;
var showNewsDetailXmlhttp;
var showEventListXmlhttp;

function setDragablePopUp() {
	new Draggable('newsBox');
}

function showEventSelector(d, m, y, lang) {
	document.getElementById("newsBox").style.display="block";
	$('video').fade({ duration:0.0, from: 1, to: 0});
	$('blacklayer').appear({ duration: 1.0, from: 0, to: 0.5 });
	
	showEventListXmlhttp=GetXmlHttpObject();
	if (showEventListXmlhttp==null)
	{
		  alert ("Your browser does not support AJAX!");
		  return;
	}
	var url="/chi/getEventList.php";
	url=url+"?d="+d;
	url=url+"&m="+m;
	url=url+"&y="+y;
	url=url+"&lang="+lang;
	url=url+"&sid="+Math.random();
	showEventListXmlhttp.onreadystatechange=function() {
		if (showEventListXmlhttp.readyState==4)
		{
			document.getElementById("newsDetails").innerHTML=showEventListXmlhttp.responseText;
		}
	};
	showEventListXmlhttp.open("GET",url,true);
	showEventListXmlhttp.send(null);
	
}

function showEventDetail(id, lang)
{	
	document.getElementById("newsBox").style.display="block";
	$('video').fade({ duration:0.0, from: 1, to: 0});
	$('blacklayer').appear({ duration: 1.0, from: 0, to: 0.5 });

	
	showEventDetailXmlhttp=GetXmlHttpObject();
	if (showEventDetailXmlhttp==null)
	{
		  alert ("Your browser does not support AJAX!");
		  return;
	}
	var url="/chi/getEvent.php";
	url=url+"?id="+id;
	url=url+"&lang="+lang;
	url=url+"&sid="+Math.random();
	showEventDetailXmlhttp.onreadystatechange=function() {
		if (showEventDetailXmlhttp.readyState==4)
		{
			document.getElementById("newsDetails").innerHTML=showEventDetailXmlhttp.responseText;
		}
	};
	showEventDetailXmlhttp.open("GET",url,true);
	showEventDetailXmlhttp.send(null);
	
}

function showNewsDetail(id, lang)
{	
	document.getElementById("newsBox").style.display="block";
	$('video').fade({ duration:0.0, from: 1, to: 0});
	$('blacklayer').appear({ duration: 1.0, from: 0, to: 0.5 });
	
	showNewsDetailXmlhttp=GetXmlHttpObject();
	if (showNewsDetailXmlhttp==null)
	{
		  alert ("Your browser does not support AJAX!");
		  return;
	}
	var url="/chi/getNews.php";
	url=url+"?id="+id;
	url=url+"&lang="+lang;
	url=url+"&sid="+Math.random();
	showNewsDetailXmlhttp.onreadystatechange=function() {
		if (showNewsDetailXmlhttp.readyState==4)
		{
			document.getElementById("newsDetails").innerHTML=showNewsDetailXmlhttp.responseText;
		}
	};
	showNewsDetailXmlhttp.open("GET",url,true);
	showNewsDetailXmlhttp.send(null);
	
}

function hideEventDetail() {
	document.getElementById("eventBox").style.display="none";
	//document.getElementById("backLayer").style.opacity=1;
	//document.getElementById("backLayer").style.filter = "alpha(opacity:100)";
	document.getElementById("blacklayer").style.display="none";
	$('video').appear({ duration: 0.0, from: 0, to: 1 });

}


function hideNewsDetail() {
	document.getElementById("newsBox").style.display="none";
	//document.getElementById("backLayer").style.opacity=1;
	//document.getElementById("backLayer").style.filter = "alpha(opacity:100)";
	document.getElementById("blacklayer").style.display="none";
	$('video').appear({ duration: 0.0, from: 0, to: 1 });
}

function showEventList() {
	document.getElementById("eventSelectorBox").style.display="none";
	//document.getElementById("backLayer").style.opacity=1;
	//document.getElementById("backLayer").style.filter = "alpha(opacity:100)";
	document.getElementById("blacklayer").style.display="none";
	$('video').appear({ duration: 0.0, from: 0, to: 1 });
}
