function ajaxpost(serverScript,insert,parameters)
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer 6+
try
{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
// Internet Eplorer 5
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX. Download a newer browser to view this page.");
return false;
}
}
}
// insert server response into HTML element
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200) 
{
	closeMessage();
	document.getElementById(insert).innerHTML=xmlHttp.responseText;
	//Shadowbox.init({ skipSetup: true }); Shadowbox.setup();
} 
else 
{
	alert("There was a problem while using XMLHTTP:\n" + xmlHttp.statusText);
}
}
}
xmlHttp.open("POST", serverScript, true);
xmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlHttp.setRequestHeader('Content-length', parameters.length);
xmlHttp.setRequestHeader('Connection', 'close');
xmlHttp.send(parameters);
}
function to_call_ajax(url,pageid,divid)
{
	var parameters_value;
    parameters_value="page="+pageid;
    if(url=='portfolio.php'|| url=='portrightcontent.php')
	{
	  displayStaticMessage('<img src=\"ajax-loader6.gif\" height=\"100\" width=\"100\" alt=\"loading\">',false);
	  ajaxpost('portrightcontent.php',divid,parameters_value);
	}
    if(url=='testimonials.php'|| url=='testicontent.php')
	{
	  displayStaticMessage('<img src=\"ajax-loader6.gif\" height=\"100\" width=\"100\" alt=\"loading\">',false);
	  ajaxpost('testicontent.php',divid,parameters_value);
	}
}
function displayStaticMessage(messageContent,cssClass)
{
messageObj.setHtmlContent(messageContent);
messageObj.setSize(0.1,0.1);
messageObj.setCssClassMessageBox(cssClass);
messageObj.setSource(false); // no html source since we want to use a static message here.
messageObj.setShadowDivVisible(false); // Disable shadow for these boxes
messageObj.display();
}
function closeMessage()
{
messageObj.close();
}
