var peopleGrid=null;var globalSearchId = 0;var searchType = null;var filterDisplayGrid = 0;function GetPeopleSearchData(keyword,pageIndex,pageSize,filterCol,type)
{if(filterCol == null)
filterCol = new Array();document.getElementById("txtKeyword").value = keyword;}
function GetPeopleSearch(pageIndex,pageSize,filterCol)
{ShowProgress("anchorBasicSearch");var keywords=document.getElementById("txtKeyword").value;PageMethods.GetBasicPeopleSearch(keywords,filterCol,pageIndex,parseInt($get("ctl00_hdnDefPageSize").value,10),onPeopleDataSuccess,onDataFail);}
function onPeopleDataSuccess(response)
{var displayGrid = document.getElementById('DisplayPeopleTblMgr');if(response!= null)
{if(response.TotalRecords == 0)
{document.getElementById("infoDiv").innerHTML="No people found with this criteria";document.getElementById("infoDiv").style.display='block';document.getElementById("successDiv").style.display='none';if(peopleGrid != null)
{peopleGrid.clearAll();var filterArr = peopleGrid.GetFilterModel();var isFiltersExist = false;for(var i = 0;i<filterArr.length;i++)
{if(filterArr[i].FilterKey == undefined && filterArr[i].FilterVal == undefined)
{}
else
{isFiltersExist = true;}
}
if(!isFiltersExist)
{}
else
{}
}
}
if(response.TotalRecords > 0)   
{document.getElementById("successDiv").innerHTML="Total no of people found:"+response.TotalRecords;document.getElementById("successDiv").style.display='block';document.getElementById("infoDiv").style.display='none';if(displayGrid != null)
{afterActionRefreshFunction = "peopleGrid";peopleGrid = new tableManager('peopleGrid','DisplayPeopleTblMgr',response);var peopleCustomString="<table width='100%' border='0' cellspacing='0' cellpadding='0' class='noborder'>"
+"<tr><td style='width: 60px;border:0px'>"
+"<img src='../Polls/GetThumbnail.aspx?filename=../PhotoImages/UserGallery/##ImagePath##&width=75&height=75' />"
+"</td>"        
+"<td style='border:0px'><table>"
+"<tr>"
+"<td style='color: Blue;border:0px'>"
+"<a href='javascript:void(0)'  class='link_blue'  onclick='NavigateToRegistrationPage()'> <strong>##Name##</strong> </a>"
+"</td>"
+"</tr>"
+"<tr>"
+"<td style='border:0px'>"
+"<strong>##Org##</strong>"
+"</td>"
+"</tr>"
+"<tr>"
+"<td style='border:0px'></td>"
+"</tr>"
+"<tr>"
+"<td style='height: 23px;border:0px'><a href='javascript:void(0)' class='link_blue' onclick='OpenProfile(\"##LiveResumeName##\")'>View full profile</a> | <a href='javascript:void(0)'  class='link_blue' onclick='NavigateToRegistrationPage()'>Contact ##Name##</a>"
+"</td>"
+"</tr>"
+"</table>"
+"</td>"
+"<td style='color:Blue;border:0px'></td>"
+"</tr>"
+"<tr>"
+"<td style='width: 60px;border:0px'> "
+"</td>"
+"<td style='border:0px'>"
+"<table class='noborder'>"
+"</table>"
+"</td>"
+"<td style='border:0px'></td>"
+"</tr>"
+"</table>"
var col1= new TblMgrColumn("Results",0);col1.customFilterText = "Name,Role,Organization";col1.customFilterHeaderText = "Name,Role,Organization";col1.columnType ="ro";col1.customColumn = peopleCustomString;col1.colTooltip = false;col1.colFilterRequired = true;col1.columnSortRequired = false;col1.initialColumnWidth ="900";peopleGrid.addColumn(col1);peopleGrid.showDeleteButton = false;peopleGrid.showInsertButton = false;peopleGrid.showSaveButton = false;peopleGrid.gridCtrId = "peopleGridCntrl";peopleGrid.grid.enableMultiline(true);peopleGrid.allowPaging = true;peopleGrid.PageFunctionName = "GetPeopleSearch";peopleGrid.displayGrid(displayGrid.id);}
else
{if(response.TotalRecords == 0)
{showInfo(MsgArray["NoJobs"]);peopleGrid.clearAll();}
else
{peopleGrid.clearAll();peopleGrid.updateGrid(response);if(peopleGrid.grid.rowsAr != null)
{if(peopleGrid.grid.rowsAr.length > 12)
{$get("bottompeopleGridCntrl").style.display = "block";}
else
{$get("bottompeopleGridCntrl").style.display = "none";}
}
}
}
}
}
HideProgress("anchorBasicSearch");}
function onDataFail()
{}
function OpenProfile(pname)
{if(pname!="")
{var URL=document.getElementById(contextPrefix+'hdnURL').value;var win = window.open("http://"+URL+"in/"+pname,"_blank","width=1024,height=700,left=0,top=0,status=no,toolbar=no,addressbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes");if(win==null)
{alert("Please disable popup blocker");}
else
{win.moveTo(0,0);}
}
else
{NavigateToRegistrationPage();}
}
function NavigateToRegistrationPage()
{var searchKey = document.getElementById("txtKeyword").value;if(searchKey.indexOf("+"))
searchKey = searchKey.replace(/\+/g,",plus,");searchKey = searchKey.replace(/\'/g,"");document.location="../Quicksignup.aspx?ReturnUrl=Unite/AdvancePeopleSearch.aspx?keywords=" + escape(searchKey);}
function EnterKeyPressForPeopleSearch(event)
{if(window.event)    
{if(event.keyCode == 13)   
{GetPeopleSearch(1,10,null);}
else
return;}
else if(event.which) 
{if(event.which == 13)   
{GetPeopleSearch(1,10,null);}
else
return;}
}


