var url = window.location.href;
var nohttp = url.split('//')[1];
var hostPort = nohttp.split('/')[0];

var site_url = "http://"+hostPort+"/";

var xmlHttp_box_wire;
var xmlHttp_box_islamic;
var xmlHttp_box_education;
var xmlHttp_box_viewed;
var xmlHttp_box_commented;
var xmlHttp_box_emailed;
var xmlHttp_leftmenu;
var xmlHttp_art_comments;
var xmlHttp_art_comments_count;
var xmlHttp_date_time;

var id_box_wire;
var id_box_islamic;
var id_box_education;
var id_box_viewed;
var id_box_commented;
var id_box_emailed;
var id_leftmenu;
var id_art_comments;
var id_art_comments_count;
var id_date_time;

function show_box_wire(str)
{
	id_box_wire = "div_box_wire";
	var url_box_wire=site_url+"ajax_pages.php?ajax_page=" + str;
	xmlHttp_box_wire=GetXmlHttpObject(stateChanged_box_wire);
	xmlHttp_box_wire.open("GET", url_box_wire , true);
	xmlHttp_box_wire.send(null);
}

function stateChanged_box_wire() 
{ 
	if (xmlHttp_box_wire.readyState==4 || xmlHttp_box_wire.readyState=="complete")
	{ 
		document.getElementById(id_box_wire).innerHTML=xmlHttp_box_wire.responseText ;
	}
} 

function show_box_islamic(str)
{
	id_box_islamic = "div_box_islamic";
	var url_box_islamic=site_url+"ajax_pages.php?ajax_page=" + str;
	xmlHttp_box_islamic=GetXmlHttpObject(stateChanged_box_islamic);
	xmlHttp_box_islamic.open("GET", url_box_islamic , true);
	xmlHttp_box_islamic.send(null);
}

function stateChanged_box_islamic() 
{ 
	if (xmlHttp_box_islamic.readyState==4 || xmlHttp_box_islamic.readyState=="complete")
	{ 
		document.getElementById(id_box_islamic).innerHTML=xmlHttp_box_islamic.responseText ;
	}
} 

function show_box_education(str)
{
	id_box_education = "div_box_education";
	var url_box_education=site_url+"ajax_pages.php?ajax_page=" + str;
	xmlHttp_box_education=GetXmlHttpObject(stateChanged_box_education);
	xmlHttp_box_education.open("GET", url_box_education , true);
	xmlHttp_box_education.send(null);
}

function stateChanged_box_education() 
{ 
	if (xmlHttp_box_education.readyState==4 || xmlHttp_box_education.readyState=="complete")
	{ 
		document.getElementById(id_box_education).innerHTML=xmlHttp_box_education.responseText ;
	}
} 

function show_box_viewed(str)
{
	id_box_viewed = "div_box_viewed";
	var url_box_viewed=site_url+"ajax_pages.php?ajax_page=" + str;
	xmlHttp_box_viewed=GetXmlHttpObject(stateChanged_box_viewed);
	xmlHttp_box_viewed.open("GET", url_box_viewed , true);
	xmlHttp_box_viewed.send(null);
}

function stateChanged_box_viewed() 
{ 
	if (xmlHttp_box_viewed.readyState==4 || xmlHttp_box_viewed.readyState=="complete")
	{ 
		document.getElementById(id_box_viewed).innerHTML=xmlHttp_box_viewed.responseText ;
	}
} 

function show_box_commented(str)
{
	id_box_commented = "div_box_commented";
	var url_box_commented=site_url+"ajax_pages.php?ajax_page=" + str;
	xmlHttp_box_commented=GetXmlHttpObject(stateChanged_box_commented);
	xmlHttp_box_commented.open("GET", url_box_commented , true);
	xmlHttp_box_commented.send(null);
}

function stateChanged_box_commented() 
{ 
	if (xmlHttp_box_commented.readyState==4 || xmlHttp_box_commented.readyState=="complete")
	{ 
		document.getElementById(id_box_commented).innerHTML=xmlHttp_box_commented.responseText ;
	}
} 

function show_box_emailed(str)
{
	id_box_emailed = "div_box_emailed";
	var url_box_emailed=site_url+"ajax_pages.php?ajax_page=" + str;
	xmlHttp_box_emailed=GetXmlHttpObject(stateChanged_box_emailed);
	xmlHttp_box_emailed.open("GET", url_box_emailed , true);
	xmlHttp_box_emailed.send(null);
}

function stateChanged_box_emailed() 
{ 
	if (xmlHttp_box_emailed.readyState==4 || xmlHttp_box_emailed.readyState=="complete")
	{ 
		document.getElementById(id_box_emailed).innerHTML=xmlHttp_box_emailed.responseText ;
	}
} 
 
function show_leftmenu(str)
{
	id_leftmenu = "div_leftmenu";
	var url_leftmenu=site_url+"ajax_pages.php?ajax_page=" + str;
	xmlHttp_leftmenu=GetXmlHttpObject(stateChanged_leftmenu);
	xmlHttp_leftmenu.open("GET", url_leftmenu , true);
	xmlHttp_leftmenu.send(null);
}

function stateChanged_leftmenu() 
{ 
	if (xmlHttp_leftmenu.readyState==4 || xmlHttp_leftmenu.readyState=="complete")
	{ 
		document.getElementById(id_leftmenu).innerHTML=xmlHttp_leftmenu.responseText ;
	}
} 
 
function show_art_comments(str)
{
	id_art_comments = "div_art_comments";
	var url_art_comments=site_url+"news/get_comments.php?artid=" + str;
	xmlHttp_art_comments=GetXmlHttpObject(stateChanged_art_comments);
	xmlHttp_art_comments.open("GET", url_art_comments , true);
	xmlHttp_art_comments.send(null);
}

function stateChanged_art_comments() 
{ 
	if (xmlHttp_art_comments.readyState==4 || xmlHttp_art_comments.readyState=="complete")
	{ 
		document.getElementById(id_art_comments).innerHTML=xmlHttp_art_comments.responseText ;
	}
}  

function show_art_comments_count(str)
{
	id_art_comments_count = "div_art_comments_count";
	var url_art_comments_count=site_url+"news/get_comments_count.php?artid=" + str;
	xmlHttp_art_comments_count=GetXmlHttpObject(stateChanged_art_comments_count);
	xmlHttp_art_comments_count.open("GET", url_art_comments_count , true);
	xmlHttp_art_comments_count.send(null);
}

function stateChanged_art_comments_count() 
{ 
	if (xmlHttp_art_comments_count.readyState==4 || xmlHttp_art_comments_count.readyState=="complete")
	{ 
		document.getElementById(id_art_comments_count).innerHTML=xmlHttp_art_comments_count.responseText ;
	}
} 

function show_date_time()
{
	id_date_time = "div_date_time";
	var url_date_time=site_url+"news/get_date_time.php";
	xmlHttp_date_time=GetXmlHttpObject(stateChanged_date_time);
	xmlHttp_date_time.open("GET", url_date_time , true);
	xmlHttp_date_time.send(null);
}

function stateChanged_date_time() 
{ 
	if (xmlHttp_date_time.readyState==4 || xmlHttp_date_time.readyState=="complete")
	{ 
		document.getElementById(id_date_time).innerHTML=xmlHttp_date_time.responseText ;
	}
} 

function GetXmlHttpObject(handler)
{
	var objXmlHttp=null;
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		alert("This code doesn't work in Opera") ;
		return ;
	}
	
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP";
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
	{
	strName="Microsoft.XMLHTTP";
} 

try
{ 
	objXmlHttp=new ActiveXObject(strName);
	objXmlHttp.onreadystatechange=handler ;
	return objXmlHttp;
} 
catch(e)
{ 
	alert("Error. Scripting for ActiveX might be disabled");
	return;
} 
}
	
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
	objXmlHttp=new XMLHttpRequest();
	objXmlHttp.onload=handler;
	objXmlHttp.onerror=handler;
	return objXmlHttp;
}
}