/**
 * My Content Module JS Files
 * @author Pathfinder Solutions India
 * @link http://www.pathfindersolutions.biz
 * @version 1.0
 * @package justmeans
 * @subpackage my profile
 */
var ajaxObjects = new Array();
var img = new Image();
img.src = "images/loading.gif";
var contentid;
var strContentType;
function fnHideStatus(response)
{
	document.getElementById('id_Successdiv_' + response).style.display = "none";	
}

function fnPrivacyProcessAjaxResponse(transport)
{
		//alert(strContentType);
		var response = ajaxObjects[0].response;
		document.getElementById('id_loadingdiv_' + strContentType).style.display = "none";
		
		document.getElementById('id_Successdiv_' + strContentType).style.display = "";
		setTimeout('fnHideStatus("' + strContentType + '")', 1000);		 
}

function fnPrivacyAjaxRequestInProgress()
{
		 document.getElementById('id_loadingdiv_' + strContentType).style.display = "";
}

function fnPrivacyAjaxRequestError()
{
	document.getElementById('id_divsetting').style.display = "";
	document.getElementById('id_divsetting').innerHTML = "Error !!!!! ";
}


function fnAjaxCallerPrivacy(contenttype, elementvalue)
{
	  /*
	   contentelementid = Element where response should be displayed //id_divsubindustry
	   contenttype = setaboutme etc
	   params = &id=1&name=vikrant
	   content_action = addregion/removeregion/addtag/removetag

	  var d = new Date();
	  var time = d.getTime();
	  strContentType = contenttype;
	  var url = sitename+'/'+'index.php?action=privacysetting&content_action='+contenttype+'&elementvalue='+elementvalue+'&mode=ajax&'+time;
	  var myAjax = new Ajax.Request(url,
	  {
		method:'get',
		onLoading: fnPrivacyAjaxRequestInProgress,
		onSuccess: fnPrivacyProcessAjaxResponse,
		onFailure: fnPrivacyAjaxRequestError		
	  });
	  */
	  
		strContentType = contenttype;
		ajaxObjects[0] = new sack();
		ajaxObjects[0].requestFile = sitename+"/"+'index.php?action=privacysetting&content_action='+contenttype+'&elementvalue='+elementvalue+'&mode=ajax&';
		ajaxObjects[0].onLoading = function(){
													fnPrivacyAjaxRequestInProgress();
											 };
		ajaxObjects[0].onFail = function(){
													fnPrivacyAjaxRequestError();
										  };
		ajaxObjects[0].onCompletion = function(){
													fnPrivacyProcessAjaxResponse();
												};
		ajaxObjects[0].runAJAX();
}