//function for deactivate the profile
function del()
{
	if(document.Deletefrm.status[0].checked==false)
	{
		document.getElementById("err").innerHTML="Please select the deactivate button";
		return false;
	}
	else if(document.Deletefrm.status[0].checked)
	{	
		if(conf_alert('1'))
		{
			return true;
		}
		else{
			return false;
		}
		return true;
	}
	else{
		return false;
	}
	document.Deletefrm.submit();
}

function conf_alert(val)
{
		document.getElementById('fade').style.display='block';
		showalert('lightbox_need.php','','','all','delete_profile');
	
}
function conf_alr(vv)
{
	if(vv==1) { alert(vv);return true; } 
	else { return false; }
}
//function for priority Tab 
function valid()
{
	frm = document.Priorityfrm;
	tic = frm.elements;
	var flag = 0;
	for (i=0;i<tic.length;i++) 
	 {
		if (tic[i].checked ) 
		{
			flag=1;
		}
	}
	if(flag==0)
	{
		document.getElementById('fade').style.display='block';
		showalert('lightbox_need.php','','','all','checkbox_empty_lightbox');
		//alert("Please select any value");
		return false;
	}
	return true;
	document.Priorityfrm.submit();
}	

//ajax
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;
}
function getXMLHTTP()	//fuction to return the xml http object
{
	var xmlhttp=false;	
	try{
		xmlhttp=new XMLHttpRequest();
	}
	catch(e)	{		
		try{			
			xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e){
			try{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e1){
				xmlhttp=false;
			}
		}
	}	
	return xmlhttp;
}

function profile_ajax(profile_id,page,view,comments)
{
	//alert(profile_id);
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
    {
    	alert ("Your browser does not support AJAX!");
    	return;
    }
	var url=page;
	url=url+"?id="+profile_id+"&view="+view+"&comments="+comments;
	url=url+"&sid="+Math.random(9999);
	//alert(url);
	xmlHttp.onreadystatechange=Profiletab;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function Profiletab()
{	
	if (xmlHttp.readyState==4)
	{		
		//alert(xmlHttp.responseText);
		if(xmlHttp.responseText!='delete') {	
			document.getElementById("div_profile").innerHTML=xmlHttp.responseText;
		} else {			
		location.href="../index.html";	
		}
	}
}

function members_ajax(profile_id,page,view,limit,pagi)
{
	//alert("hi");
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
    {
    	alert ("Your browser does not support AJAX!");
    	return;
    }
	var url=page;
	url=url+"?id="+profile_id+"&view="+view+"&limit="+limit+"&pagi="+pagi;
	url=url+"&sid="+Math.random(9999);
	//alert(url);
	xmlHttp.onreadystatechange=Membertab;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function Membertab()
{	
	if (xmlHttp.readyState==4)
	{		
		//alert(xmlHttp.responseText);
		document.getElementById("div_profile").innerHTML=xmlHttp.responseText;
	}
}

function profileid_ajax(profile_id,page,action)
{	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
    {
    	alert ("Your browser does not support AJAX!");
    	return;
    }
	var url=page;
	url=url+"?id="+profile_id+"&action="+action;
	url=url+"&sid="+Math.random(9999);
	//alert(url);
	xmlHttp.onreadystatechange=Profiletab1;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function Profiletab1()
{	
	if (xmlHttp.readyState==4)
	{				
		document.getElementById("div_searchprofile").innerHTML=xmlHttp.responseText;
	}
}


function History(profile_id,page,action,category)
{	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
    {
    	alert ("Your browser does not support AJAX!");
    	return;
    }
	var url=page;
	url=url+"?id="+profile_id+"&action="+action+"&category="+category;
	url=url+"&sid="+Math.random(9999);
	//alert(url);
	xmlHttp.onreadystatechange=Historytab;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function Historytab()
{
	if (xmlHttp.readyState==4)
	{	
		//alert(xmlHttp.responseText);
		document.getElementById("div_searchprofile").innerHTML=xmlHttp.responseText;
	}
}