//	Ajax gloabl variavle
var XMLobjContent=createXMLObject();
var XMLobjParty=createXMLObject();
var XMLobjSpecial=createXMLObject();
var XMLobjEvents=createXMLObject();

var params='';
var params_party='';
var params_special='';
var params_events='';


function createXMLObject()
{
	try{
		//	If browser is not IE. If Firefox ,etc
		return  new XMLHttpRequest();
	}
	catch(e){
		try{
			//	If browser is old IE
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e2){
			try{
				//	If browser is IE version >6
				return new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e3){
				//	if browser does not support then show alert
				alert("Your broswer does not support ActiveXObjects.");
				return false;
			}
		}
	}
}

//	function to get the page content 
function get_content(type_content)
{
	params_content="type="+type_content;
	post_data();
}

//	function to get the page content
function post_data()
{
	if(XMLobjContent.readyState==0 || XMLobjContent.readyState==4)
	{
		XMLobjContent.open("POST", "../../_site/php/contentResults.php", true );
		XMLobjContent.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		XMLobjContent.onreadystatechange=show_page;
		XMLobjContent.send(params_content);
	}
}

//

//	 function to display in the div
function show_page()
{
	if(XMLobjContent.readyState==4)
	{
		if(XMLobjContent.status==200)
		{
	 		document.getElementById("resultContent").innerHTML=XMLobjContent.responseText;
			$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();			
		});
			
			$(document).ready(function(){
			$("div[class='slideshow1']").cycle({
				fx:     'fade', 
				speed:   6000, 
				timeout: 3000, 
				pause:   1 
			});		
		});


	 	}
	 	else
	 		document.getElementById("resultContent").innerHTML="Loading...";	//	showing the progressbar
	}
}

function get_latest_party(type_party)
{
	params_party="type="+type_party;
	post_latestparty();
}

//	function to get the page content
function post_latestparty()
{
	if(XMLobjParty.readyState==0 || XMLobjParty.readyState==4)
	{
		XMLobjParty.open("POST", "../../_site/php/contentResults.php", true );
		XMLobjParty.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		XMLobjParty.onreadystatechange=show_latestparty;
		XMLobjParty.send(params_party);
	}
}

//

//	 function to display in the div
function show_latestparty()
{
	if(XMLobjParty.readyState==4)
	{
		if(XMLobjParty.status==200)
		{
	 		document.getElementById("resultParty").innerHTML=XMLobjParty.responseText;
			$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();			
		});
			
			$(document).ready(function(){
			$("div[class='slideshow1']").cycle({
				fx:     'fade', 
				speed:   6000, 
				timeout: 3000, 
				pause:   1 
			});		
		});


	 	}
	 	else
	 		document.getElementById("resultContent").innerHTML="Loading...";	//	showing the progressbar
	}
}

function get_special(type_special)
{
	params_special="type="+type_special;
	post_special();
}

//	function to get the page content
function post_special()
{
	if(XMLobjSpecial.readyState==0 || XMLobjSpecial.readyState==4)
	{
		XMLobjSpecial.open("POST", "../../_site/php/contentResults.php", true );
		XMLobjSpecial.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		XMLobjSpecial.onreadystatechange=show_special;
		XMLobjSpecial.send(params_special);
	}
}

//

//	 function to display in the div
function show_special()
{
	if(XMLobjSpecial.readyState==4)
	{
		if(XMLobjSpecial.status==200)
		{
	 		document.getElementById("resultSpecial").innerHTML=XMLobjSpecial.responseText;
			$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();			
		});
			
			$(document).ready(function(){
			$("div[class='slideshow1']").cycle({
				fx:     'fade', 
				speed:   6000, 
				timeout: 3000, 
				pause:   1 
			});		
		});


	 	}
	 	else
	 		document.getElementById("resultContent").innerHTML="Loading...";	//	showing the progressbar
	}
}

function get_latest_party(type_party)
{
	params_party="type="+type_party;
	post_latestparty();
}

//	function to get the page content
function post_latestparty()
{
	if(XMLobjParty.readyState==0 || XMLobjParty.readyState==4)
	{
		XMLobjParty.open("POST", "../../_site/php/contentResults.php", true );
		XMLobjParty.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		XMLobjParty.onreadystatechange=show_latestparty;
		XMLobjParty.send(params_party);
	}
}

//

//	 function to display in the div
function show_latestparty()
{
	if(XMLobjParty.readyState==4)
	{
		if(XMLobjParty.status==200)
		{
	 		document.getElementById("resultParty").innerHTML=XMLobjParty.responseText;
			$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();			
		});
			
			$(document).ready(function(){
			$("div[class='slideshow1']").cycle({
				fx:     'fade', 
				speed:   6000, 
				timeout: 3000, 
				pause:   1 
			});		
		});


	 	}
	 	else
	 		document.getElementById("resultContent").innerHTML="Loading...";	//	showing the progressbar
	}
}

function get_events(type_events)
{
	params_events="type="+type_events;
	post_events();
}

//	function to get the page content
function post_events()
{
	if(XMLobjEvents.readyState==0 || XMLobjEvents.readyState==4)
	{
		XMLobjEvents.open("POST", "../../_site/php/contentResults.php", true );
		XMLobjEvents.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
		XMLobjEvents.onreadystatechange=show_events;
		XMLobjEvents.send(params_events);
	}
}

//

//	 function to display in the div
function show_events()
{
	if(XMLobjEvents.readyState==4)
	{
		if(XMLobjEvents.status==200)
		{
	 		document.getElementById("resultEvents").innerHTML=XMLobjEvents.responseText;
			$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();			
		});
			
			$(document).ready(function(){
			$("div[class='slideshow1']").cycle({
				fx:     'fade', 
				speed:   6000, 
				timeout: 3000, 
				pause:   1 
			});		
		});


	 	}
	 	else
	 		document.getElementById("resultEvents").innerHTML="Loading...";	//	showing the progressbar
	}
}
