var companyGrid=null;var globalSearchId = 0;var searchType = null;var filterDisplayGrid = 0;function GetCompanySearchData(keyword,typeValue,pageIndex,pageSize,filterCol,type)
{if(filterCol == null)
filterCol = new Array();document.getElementById("txtKeyword").value = keyword;}
function GetCompanySearch(pageIndex,pageSize,filterCol)
{if(filterCol == null)
filterCol = new Array();if(filterCol.length > 0)
{for(var filColumn=0 ;filColumn<filterCol.length;filColumn++)
{if(filterCol[filColumn].FilterVal != null)
{filterDisplayGrid = 1;}
}
}
var keywords=document.getElementById("txtKeyword").value;PageMethods.GetBasicCompanySearch(keywords,filterCol,pageIndex,parseInt($get("ctl00_hdnDefPageSize").value,10),onCompanyDataSuccess,onDataFail);}
function onCompanyDataSuccess(response)
{var displayGrid = document.getElementById('DisplayCompanySearchTblMgr');if(response!= null)
{if(response.TotalRecords == 0)
{document.getElementById("infoDiv").innerHTML="No company found with this criteria";document.getElementById("infoDiv").style.display='block';document.getElementById("successDiv").style.display='none';if(companyGrid != null)
{companyGrid.clearAll();var filterArr = companyGrid.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").style.display='none';document.getElementById("infoDiv").style.display='none';if(displayGrid != null)
{afterActionRefreshFunction = "companyGrid";companyGrid = new tableManager('companyGrid','DisplayCompanySearchTblMgr',response);var col1 = new TblMgrColumn("CompanyName",0);col1.headerText = "CompanyName";col1.columnType ="ro";col1.columnAlign ="left";col1.initialColumnWidth ="60";var CompCustomString="<a onclick='javascript:navtocompanyprofile(##CompanyId##);' class='link_blue' style='cursor:pointer;'>##CompanyName##</a>"
col1.customColumn = CompCustomString;var col2 = new TblMgrColumn("Headquarters",1);col2.headerText = "HeadQuarters";col2.columnType ="ro";col2.columnAlign ="middle";col2.initialColumnWidth ="60";var col3 = new TblMgrColumn("Employees",2);col3.headerText = "Employees";col3.columnType ="ro";col3.columnAlign ="middle";col3.initialColumnWidth ="60";companyGrid.addColumn(col1);companyGrid.addColumn(col2);companyGrid.addColumn(col3);companyGrid.showDeleteButton = false;companyGrid.showInsertButton = false;companyGrid.showSaveButton = false;companyGrid.gridCtrId = "companyGridCntrl";companyGrid.grid.enableMultiline(true);companyGrid.allowPaging = true;companyGrid.PageFunctionName = "GetCompanySearch";companyGrid.displayGrid(displayGrid.id);}
else
{if(response.TotalRecords == 0)
{showInfo(MsgArray["NoJobs"]);companyGrid.clearAll();}
else
{companyGrid.clearAll();companyGrid.updateGrid(response);if(companyGrid.grid.rowsAr != null)
{if(companyGrid.grid.rowsAr.length > 12)
{$get("bottomcompanyGridCntrl").style.display = "block";}
else
{$get("bottomcompanyGridCntrl").style.display = "none";}
}
}
}
}
}
}
function onDataFail()
{}
function EnterKeyPressForCompanySearch(event)
{if(window.event)    
{if(event.keyCode == 13)   
{GetCompanySearch(1,10,null);}
else
return;}
else if(event.which) 
{if(event.which == 13)   
{GetCompanySearch(1,10,null);}
else
return;}
}
function navtomoreoptions()
{document.location="../Quicksignup.aspx?ReturnUrl=Unite/AdvanceCompanySearch.aspx";}
function navtocompanyprofile(p_compid)
{PageMethods.Getnavigateurl(p_compid,OnSuccessnavtocompanyprofile,OnFailednavtocompanyprofile);}
function OnSuccessnavtocompanyprofile(response)
{if(response!="")
{document.location="../Quicksignup.aspx?ReturnUrl="+response;}
}
function OnFailednavtocompanyprofile(response)
{}


