var xmlHttp;

function loadpage(page)
{ 
var fltitle = new FlashObject("http://www.jclxmusic.com/flash/titles/"+page.replace('.php','')+".swf", "Player", "240", "75", "8", "#000000");
fltitle.addParam("wmode", "transparent");
fltitle.write("pgtitle");

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="pageinfo.php";
url=url+"?page="+page;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () {
stateChange("pagecontent");
};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function loadeventpage(page,event)
{ 
var fltitle = new FlashObject("http://www.jclxmusic.com/flash/titles/"+page.replace('.php','')+".swf", "Player", "240", "75", "8", "#000000");
fltitle.addParam("wmode", "transparent");
fltitle.write("pgtitle");

xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="pageinfo.php";
url=url+"?page="+page;
url=url+"&event="+event;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () {
stateChange("pagecontent");
};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function makePOSTRequest(url, parameters) {
	xmlHttp=GetXmlHttpObject();
      	if (xmlHttp==null){
 		alert ("Browser does not support HTTP Request");
 		return;
 	}
	var url="pageinfo.php";
	url=url+"?page=contact.php";
	xmlHttp.onreadystatechange=function () {
		stateChange("pagecontent");
	};
      	xmlHttp.open("POST",url,true);
      	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      	xmlHttp.setRequestHeader("Content-length", parameters.length);
      	xmlHttp.setRequestHeader("Connection", "close");
      	xmlHttp.send(parameters);
}
   
function get(obj) {
 	var poststr = "submit=" + escape(encodeURI(document.getElementById("submit").value )) +"&dp=" + escape(encodeURI(document.getElementById("department").value )) +"&fn=" + escape(encodeURI(document.getElementById("firstname").value )) +"&ln=" + escape(encodeURI( document.getElementById("lastname").value ))+"&email=" + escape(encodeURI( document.getElementById("email").value ))+"&phone=" + escape(encodeURI( document.getElementById("phone").value ))+"&sub=" + escape(encodeURI( document.getElementById("subject").value ))+"&msg=" + escape(encodeURI( document.getElementById("msg").value ));
      	makePOSTRequest('post.php', poststr);
}

function showSong(client,title)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="mediainfo.php";
url=url+"?client="+client;
url=url+"&title="+title;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () {
stateChange("mediaselect");
};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function showgallery(gallery,start)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="mediainfo.php";
url=url+"?gallery="+gallery;
url=url+"&gstart="+start;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function () {
stateChange("gallerycontent");
};
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChange(divcontent) 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById(divcontent).innerHTML=xmlHttp.responseText;
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}