
/**
*
* @author   Muhammad Shoeb
* @param    string  account_email 
* @return   void
*/
function forgotPass(account_email,baseUrl)
{      
		$.ajax( {
		            type: 'POST',
                    url : baseUrl+'/auth/forget-user-password/',
                    data: 'id=' + account_email,
                    success: function( msg ) {                 
                                 if(msg == 'true') { 
                                 	cwx.alert('<h1>Instructions Have Been Emailed</h1><p>Instructions to re-set your password have been emailed to you.</p> <p>If you do not receive your email, send us an email at sales@compassionworx.com.We will respond within a few hours (9-5 Central Standard Time).<p>');
								 } else { 
                                    cwx.error('<h1>Email Error</h1> <p>The email you entered does not match our records.Please re-enter your email and try again</p>.<p>If the address you entered still does not work, email us at sales@compassionworx.com.We will respond within a few hours (9-5 Central Standard Time).</p>');return false;
            
                                 } 		   
                    }
                }
            )    
	
}

/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @return   void
*/
function getcity(id)
{     
	$.ajax( {
				type: 'POST',
				url : baseUrl+'/index/get-city/',
				data: 'id=' + id,
				success: function( msg ) {
					if(msg != "") { 
						 $('#city').html(msg);
					}  		   
				}
			}
		)    
}
/**
*  Get zipcode list according to state id and city id.
*	
* @author   Muhammad Shoeb
* @param    int  id 
* @return   void
*/
function getZipcode(id)
{     
	var state = $("#state").val();
	$.ajax( {
				type: 'POST',
				url : baseUrl+'/index/get-zipcode/',
				data: 'cId=' +id+'&sId='+state,
				success: function( msg ) { 
					if(msg != "") { 
						 $('#zipcode').html(msg);
					}  		   
				}
			}
		)    
}

/**
*
* @author   Gurvinder
* @param    int  sid, int cid 
* @return   void
*/
function getadvisorcity(sid,cid, baseUrl)
{      
	$.ajax({
		type: 'POST',
		url : baseUrl+'/profiles/get-advisorcity/',
		data: 'sid=' + sid+'&cid='+cid,
		 success: function( msg ) {  
			if(msg != "") { 
				 $('#City').html(msg);
			}  		   
		}
	})	
}

/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @return   void
*/
function getschool(id, baseUrl)
{      
		$.ajax( {
		            type: 'POST',
                    url : baseUrl+'/index/get-school/',
                    data: 'id=' + id,
                    success: function(msg) {  
                        if(msg != "") { 
                          	 $('#school').html(msg);
                        }  		   
                    }
                }
            )    
	
}

/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @param    string  url 
* @return   void
*/
function getprojects(id, url)
{   
	var  requestUrl;  
	if(url == '') {
		requestUrl = baseUrl+'/profiles/get-projects/';
    } else {
		requestUrl = url;
	}
	$.ajax( {
		    type: 'POST',
            url : requestUrl,
            data: 'id=' +id+'&requestType=ajax',
            success: function(msg) { 
	            if(msg != "") { 
	                $('#project_list').html(msg);
					$("a.create").colorbox({width:"700px", height:"100%"});
	                $("a.retrive").colorbox({width:"700px", height:"100%"});
	                $("a.update").colorbox({width:"700px", height:"100%"}); 
					$(".read_project").colorbox({width:"700px", height:"100%"}); 
	            } else {
					$('#project_list').html('Wrong request. May be Your Session has expired.');
				}
    		}
        }
    )    
	
}

function closeColor()
{
	//alert("here");
	jQuery.fn.colorbox.close()
}

/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @param    string  url 
* @return   void
*/
function getCsaProjects(id, url)
{   
	var  requestUrl;  
	if(url == '') {
		requestUrl =baseUrl+'/profiles/get-csa-projects/';
    } else {
		requestUrl = url;
	}
	$.ajax( {
		    type: 'POST',
            url : requestUrl,
            data: 'id='+id+'&requestType=ajax',
            success: function(msg) { 
	            if(msg != "") { 
	                $('#project_list').html(msg);
	                $("a.retrive").colorbox({width:"700px", height:"100%"});
					$("a.update").colorbox({width:"700px", height:"100%"}); 
	            } else {
					$('#project_list').html('Wrong request. May be Your Session has expired.');
					//$('#project_list').css('height', '400px');
				} 		   
    		}
        }
    )    
	
}
/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @param    string  baseUrl 
* @return   void
*/
function joinProject(id, baseUrl)
{  
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/join-project/',
            data: 'id=' + id,
            success: function(msg) { 
	            if(msg == 'true') {  
                	Sexy.alert('<p>This Project will be available for you as soon as your CSA approves your participation!</p>');
				} else if(msg == 'requested'){                
                    Sexy.error('<p>Already you requested this project.</p>');return false;
                } else {                
                    Sexy.error('<p>Request unsuccesful.</p>');return false;
                } 	 		   
    		}
        }
    )    
	
}
/**
*
* @author   Gurvinder
* @param    string  baseUrl 
* @return   void
*/
function latestProject(baseUrl)
{ 
	$.ajax( {
		type: 'POST',
		url : baseUrl+'/profiles/latest-project/',		
		success: function(msg) {
			if(msg != "") { 
				$('#project_list').html(msg);
				$("a.retrive").colorbox({width:"700px", height:"100%"});
				$("a.update").colorbox({width:"700px", height:"100%"}); 
				
			}  		   
		}
	})  	
}
/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @param    string  baseUrl 
* @return   void
*/

function deleteProject(id, baseUrl)
{  
 Sexy.confirm('<p>Are you sure want to delete this project?</p>',{onComplete: 
    function(returnvalue) 
	{
		if(returnvalue) {
			$.ajax( {
				type: 'POST',
				url : baseUrl+'/profiles/deleteproject/',
				data: 'id='+id+'&requestType=ajax',
				success: function(msg) {
					if(msg != "") { 
						latestProject(baseUrl);
						Sexy.alert('<p>Project deleted successfully!</p>') ;
					}  		   
				}
			})    
	  
		}
	}
	}
 );			
}

/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @param    string  baseUrl 
* @return   void
*/
function addhour(id, baseUrl)
{  
	var hour = $('#hour_'+id).val();
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/addhours/',
            data: 'hour='+hour+'&id='+id+'&requestType=ajax',
            success: function(msg) {
	            if(msg == "true") { 
	                Sexy.alert('<h1>Your Data have been submited!</h1><br/><p>These Hours will be aproved by your CSA or the service Organization you are working with.</p>');
	            } else {
					Sexy.error('<h1>Hour submission failure!</h1>');
				}		   
    		}
        }
    )    
	
}

/**
*
* @author   Muhammad Shoeb
* @param    int  id 
* @param    string  baseUrl 
* @return   void
*/
function reflectionInfo(id, baseUrl)
{  
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/get-reflection-info/',
            data: 'id='+id+'&requestType=ajax',
            success: function(msg) { 
	            if(msg != "") { 
	                $('#reflection_post').html(msg);
	            }  		   
    		}
        }
    )    
	
}

/**
*
* @author   Gurvinder
* @param    array date
* @param    string  baseUrl 
* @return   void
*/
function getEvents(date, baseUrl)
{   
	$('#event_list').html(document.getElementById('loader_image').innerHTML);
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/eventindex/',
            data: 'date='+date+'&requestType=ajax',
            success: function(msg) { 
	            if(msg != "") { 
	            	$('#event_list').html(msg);
					$("a.new_action").colorbox({width:"700px", height:"100%"});
					$("a.event_update").colorbox({width:"700px", height:"100%"});
					$("a.event_view").colorbox({width:"700px", height:"100%"});
	            } else {
					$('#event_list').html('Wrong request. May be Your Session has expired.');
					$('#event_list').css('height', '400px');
				}   		   
    		}
        }
    )    
	
}


/**
* 
* @param    string date
* @param    string  baseUrl 
* @return   void
*/
function getEventsForStudents(date, baseUrl)
{   
	$('#divcalevent').html(document.getElementById('loader_image').innerHTML);
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/studentseventindex/',
            data: 'date='+date+'&requestType=ajax',
            success: function(msg) { 
	            if(msg != "") { 
	            	$('#divcalevent').html(msg);
					$("a.new_action").colorbox({width:"45%", height:"500px"});
					$("a.event_update").colorbox({width:"45%", height:"500px"});
					$("a.event_view").colorbox({width:"45%", height:"500px"});
	            } else {
					$('#divcalevent').html('Wrong request. May be Your Session has expired.');
					$('#divcalevent').css('height', '400px');
				}   		   
    		}
        }
    )    
	
}


/**
*
* @Modified BY Md. Jahangir Alam
* @author   Gurvinder
* @param    string cond
* @param    character letter
* @return   void
*/
function getSortedUser(cond, letter)
{   
	$('#divManegeAdv').html(document.getElementById('loader_image').innerHTML);
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/advisor/'+cond+'/'+letter+'/requestType/ajax',
            //data: 'date=' + date,
            success: function(msg) { 
            	//alert(msg);
	            if(msg != "") { 
	                $('#divManegeAdv').html(msg);
					$("a.update").colorbox({width:"65%", height:"600px"}); 
					$("a.new_action_advisor").colorbox({width:"65%", height:"600px"});
	            }  		   
    		}
        }
    )    
	
}

/**
*
* @author   Gurvinder
* @return   void
*/
function addEvents(idEvent,year,name,sdate,edate,shour,smin,ehour,emin,description,baseUrl,status,accessibility)
{   
	$.ajax( {
	
		    type: 'POST',
            url : baseUrl+'/profiles/addevent/',
			data: 'idEvent='+idEvent+'&name='+name+'&description='+description+'&startHTime='+shour+'&startMTime='+smin+'&endHTime='+ehour+'&endMTime='+emin+'&startDate='+sdate+'&endDate='+edate+'&accessibility='+accessibility,           
            success: function(msg) { 
	            if(msg != "") { 
	                getEvents(year,baseUrl);
				    jQuery.fn.colorbox.close()
				    if(status == 'Edit') {
						Sexy.alert('<p>Successfully Update your Event.<p>');
						
					} else {
						Sexy.alert('<p>New Event Added successfully.<p>');
					}
					$("a.new_action").colorbox({width:"45%", height:"500px"});
					$("a.event_update").colorbox({width:"45%", height:"500px"});
					$("a.event_view").colorbox({width:"45%", height:"500px"});
	            }  		   
    		}
        }
    )    
	
}
/**
*
* @author   Gurvinder
* @return   void
*/
function editEvents(id,year,name,sdate,edate,shour,smin,ehour,emin,description)
{   
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/editevent/',
			data: 'id='+id+'&name='+name+'&description='+description+'&startHTime='+shour+'&startMTime='+smin+'&endHTime='+ehour+'&endMTime='+emin+'&startDate='+sdate+'&endDate='+edate,           
            success: function(msg) { 
	            if(msg != "") { 
	                getEvents(year,baseUrl);
				    jQuery.fn.colorbox.close()
					cwx.alert('<p>Event Updated successfully.<p>');
					$("a.new_action").colorbox({width:"45%", height:"500px"});
					$("a.event_update").colorbox({width:"45%", height:"500px"});
					$("a.event_view").colorbox({width:"45%", height:"500px"});
	            }  		   
    		}
        }
    )    
	
}
function getCity(id, baseUrl)
{      
		$.ajax( {
		            type: 'POST',
                    url : baseUrl+'/index/get-city/',
                    data: 'id=' + id,
                    success: function( msg ) {  
                        if(msg != "") { 
                          	 $('#City').html(msg);
                        }  		   
                    }
                }
            )    
	
}
/**
*
* @author   Gurvinder
* @param    string  baseUrl 
* @return   void
*/
function getAdvisor(baseUrl)
{   
	$.ajax( {
			type: 'GET',
		    url : baseUrl+'/profiles/advisor/',
		    data: 'requestType=ajax',
            success: function(msg) { 				
	            if(msg != "") { 
	               $('#divManegeAdv').html(msg);
					$("a.update").colorbox({width:"65%", height:"600px"}); 
					$("a.new_action_advisor").colorbox({width:"65%", height:"600px"});
	            }  		   
    		}
        }
    )    
	
}
/**
* @ Modified Date December 16 2009
* @author   Gurvinder
* @return   void
*/
//function addAdvisor(id,fname,email,pass,pic,dob,gender,state,city,zip,phone,notice,statehidden,cityhidden,ziphidden,baseUrl,status)
function addAdvisor(id,fname,email,pass,dob,gender,state,city,zip,phone,statehidden,cityhidden,ziphidden,baseUrl,status)
{ 
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/adduser/',
			//data: 'idProfile='+id+'&txtFullName='+fname+'&txtEmail='+email+'&txtPass='+pass+'&txtPicture='+pic+'&txtDob='+dob+'&chkGender='+gender+'&State='+state+'&City='+city+'&txtZip='+zip+'&txtPhone='+phone+'&chkNoti='+notice+'&statehidden='+statehidden+'&cityhidden='+cityhidden+'&ziphidden='+ziphidden, 
			data: 'idProfile='+id+'&txtFullName='+fname+'&txtEmail='+email+'&txtPass='+pass+'&txtDob='+dob+'&chkGender='+gender+'&State='+state+'&City='+city+'&txtZip='+zip+'&txtPhone='+phone+'&statehidden='+statehidden+'&cityhidden='+cityhidden+'&ziphidden='+ziphidden,                 
			success: function(msg) { 
				if(msg != "emailmatch") { 
	            	//ajaxFileUpload(baseUrl);
				 	getAdvisor(baseUrl); 
				 	jQuery.fn.colorbox.close();
				    if (status == 'Edit') {
						Sexy.alert('<p>Successfully Update Advisor.<p>');
					} else {
						Sexy.alert('<p>New Advisor Added successfully.<p>');
					}
	            } else {
	            	Sexy.alert('<p>Please Provide another email address other than provide email address.<p>');
				} 		   
    		}
        });   
	
}
/**
*
* @author   Gurvinder
* @return   void
*/
function editAdvisor(id,fname,uname,email,pass,pic,dob,gender,state,city,zip,phone,notice)
{  
	$.ajax( {
		    type: 'POST',
            url : baseUrl+'/profiles/adduser/',
			data: 'idProfile='+id+'&txtFullName='+fname+'&txtUserName='+uname+'&txtEmail='+email+'&txtPass='+pass+'&txtPicture='+pic+'&txtDob='+dob+'&chkGender='+gender+'&State='+state+'&City='+city+'&txtZip='+zip+'&txtPhone='+phone+'&chkNoti='+notice,           
            success: function(msg) { 
	            if(msg != "") { 	
					ajaxFileUpload();
					getAdvisor(baseUrl);    				
				    jQuery.fn.colorbox.close();
					Sexy.alert('<p>Advisor Updated successfully.<p>');
	            }  		   
    		}
        }
    )    
	
}

/**
  * Delete Advisor
  *
  **/
function funDeleteAdvisor(pmId,pmUser,pmImg)
{  
	if(pmImg == '')
		pmImg="images/icons/default-img.png";
	else
		pmImg='images/profile/'+pmImg;
	Sexy.confirm('<h1>Are you sure you want to delete this user?</h1><br/><p align="center"> <img src="'+pmImg+'" height="100" border="0" /></p><br/><p align="center">'+pmUser+'</p><br><p>All projects this user used to have will be on your charge now</p>',{ onComplete: 
     
    function(returnvalue) 
	{
		if(returnvalue) {
			$.ajax( {
				type: 'POST',
				url : baseUrl+'/profiles/deleteuser',
				data: 'ids='+pmId+'&rand='+Math.random(),
				success: function(msg) {
					if(msg != "") { 
						getAdvisor(baseUrl);
						Sexy.alert('<p>Advisor Deleted Successfully.<p>');
					}  		   
				}
			})    
	  
		}
	}
	}
 );			
}





/**
*
* @author   Gurvinder
* @param    string  baseUrl 
* @return   void
*/
// upload picture using jquery ajax
function ajaxFileUpload(baseUrl)
	{	
		$.ajaxFileUpload
		(
			{
				url:baseUrl+'/profiles/ajaxupload',
				secureuri:false,
				fileElementId:'txtPicture',
				dataType: 'json',
				success: function (data, status)
				{
					if(typeof(data.error) != 'undefined')
					{
						if(data.error != '')
						{
							alert(data.error);
						}else
						{
							alert(data.msg);
						}
					}
					//alert('Success');
				},
				error: function (data, status, e)
				{
					//alert(e);
				}
			}
		);
		
		return false;

	}
	
/**
  *
  * @Date December 17 2009
  * @param pageurl
  * @para Html Tag id
  * @return void
  * @copyrigt compassionwork.com, All right reserved.
  * 
  * Load Page by Jquery at onclick Event
  * bind callback value in HTML tag as innerHTML
  * Show in landing page
  *  
  * Disclimer
  *
  * Please comment/ add your name as modifier if any modification
  * 
  **/
function innerHTMLBind(tagId,baseUrl,pageUrl) 
  {
	$('#'+tagId).html(document.getElementById('loader_image').innerHTML);
  	$.ajax( {
		    type: 'POST',
            url : baseUrl+pageUrl,
			data: 'requestType=ajax',          
            success: function(msg) { 
	            if(msg != "") { 
					$('#divProposeProj').html('');
					$('#divprofile').html('');
					$('#divManegeAdv').html('');
					//$('#').html('');	
					$('#'+tagId).html(msg);
					//alert(document.getElementById('loader_image').innerHTML);
					
	            } else {
					$('#'+tagId).html('Wrong request. May be Your Session has expired.');
					$('#'+tagId).css('height', '400px');
				} 		   
    		}
        }
    );    
}
 
 /**
  *
  * @Date December 17 2009
  * @param pageurl
  * @para Html Tag id
  * @return void
  * @copyrigt compassionwork.com, All right reserved.
  * 
  * Load Page by Jquery at onclick Event
  * bind callback value in HTML tag as innerHTML
  * Show in landing page
  *  
  * Disclimer
  *
  * Please comment/ add your name as modifier if any modification
  * 
  **/
function studentInnerHtml(tagId,baseUrl,pageUrl) 
  {
	$('#'+tagId).html(document.getElementById('loader_image').innerHTML);
  	$.ajax( {
		    type: 'POST',
            url : baseUrl+pageUrl,
			data: 'requestType=ajax',          
            success: function(msg) { 
	            if(msg != "") { 
					$('#divaffidavit').html('');
					$('#divEditProfile').html('');
					//$('#divManegeAdv').html('');
					//$('#').html('');	
					$('#'+tagId).html(msg);
					//alert(document.getElementById('loader_image').innerHTML);
					
	            } else {
					$('#'+tagId).html('Wrong request. May be Your Session has expired.');
					$('#'+tagId).css('height', '400px');
				} 		   
    		}
        }
    );    
}
  
function manageProfile(baseUrl,pageUrl,page,tagId) 
  {
	$('#'+tagId).html(document.getElementById('loader_image').innerHTML);
  	$.ajax( {
		    type: 'POST',
            url : baseUrl+pageUrl,
			data: 'requestType=ajax&index='+page,          
            success: function(msg) { 
	            if(msg != "") { 
					$('#'+tagId).html(msg);
					//alert(document.getElementById('loader_image').innerHTML);
					
	            } else {
					$('#'+tagId).html('Wrong request. May be Your Session has expired.');
				} 		   
    		}
        }
    );    	
}
  
function deleteProfileInstitution(baseUrl,pageUrl,id) 
  {
	Sexy.confirm('<p>Are you sure want to delete this institution?</p>',{onComplete: 
    function(returnvalue) 
	{
		if(returnvalue) {
			$.ajax( {
				type: 'POST',
				url : baseUrl+pageUrl,
				data: 'id='+id+'&requestType=ajax',
				success: function(msg) {
					if(msg != "") { 
						manageProfile(baseUrl,'/profiles/manage-institution',1,'manage_institution');
						Sexy.alert('<p>Project deleted successfully!</p>') ;
					}  		   
				}
			})    
	  
		}
	}
	}
 );
}
  
function blockProfileInstitution(baseUrl,pageUrl,id) 
  {
  	Sexy.confirm('<p>Are you sure want to change the status of this institution?</p>',{onComplete: 
    function(returnvalue) 
	{
		if(returnvalue) {
			$.ajax( {
				type: 'POST',
				url : baseUrl+pageUrl,
				data: 'id='+id+'&requestType=ajax',
				success: function(msg) {
					if(msg != "") { 
						manageProfile(baseUrl,'/profiles/manage-institution',1,'manage_institution');
						Sexy.alert('<p>Institution Status changed successfully!</p>') ;
					}  		   
				}
			})    
	  
		}
	}
	}
 );
}


function controlService(baseUrl,pageUrl,id,status,profileid)
{
	Sexy.confirm('<p>Are you sure want to change status at this service?</p>',{onComplete: 
    function(returnvalue) 
	{
		if(returnvalue) {
			$.ajax( {
				type: 'POST',
				url : baseUrl+pageUrl,
				data: 'id='+id+'&requestType=ajax&status='+status+'&profileid='+profileid,
				success: function(msg) {
					if(msg != "") { 
						manageProfile(baseUrl,'/profiles/manage-service',1,'manage_services');
						if (status == 1) {
							Sexy.alert('<p>Service Enabled successfully!</p>') ;
						} else {
							Sexy.alert('<p>Service Disabled successfully!</p>') ;
						}
					}  		   
				}
			})    
	  
		}
	}
	}
 );
}

function deleteService(baseUrl,pageUrl,id,profileid)
{
	Sexy.confirm('<p>Are you sure want to delete this service?</p>',{onComplete: 
    function(returnvalue) 
	{
		if(returnvalue) {
			$.ajax( {
				type: 'POST',
				url : baseUrl+pageUrl,
				data: 'id='+id+'&requestType=ajax&profileid='+profileid,
				success: function(msg) {
					if(msg != "") { 
						manageProfile(baseUrl,'/profiles/manage-service',1,'manage_services');
						Sexy.alert('<p>Service delete successfully!</p>') ;
					}  		   
				}
			})    
	  
		}
	}
	}
 );
}

function showOption(id,click)
{
	$('#'+id).show();
	optionId = id;
	clickDiv = 'Yes';
}

function hideOption() 
{
	if(clickDiv == 'No')
		$('#'+optionId).hide();
	clickDiv = 'No';
}

function manageVolunteers(baseUrl,pageUrl,page,tagId) 
{
	$('#'+tagId).html(document.getElementById('loader_image').innerHTML);
  	$.ajax( {
		    type: 'POST',
            url : baseUrl+pageUrl,
			data: 'requestType=ajax&index='+page,          
            success: function(msg) { 
	            if(msg != "") { 
					$('#'+tagId).html(msg);
					//alert(document.getElementById('loader_image').innerHTML);
					
	            } else {
					$('#'+tagId).html('Wrong request. May be Your Session has expired.');
				} 		   
    		}
        }
    );    
}

function blockManageVolunteers(baseUrl,pageUrl,id,status) 
{
  	Sexy.confirm('<p>Are you want to change active status of this volunteers institution?</p>',{onComplete: 
    function(returnvalue) 
	{
		if(returnvalue) {
			$.ajax( {
				type: 'POST',
				url : baseUrl+pageUrl,
				data: 'id='+id+'&requestType=ajax&status='+status,
				success: function(msg) {
					if(msg != "") { 
						Sexy.alert('<p>Volunteers blocked successfully!</p>') ;
						manageVolunteers(baseUrl,'/profiles/manage-volunteers-projects',1,'manageVolunteersProjects');
					}  		   
				}
			})    
	  
		}
	}
	}
 );
}

function manageCsaProfile(baseUrl,pageUrl,page,tagId) 
{
	$('#'+tagId).html(document.getElementById('loader_image').innerHTML);
	$.ajax( {
		    type: 'POST',
            url : baseUrl+pageUrl,
			data: 'requestType=ajax&index='+page,          
            success: function(msg) { 
	            if(msg != "") { 
	            	$('#'+tagId).html(msg);
									
	            } else {
					$('#'+tagId).html('Wrong request. May be Your Session has expired.');
				} 		   
    		}
        }
    );    	
}


