
function getPooslList(div_id, country_ids, top_element, default_pools, other_html_param_string)
{
	
	/**
		Country_ids:
			 is csv string with country ids saparated by comma
			 
		div_id:
			 is id of a element where this combobox need to be display
			 
		top_element:
			 String need to display at top of list box
			
		other_param_string:
			Will be used to specify the extra params applicable for the list/drop down box
			e.g "multiple='multiple'  size='5'"
			
			Explanation:
				multiple:
						if set to true it will generate the box wiltiple selection enabled
			
				size:
					It is a attribute for the box to specify how many elemnts will be displayed to the user
					i.e if set to >1 will have list box and if 1 then it will be drop down
		
		
		Description:
			This Function takes above params and passes these params (Except div_id) to a php file.
			phpfile process the request and returns required combo/list box
			the returned combo/list box is assigned to the given div id.
			
	*/
    
    
	var div_element = document.getElementById(div_id);
	
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';
	
	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'poollist', country_ids:country_ids, top_element:top_element, default_elements:default_pools, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
     
}

function getCountryList(div_id, top_element,default_countries, other_html_param_string)
{
	
	/*
		div_id:
			 is id of a element where this combobox need to be display
			 
		top_element:
			 String need to display at top of list box
		
		default_countries:
			This attribute specifies the comma saperated values for showing default selection of countries
			
		other_param_string:
			Will be used to specify the extra params applicable for the list/drop down box
			e.g "multiple='multiple'  size='5'"
			
			Explanation:
				multiple:
						if set to true it will generate the box wiltiple selection enabled
			
				size:
					It is a attribute for the box to specify how many elemnts will be displayed to the user
					i.e if set to >1 will have list box and if 1 then it will be drop down
					
		Description:
			This Function takes above params and passes these params (Except div_id) to a php file.
			phpfile process the request and returns required combo/list box
			the returned combo/list box is assigned to the given div id.
					
	*/
    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'country_list', top_element:top_element, default_elements:default_countries, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			       {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
}




function getStateList(div_id, top_element, country_id, default_states, other_html_param_string)
{

    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'state_list', country_id:country_id , top_element:top_element, default_elements:default_states, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			           
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}

function getDistrictList(div_id, top_element, state_id, default_district, other_html_param_string)
{

    
      var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'district_list', state_id:state_id , top_element:top_element, default_elements:default_district, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}


function getPoolList(div_id, top_element, country_id,default_pool, other_html_param_string)
{

	var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'pool_list', country_id:country_id , top_element:top_element, default_elements:default_pool, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
}

function getTypeList(div_id, top_element,country_id,default_school_type, other_html_param_string)
{
    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'type_list', country_id:country_id , top_element:top_element, default_elements:default_school_type, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}

function getNameList(div_id, top_element,type_id,default_name,other_html_param_string)
{
    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'name_list',type_id:type_id , top_element:top_element, default_elements:default_name, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}

function getHobbyList(div_id, top_element, country_id,default_hobby, other_html_param_string)
{
	
    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'hobby_list', country_id:country_id , top_element:top_element, default_elements:default_hobby, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}
function getHobbyListAll(div_id, top_element, country_id,default_hobby, other_html_param_string)
{
	
    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'all_hobby_list', country_id:country_id , top_element:top_element, default_elements:default_hobby, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}
//added for the multiselect
function getHobbyListNew(ele_name, div_id, top_element, country_id,default_hobby, other_html_param_string)
{
	
    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'multi_hobby_list', country_id:country_id , top_element:top_element, default_elements:default_hobby, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;						
						Init( ele_name, image_path + "/arrow_off1.gif", image_path + "/arrow_off1.gif","arrow1", "optionTextBox1", "optionDiv1", "cell1", "cellHover1", "cellSelected1" );
			       }
    });
   
}

function getBranchList(div_id, top_element, country_id,default_branch, other_html_param_string)
{

    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'branch_list', country_id:country_id , top_element:top_element, default_elements:default_branch, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}
function getBranchListAll(div_id, top_element, country_id,default_branch, other_html_param_string)
{

    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'all_branch_list', country_id:country_id , top_element:top_element, default_elements:default_branch, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
			       }
    });
   
}
//added for the multiselect
function getBranchListNew(ele_name, div_id, top_element, country_id,default_branch, other_html_param_string)
{

    var div_element = $(div_id);
	div_element.innerHTML = "Loading...";
	
	ajax_url = website_url + 'poolsystem.ajax.php';

	var defualt_param='';
    new Ajax.Request(ajax_url,
    {
        method: 'post',
        parameters: {type:'multi_branch_list', country_id:country_id , top_element:top_element, default_elements:default_branch, other_html_params:other_html_param_string},
        onSuccess: function(transport)
			           {
			            var response = transport.responseText;
			            div_element.innerHTML = response;
						Init( ele_name, image_path + "/arrow_off1.gif", image_path + "/arrow_off1.gif","arrow1", "optionTextBox1", "optionDiv1", "cell1", "cellHover1", "cellSelected1" );
			       }
    });
   
}

//Add option in a SBS Step Section 
	function addOptions(id)
	{   
		var up = document.getElementById('fees_form');
		var each_step_count = parseInt(document.getElementById('each_step_count').value);
		
		var dv = document.createElement("table");
			var divIdName = 'my_'+each_step_count+'_table';
			dv.setAttribute('id',divIdName);
			dv.setAttribute('class','bordertableclass');
			dv.setAttribute('width','100%');
			dv.setAttribute('border','0');
			//dv.innerHTML += '<table style="display:block;" id="table_'+ each_step_count +'">';
			dv.innerHTML +='<tr class="form_label"><td width="25%">Fees applicable To<span class="asteric">*</span></td><td><select name="fees_applicable_'+ each_step_count + '" id="fees_applicable_'+ each_step_count + '"><option value="sender">Sender</option><option value="reciever">Receiver</option></select></td></tr>'; 
	  		dv.innerHTML += '<tr class="form_label"><td width="25%">Fees in System Currency :</td><td><input type="text" name="fees_sys_' + each_step_count + '" size="20" id="fees_sys_' + each_step_count + '"></td></tr>';
	  		dv.innerHTML += '<tr class="form_label"><td width="25%">Fees in Account Currency :</td> <td><input type="text" name="fees_acc_' + each_step_count + '" size="20" id="fees_acc_' + each_step_count + '"></td></tr>';
	  		dv.innerHTML += '<tr class="form_label"><td width="25%"><a href="#" onClick="return removeContent(\'my_'+each_step_count+'_table\')">Delete</a></td></tr>';
	  		dv.innerHTML += '</table>';
	  		up.appendChild(dv);
	  		 each_step_count = each_step_count+1;
	  		document.getElementById('each_step_count').value = each_step_count;
	  			   
	}

//Remove Div in a SBS Step Section ::'+each_step_count+'::id
	function removeContent(id) {
	    
		var d = document.getElementById('fees_form');
			divNum = id;
			var olddiv = document.getElementById(divNum);
			d.removeChild(olddiv);
		
		
			
		return;
	}
	
	function removeTr(id)
	{	
		var each_step_count = parseInt(document.getElementById('each_step_count').value);
		document.getElementById(id).style.display = 'none';	
		document.getElementById('each_step_count').value = each_step_count - 1;
	}

	function ShowHidedElement(show_id,hide_id,status)
	{
	  if(show_id != '')
	  show = $(show_id);
	  
	  if(hide_id != '')
	  hide = $(hide_id);
  
	  if(status==1)
	  {
		if(show_id != '')
		show.style.display = "none";
		
		if(hide_id != '')
	    hide.style.display = "block";
	  }
	  else
	  {
	    if(show_id != '')
	    show.style.display = "block";
	    
	    if(hide_id != '')
	    hide.style.display = "none";
	  }
	}
	
	
	
	function getSchoolList(div_id, top_element,district_id,default_school, other_html_param_string)
	{
		
		var div_element = $(div_id);
		div_element.innerHTML = "Loading...";
	
		ajax_url = website_url + 'poolsystem.ajax.php';

		var defualt_param='';
    	new Ajax.Request(ajax_url,
    	{
        	method: 'post',
        	parameters: {type:'school_list', district_id:district_id , top_element:top_element, default_elements:default_school, other_html_params:other_html_param_string},
        	onSuccess: function(transport)
			           {
				            var response = transport.responseText;
			    	        div_element.innerHTML = response;
			       		}
		});
	}
	
	
 function deleteUserEmployerMessage(message_id,user_id)
  {
 		
	  if(confirm('Are you sure you want to delete this message?'))
	   {
	   				
	   		var url=website_url +'delete_user_messages.php';
			
				new Ajax.Request(url,
    			{
		        	method: 'get',
		        	parameters: {message_id:message_id , id:user_id},
		        	onSuccess: function(transport)
					           {
						           var response = transport.responseText
						           window.location.reload();						          
			    	       
					       		}
				});	
					
			
	   		
	   }
   }

  
  
  
   function blockEmployer(employer_id,user_id)
  {
  	
	   if(confirm('Are you sure you want to block this employer ?'))
	   {
	   		
	   		var url=website_url +'block_employer.php';
			
				new Ajax.Request(url,
    			{
		        	method: 'get',
		        	parameters: {employer_id:employer_id , id:user_id},
		        	onSuccess: function(transport)
					           {
						            var response = transport.responseText;
					    	        //$("company_messages").innerHTML = response;
					    	         window.location.reload();
					       		}
				});				
	   		
	   }
   }
  
  function unblockEmployer(employer_id,user_id)
  {
  		if(confirm('Are you sure you want to unblock this employer ?'))
	   {
	   		
	   		var url=website_url +'unblock_employer.php';
			
				new Ajax.Request(url,
    			{
		        	method: 'get',
		        	parameters: {employer_id:employer_id , id:user_id},
		        	onSuccess: function(transport)
					           {
						            var response = transport.responseText;
					    	        //$("company_messages").innerHTML = response;
					    	        window.location.reload();
					       		}
				});				
	   		
	   }
  }

	/*function ValidateFields()
	{	
		var up = document.getElementById('fees_form');
		var each_step_count = parseInt(document.getElementById('each_step_count').value);
		for(var i=0; i <each_step_count ;i++)
		{  
			var fees_sys_field = document.getElementById('fees_applicable_'+i);
	
		  if(fees_sys_field !="")
		  {
			var fees_sys = document.getElementById('fees_sys_'+i).value;
			var fees_acc = document.getElementById('fees_acc_'+i).value;
			if(fees_sys == "")
			{
				alert("Please Enter Fees in System Currency");
				document.getElementById('fees_sys_'+i).focus();
				return false;
			}
			
			if(fees_acc == "")
			{
				alert("Please Enter Fees in Account Currency");
				document.getElementById('fees_acc_'+i).focus();
				return false;
			}
			
		  }	
		}
	}*/

  function ChangeSchoolName()
  {
  		var flag="true";
  		return flag;
  }	
  
  function reloadParentWindow(reference_window)
  {
	parent.document.location.reload();
  }

  function reloadSameWindow(reference_window)
  {
	document.location.reload();
  }
  
  
  