function xmlhttpPost(strURL) {
    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(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

//   The following function obtains two variables from your form (email and message) 
//   and builds a string that gets sent to your PHP script.  Change this function to
//   obtain whatever fields you want from your form.

function getquerystring() {
    var form     = document.forms['login'];
    var user = form.user.value;
    var pass = form.pass.value;
		var sublogin = form.sublogin.value;
    qstr = 'user=' + escape(user) + '&pass=' + escape(pass) + '&sublogin=' + escape(sublogin); 
    return qstr;
}

function updatepage(str){
		window.location="/pagebuilder.php?prodID=15";
}

var xmlHttp

function showGallery(str)
{
if (str.length==0)
{ 
document.getElementById("pagecontent").innerHTML=document.getElementById("pagebackup").innerHTML
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="gslider.php"
url=url+"?cat_id="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
new Effect.Appear("slideholder");
document.getElementById("slideholder").innerHTML=xmlHttp.responseText;
initSlideShow();
initLightbox(false);
} 
} 

function showNews(str,str2)
{
if (str.length==0)
{ 
document.getElementById("pagecontent").innerHTML=document.getElementById("pagebackup").innerHTML
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="news.php"
url=url+"?ID="+str
url=url+"&cat="+str2
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged2 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function contentLoader(str){
if (str.length==0)
{ 
document.getElementById("pagecontent").innerHTML=document.getElementById("pagebackup").innerHTML
return
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="homecontent.php"
url=url+"?prodID="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged3 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
} 

function memberLoader(str){
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
var url="member_detail.php"
url=url+"?memID="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged3
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
new Effect.BlindDown("pagecontent",{duration:2});
document.getElementById("pagecontent").innerHTML=xmlHttp.responseText;
} 
} 

function stateChanged3() 
{ 
if (xmlHttp.readyState==1 || xmlHttp.readyState=="loading")
{
document.getElementById("pagecontent").innerHTML="<div style=\"background-color:transparent;padding-top:30px;width:770px\" align=\"center\"><img src='/images/indicator_verybig.gif'></div>";
}
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
new Effect.Appear("pagecontent",{duration:3});
document.getElementById("pagecontent").innerHTML=xmlHttp.responseText;
} 
} 

function resizermatic(expandee){
	var pbox = document.getElementById(expandee);


	var ibox = document.getElementById("pagecontent");
	var i = ibox.offsetHeight;
	var p = pbox.offsetHeight;

	var sheight = document.body.clientHeight;
	var g = 100;
	if(p>1){
		g=p;
	}else{
		g=i;
	}
	ibox.style.height = g + "px";
	
	
	//alert(x+"px,p="+p+"px,i="+i+"px,window="+sheight);


if(document.getElementById('leftmenu')){
	//alert(pID);
	LeftMenu(pID,lmenu);
}
return false;
}

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;
}