var xmlHttp;

function ajaxAboutusFunction()
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }	
	var url="ajax_aboutus.php";	
	//alert(url);
	xmlHttp.onreadystatechange=stateAboutusChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}

function stateAboutusChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		//var msgs=xmlHttp.responseText.split('~~');
	//	alert(xmlHttp.responseText);
		document.getElementById('col').innerHTML=xmlHttp.responseText;	
		

	 } 
}


function ajaxTopPackFunction()
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }	
	var url="ajax_topPack.php";	
	//alert(url);
	xmlHttp.onreadystatechange=stateTopPackChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}

function stateTopPackChanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		//var msgs=xmlHttp.responseText.split('~~');
		//alert(xmlHttp.responseText);
		document.getElementById('feature').innerHTML=xmlHttp.responseText;	
		

	 } 
}





function ajaxNewsletter()
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }
	var email = document.getElementById('subscriber').value;
	var url="ajaxNewsletter.php";
	url=url+"?email="+email;
	
	//alert(url);
	xmlHttp.onreadystatechange=stateNewsletter;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}

function stateNewsletter() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		//var msgs=xmlHttp.responseText.split('~~');
		
		document.getElementById('msgDiv1').innerHTML=xmlHttp.responseText;
	
		

	 } 
}



function ajaxForget(id)
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }
	var email = document.getElementById('email').value;	
	var type="forget";
	//alert(email);
	//alert(access);
	var url="ajax_output.php";
	url=url+"?email="+email;	
	url=url+"&type="+type;
	//alert(url);
	xmlHttp.onreadystatechange=stateChangedForget;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}

function stateChangedForget() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		var msgs=xmlHttp.responseText.split('~~');
		if(xmlHttp.responseText=='ready'){
		window.location=window.location.href;
		}else{
		document.getElementById('msgDivForget').innerHTML=xmlHttp.responseText;	
		}

	 } 
}

function ajaxComment(id)
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }
	var comment = document.getElementById('comment').value;	
	alert(id);
	//alert(access);
	var url="ajax_comment.php";
	url=url+"?comment="+comment;
	url=url+"&up_id="+id;	
	xmlHttp.onreadystatechange=stateChanged_comment;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}
function stateChanged_comment() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		//document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		var msgs=xmlHttp.responseText.split('~~');
		//document.getElementById('msgDiv').innerHTML=msgs[1];
		//document.getElementById('msgDiv').innerHTML=xmlHttp.responseText;
		if(xmlHttp.responseText=='ready'){
		window.location=window.location.href;
		}else{
		document.getElementById('msgCom').innerHTML=xmlHttp.responseText;	
		}

	 } 
}


function ajaxReply(fld,id,upid,div)
{ 

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	 {
		 alert ("Browser does not support HTTP Request");
		 return;
	 }
	var reply = document.getElementById(fld).value;	
	alert(fld);
	alert(id);
	alert(upid);
	var url="ajax_reply.php";
	url=url+"?reply="+reply;
	url=url+"&comm_id="+id;	
	url=url+"&up_id="+upid;	
	url=url+"&msgRep="+div;	
	xmlHttp.onreadystatechange=stateChanged_reply;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
}
function stateChanged_reply() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	 { 
		//document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
		var msgs=xmlHttp.responseText.split('~~');
		//document.getElementById('msgDiv').innerHTML=msgs[1];
		//document.getElementById('msgDiv').innerHTML=xmlHttp.responseText;
		if(xmlHttp.responseText=='ready'){
		window.location=window.location.href;
		}else{
		document.getElementById(msgs[1]).innerHTML=msgs[0];	
		}

	 } 
}



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;
}
//-->
window.onload=ajaxAboutusFunction;
