/**
 * Usercareerinfo Area Module JS Files
 * @author Pathfinder Solutions India
 * @link http://www.pathfindersolutions.biz
 * @version 1.0
 * @package justmeans
 * @subpackage usercareerinfo
 */

/* 
Global variable isEdit 
*/

var ajaxObjects = new Array();

var boolIsEdit = false;
var intRowIndex = -1;

 var d = new Date();
 var time = d.getTime();
 
 var strTempAction;

/**
 * fnSetJob function
 * @param 
 * @return
 */
	function fnAjaxProcessForProfilePhoto(contentelementid, action,ajax_action)
	{
		strTempAction = ajax_action;
		contentid = contentelementid;
						
				/*---------------------------------------------------------*/
				
				
				  var url = sitename+'/'+'index.php?action='+ action +'&mode=ajax&ajax_action='+ ajax_action +'&'+time ;
				  if(confirm("Are you sure you want to delete the photo? ")==true)
				  {
					  /*var myAjax = new Ajax.Request(url,
					  {
						method:'get',
						onLoading: fnAjaxRequestInProgressPhotoProcess,
						onSuccess: fnAjaxResponsePhotoProcess,
						onFailure: fnAjaxRequestErrorPhotoProcess		
					  });*/
					  
					  fnAjaxRequestInProgressPhotoProcess(contentelementid);
					  var ajaxIndex = ajaxObjects.length;
					  ajaxObjects[ajaxIndex] = new sack();
					  ajaxObjects[ajaxIndex].requestFile = url;
					  
					  ajaxObjects[ajaxIndex].onCompletion = function()
					  {
						  fnAjaxResponsePhotoProcess(ajaxObjects[ajaxIndex].response);
					  }
					  ajaxObjects[ajaxIndex].runAJAX();
						
				  }			

	}
	
	function fnAjaxResponsePhotoProcess(response)
	{
		 //var response = transport.responseText;
		 if(response == false || response == "") response = "Data not available..";
		 document.getElementById(contentid).style.display = "";
		 document.getElementById(contentid).innerHTML =  response;
		
	}
	
	function fnAjaxRequestInProgressPhotoProcess(contentelementid)
	{
		document.getElementById(contentid).style.display = "";
		document.getElementById(contentid).innerHTML = "<img src='images/loading.gif' />";
		
	}
	
	function fnAjaxRequestErrorPhotoProcess()
	{
		document.getElementById(contentid).style.display = "";
		document.getElementById(contentid).innerHTML = "Error !!!!! ";
	}