function getHTTPObject() {
  var xmlhttp;
 
  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  }
  else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    } 
}
  return xmlhttp;

  
}

var http = getHTTPObject(); // We create the HTTP Object

/*
	Funtion Name=requestInfo 
	Param = url >> Url to call : id = Passing div id for multiple use ~ as a seprator for eg. div1~div2 :
	redirectPage >> if you like to redirect to other page once the event success then 
	the response text = 1 and the redirectPage not left empty
*/

    function requestInfo(url,id,redirectPage) {      
		var temp=new Array();
		var url=url+"&sid="+Math.random()
			http.open("GET", url, true);
			//http.setRequestHeader('Content-Type','application/x-www-form-urlencoded;charset=iso-8859-1');		
			
			http.onreadystatechange = function() {
				if (http.readyState == 4) {
				  if(http.status==200) {
			  		var results=http.responseText;
					
					//alert(document.getElementById(id).innerHTML);
					//alert(http.responseText);
					if(redirectPage=="") {
						
						var temp=id.split("~"); // To display on multiple div 
						//alert(temp.length);
						var r=results.split("~"); // To display multiple data into the div 
						//alert(temp.length);
						if(temp.length>1) {
							for(i=0;i<temp.length;i++) {	
								//alert(temp[i]);
								document.getElementById(temp[i]).innerHTML=r[i];
							}
						} else {
							//document.getElementById(id).innerHTML = "";
							document.getElementById(id).innerHTML = results;
						}	
					} else {
						//alert(redirectPage);
						window.location.href=redirectPage;			
					}
				  } 
  				}
			};
			http.send(null);
			
       }


function hit_counter(input)//Function for managing reunion
{	
	//alert('funtion called');
	//alert(input);
//	document.getElementById("reuniondisp").innerHTML='<img src="images/loading.gif" width="100px" height="25px" />';
	if(input == 'beauteindienne')
	{	
		//alert('Beaute Indienne!');
		window.open('counter/hit_counter.asp?input='+input,"a");
		//requestInfo('counter/beauteindienne.asp?input='+input,'hitcounter','');
	}
	else if(input == 'indianethos')
	{	
		//alert('Indian Ethos!');
		window.open('counter/hit_counter.asp?input='+input,"a");		
		//requestInfo('counter/beauteindienne.asp?input='+input,'hitcounter','');
	}	
	else
	{
	}
}

function view_counter(input)//Function for managing reunion
{	
	if(input == 'beauteindienne')
	{	
		//alert('Beaute Indienne!');
		requestInfo('View_counter.asp?input='+input,'hitcounter','');
	}
	else if(input == 'indianethos')
	{	
		//alert('Indian Ethos!');
		requestInfo('View_counter.asp?input='+input,'hitcounter1','');
	}	
	else
	{
	}
}


function back()
{
		window.location.href="contentmanagement.php";
}


function goback(redirect)
{
		window.location.href=redirect;
}
