﻿// JScript File
dialogReg='';
var menumove1="";
var tbMainGrid="";
var RegType="";



/*
    THIS FUNCTION IS FOR SHOW AND HIDE OF THE LAYERS IN POPUP EXTENDER
    BASICALLY JST FOR MANAGE USER POPUP.
    THIS FUNCTIONS ACCEPT FOUR LAYER NAME
    1) THIS WILL BE VISIBLE
    2-4) WILL BE HIDDEN.
*/
function ShowHideLayers(ShwDivName,HidDiv1,HidDiv2,HidDiv3,HidDiv4,HidDiv5,HidDiv6)
      {
      
      if (ShwDivName=="divmanageusers")
      {
        BlankAllValues();        
      }
      
      if(ShwDivName=="divCreateUsers")
      { 
        DivHide();
      }   
   
        document.getElementById(ShwDivName).style.display = "block";
        document.getElementById(HidDiv1).style.display = "none";
        document.getElementById(HidDiv2).style.display = "none";
        document.getElementById(HidDiv3).style.display = "none";
        document.getElementById(HidDiv4).style.display = "none";
        document.getElementById(HidDiv5).style.display = "none";
        document.getElementById(HidDiv6).style.display = "none"; 
        if (document.getElementById('litmsg2')!= null)
        {
            document.getElementById('litmsg2').innerHTML = "";
        }
        
              
        
   }    
   

/*
THIS FUNCTION GET THE COMMA SEPERATED VALUES OF THE LOGGED IN USER
THIS FUNCTION WILL SPLIT THE STRING AND ASSIGN THE VALUE TO THE HIDDEN FIELD
SAME HIDDEN FIELD CAN BE USED TO PREFILL THE EDIT MODE
*/   
function SbGetMyProfileValue(Rvalue)
{
    //alert("here i am ")
    //alert(Rvalue);
     var Arrayvalue=Rvalue.split(","); 
     //hidFname
     document.getElementById('hidPassword').value=Arrayvalue[2];
     document.getElementById('hidemail').value=Arrayvalue[3];
      document.getElementById('HidTitle').value=Arrayvalue[4];
     document.getElementById('hidFname').value=Arrayvalue[5];
     document.getElementById('hidMname').value=Arrayvalue[6];
     document.getElementById('hidSname').value=Arrayvalue[7];
     document.getElementById('hidPhoneNumber').value=Arrayvalue[8];
     document.getElementById('hidFaxNumber').value=Arrayvalue[9];
     document.getElementById('hidMobileNumber').value=Arrayvalue[10];
     document.getElementById('hidMyRecruiterUserID').value=Arrayvalue[1];
    AssignValuesToLabels(Rvalue)
    EditMyValue('divMyProfile','divEditMyProfile')
}   
/*
THIS FUNCTION GET THE COMMA SEPERATED VALUES OF THE LOGGED IN USER
THIS FUNCTION WILL SPLIT THE STRING AND ASSIGN THE VALUE TO THE LABELS
*/    
function AssignValuesToLabels(Rvalue)
    {
        //lblFname  
        var Arrayvalue=Rvalue.split(","); 
        //alert(Arrayvalue[5]);
        var StrFullName;
        StrFullName = "";
        StrFullName = Arrayvalue[5] +' '+ Arrayvalue[6] + ' '+ Arrayvalue[7];
        document.getElementById('lblFullName').innerHTML = StrFullName;  
        document.getElementById('lblTitle').innerHTML = Arrayvalue[4];  
        document.getElementById('lblEmail').innerHTML = Arrayvalue[3];  
        document.getElementById('LblPhoneNumber').innerHTML = Arrayvalue[8];  
        document.getElementById('lblFaxNumber').innerHTML = Arrayvalue[9];  
        document.getElementById('lblMobileNumber').innerHTML = Arrayvalue[10];  
        
    }
/*
    THIS FUNCTION IS FOR PUTTING BACK THE VALUE OF HIDDEN FIELDS TO THE EDIT MY PROFILE FIELDS. 
*/    

function EditMyValue(Showdiv, Hiddiv)
    {
    
        /*
         * CREATED BY: GURU
         * CREATED DATE: 29-MAY-2007   
        */    
        document.getElementById(Hiddiv).style.display = "none";           
        document.getElementById(Showdiv).style.display = "block";
        if (document.getElementById('lblUser')!=null)
        {
        document.getElementById('txtmyusername').value= document.getElementById('lblUser').innerHTML;
        }
        if (document.getElementById('txtUUname')!=null)
        {
        document.getElementById('txtmyusername').value= document.getElementById('txtUUname').value;
        }
        document.getElementById('txtmypassword').value= document.getElementById('hidPassword').value;
        document.getElementById('txtmypassword_Confirm').value= document.getElementById('hidPassword').value;
        document.getElementById('txtmyemail').value= document.getElementById('hidemail').value;
        document.getElementById('txtmytitle').value= document.getElementById('HidTitle').value;
        document.getElementById('txtmyfname').value= document.getElementById('hidFname').value;
        document.getElementById('txtmymname').value= document.getElementById('hidMname').value;
        document.getElementById('txtmysname').value= document.getElementById('hidSname').value;
        document.getElementById('txtmyfax').value= document.getElementById('hidFaxNumber').value;
        document.getElementById('txtmymobile').value= document.getElementById('hidMobileNumber').value;
        document.getElementById('txtmyphonenumber').value= document.getElementById('hidPhoneNumber').value;
        document.getElementById('txtmyusername').disabled = true;
        document.getElementById('txtmyemail').disabled = true;
        document.getElementById('btnupdateMyprofile').value = "Update";
        document.getElementById("txthidfunctionName").value = "UpdateMyProfile";
        document.getElementById("txthidfunctionValue").value = document.getElementById('hidMyRecruiterUserID').value;
        document.getElementById('lblupdateMyProfile').innerHTML = "";
        document.getElementById('txtmyusername').disabled = true;
              
        
    }    
    
    
function SbGetCompanyProfileValue(Rvalue)  
{
   // alert(Rvalue);
    var Arrayvalue=Rvalue.split(","); 
   // alert(Arrayvalue[12] +'<---------->'+ Arrayvalue[13]);
    document.getElementById('txteditcompanyName').value = Arrayvalue[1]
   	document.getElementById('txteditcompanydescp').value = Arrayvalue[2]
   	document.getElementById('txteditcompanyaddress1').value = Arrayvalue[3]
   	document.getElementById('txteditcompanyaddress2').value = Arrayvalue[4]
   	document.getElementById('txteditcompanypostcode').value = Arrayvalue[5]
   	document.getElementById('txteditcompanyphonenumber').value = Arrayvalue[10]
   	document.getElementById('txteditcompanyfax').value = Arrayvalue[11]
   	document.getElementById('txteditcompanymoble').value = Arrayvalue[12]
   	document.getElementById('txteditcompanywebsite').value = Arrayvalue[13]
   	document.getElementById("txthidfunctionName").value = "UpdateMyProfile";
    document.getElementById("txthidfunctionValue").value = Arrayvalue[14];
    document.getElementById('lblupdateEditcompanyprofile').innerHTML = "";
	
}  
    
function ShowUsers(RecturesUserName)
            {             
             //alert(RecturesUserName);
            
            
             var GrdTable = document.getElementById("GrdManageSubUsers");
             var TxtUserName = document.getElementById("txtSubUsername");
             var VtxtEmail = document.getElementById("txtSubEmail");
             var VtxtTitle = document.getElementById("txtSubTitle");
             var Vtxtfname = document.getElementById("txtSubFName");
             var VtxtMname = document.getElementById("txtSubMname");
             var Vtxtsurname = document.getElementById("txtSubLname");
             var VtxtSubPhone = document.getElementById("txtSubPhone");
             var VtxtSubFax = document.getElementById("txtSubFax");
             var VtxtSubMobile = document.getElementById("txtSubMobile");
             
            
                       
           GrdTable.value="";
           TxtUserName.value="";
           VtxtEmail.value="";
           VtxtTitle.value="";
           Vtxtfname.value="";
           VtxtMname.value="";
           Vtxtsurname.value="";
           VtxtSubPhone.value="";
           VtxtSubFax.value="";
           VtxtSubMobile.value="";
             
             ShowHideLayers('divmanageusers','divMyProfile','divCreateUsers','divpermissions','divaccsettings','divEditMyProfile','divEditCompanyProfile');
             
             // for checking for paging action
             
             if (document.getElementById('GrdPageCount')!=null)
             {
                PageCount = document.getElementById('GrdPageCount');
             }
             var RowsCount = GrdTable.rows.length;            
             
             
             if (PageCount=='1' && RowsCount<12)
             {
                Grdlength=GrdTable.rows.length;
             }
             else if (PageCount=='1' && RowsCount >= 12)
             {
                Grdlength=GrdTable.rows.length-1;
             }
             else if(PageCount>'1')
             {
                Grdlength=GrdTable.rows.length-1;
             }
             
             // end paging action
        //console.log(Grdlength)                        
             
            
             for(i=0;i<Grdlength;i++)
             {
            // var StrUserName =GrdTable.rows[i].cells[0].innerText.substring(GrdTable.rows[i].cells[0].innerText,GrdTable.rows[i].cells[0].innerText.length-1);
           // alert(RecturesUserName);
            if (GrdTable.rows[i].cells[12] != null)
            {            
            var StrUserName = GrdTable.rows[i].cells[12].innerText;            
            
            }
            
            if (StrUserName != null)
            {
            
                if(RecturesUserName == StrUserName)
                    {                       
                           
                        TxtUserName.value=GrdTable.rows[i].cells[1].innerText;
                    
                        VtxtEmail.value=GrdTable.rows[i].cells[3].innerText;
                        VtxtSubPhone.value=GrdTable.rows[i].cells[5].innerText;
                        Vtxtfname.value=GrdTable.rows[i].cells[6].innerText;
                        VtxtMname.value=GrdTable.rows[i].cells[7].innerText;
                        Vtxtsurname.value=GrdTable.rows[i].cells[8].innerText;
                        VtxtTitle.value=GrdTable.rows[i].cells[10].innerText;
                        VtxtSubFax.value=GrdTable.rows[i].cells[9].innerText;
                        VtxtSubMobile.value=GrdTable.rows[i].cells[11].innerText;
                     
                        
                    }
            }
             }           
           document.getElementById("txthidfunctionValue").value = RecturesUserName;
           document.getElementById('txtSubUsername').disabled=true;
            document.getElementById('btnsaveSubUsers').value="Update";          
            
            }            
 function ValidateSubUsers()
{
    if (document.getElementById('btnsaveSubUsers').value == "Update")
        {
            document.getElementById("txthidfunctionName").value = "UpdateSubUSer";
            //document.getElementById("txthidfunctionValue").value = "35";
           // alert("value set as " + document.getElementById("txthidfunctionName").value + "----" + document.getElementById("txthidfunctionValue").value)
        }    
}
            
     
  
    function FillRecruiterUserdls(Resultvalue)
    {    var divShowd = document.getElementById('AutoComp');           
            divShowd.innerText="";            
           UserArrays = Resultvalue.split(",");
         var Arrayvalue=Resultvalue.split(",");
         for(var j=0;j<Arrayvalue.length;j++)
            {
            
            var oDiv = document.createElement('div');
		    divShowd.appendChild(oDiv);
		        try
		            {
		                oDiv.innerHTML    = Arrayvalue[j];
		            }
		       catch(e)
		            {
		                //this.Cbo_Error('405','Error','Text returned from Call Back was invalid');
		            return;
		            }
		            
		            oDiv.noWrap=true;		            
		            oDiv.className    = "ListItem";
		            oDiv.onmousedown  = Div_MouseDown;
		            oDiv.onmouseover  = Div_MouseOver;
		            oDiv.onmouseout   = Div_MouseOut;
            }
         
         //   alert(UserArrays);
    }
    Div_MouseDown=function()
    {
        var txtbx = document.getElementById('TxtUserSearch');
        txtbx.value=this.innerHTML;	
    }
    
    Div_MouseOver = function()
    {
            var txtbx = document.getElementById('TxtUserSearch');
        txtbx.value=this.innerHTML;
        //if( this.ListItemHoverClass.length > 0 )
	    //    this.className = this.ListItemHoverClass;
	    //else
	      //  {
	        this.style.backgroundColor = 'black';
            this.style.color = 'white';
	    //   }
    }

Div_MouseOut = function()
{
 
	  this.style.backgroundColor = 'white';
    this.style.color = 'black';
	
}
function clearTxt()
{
    var divShowc = document.getElementById('AutoComp');
    divShowc.style.display='none';
}
function DivShow()
{
    var divShow1 = document.getElementById('AutoComp');
    divShow1.style.visibility = 'visible';
    divShow1.style.display='block';
}
function DivHide()
{   
    var divShow1 = document.getElementById('AutoComp');
    divShow1.style.visibility = 'hidden';
    
}

 function BlankCheck()
   {
        if (document.getElementById('TxtUserSearch') != null)
        
            {
             var txt= document.getElementById('TxtUserSearch');
                if (txt.value=="")
                    {
                      alert("Enter UserName");
                      return false;
                      
                    }
            
            }          
            
            
      } 
  
   function BlankAllValues()
                {
                    document.getElementById('txtSubUsername').value= "";
                    document.getElementById('txtSubpassword').value= "";
                    document.getElementById('txtSubEmail').value= "";
                    document.getElementById('txtSubTitle').value= "";
                    document.getElementById('txtSubFName').value= "";
                     document.getElementById('txtSubMname').value= "";
                     document.getElementById('txtSubLname').value= "";
                     document.getElementById('txtSubPhone').value= "";
                     document.getElementById('txtSubFax').value= "";
                     document.getElementById('txtSubMobile').value= "";
                     
                     if (document.getElementById('txtSubUsername').disabled == true)                     
                        {
                            document.getElementById('txtSubUsername').disabled = false;
                            document.getElementById('btnsaveSubUsers').value="Save";
                        }
                }
                
            
            function ShowMySettings()
            {
              location.href="setting.aspx";
                //mywindow = window.open ("setting.aspx","mywindow","location=0,status=0,scrollbars=0,toolbar=0,width=750,height=550");
//                mywindow.moveTo(500,300);
            }           


// ALL CLIENT CALLBACK DATA FROM SERVER.            
function ReceiveServerData(rValue, StrParam)
{   
        
    _IsErrorFromLogin = false;
    var Checkstring=rValue.substring(0,8);
    if(Checkstring=='Showgrid')
     {
        var ShowResumeDiv = document.getElementById('res');     
        var htmlstring=rValue.substring(8,rValue.length+1);
        if (document.getElementById('Res')!=null)
            {
                ShowResumeDiv.innerHTML="";       
                ShowResumeDiv.innerHTML =htmlstring.substring(2,htmlstring.length);
                if (document.getElementById('iframeShowResume')!=null)
                    {
                        document.getElementById('iframeShowResume').src="iframePreviewPane.htm";
                        document.getElementById('iframeShowResume').style.visibility="visible";
                     }
           } // end of Res
    } // end of Checkstring=='Showgrid'
    else if(Checkstring=='FillTabl')
     {        
       FillTable(rValue); 
     }
    else if(Checkstring=="PosTable")
     {
        
        PopulatingPostingdata(rValue, StrParam);
     }
    else if(Checkstring=="ResTable")
     {
        PopulatingResumedata(rValue, StrParam);
     }
     else if(Checkstring=="SndRTabl")
     {
     
        PopulatingSendResumedata(rValue, StrParam);
     
     }
      else if(Checkstring=="SndATabl")
     {
        //alert(rValue);
        PopulatingSendAppdata(rValue, StrParam);
     
     }
     
     
    else if(Checkstring =="VCLTable")
     {
       populateLatestVCL(rValue);
     }
    else if(Checkstring=="RecMlBox")
     {
        PopulateRecruiterMailbox(rValue);
     }
    else if(Checkstring=='MyPrfleV')
     {
      SbGetMyProfileValue(rValue)
     }
    else if(Checkstring=='SearhGrd')
     {
        PopulatingSearchdata(rValue, StrParam);
        innerLayout.getRegion('center').panels.items[1].setTitle('Search Result');
     }
    else if (Checkstring == 'AppsResp')
     {       
        AppsResponse(rValue, StrParam);
     }
    else if (Checkstring == 'PrivResp')
     {       
        PrivResponse(rValue);
     }
    else if (Checkstring == 'FindSlar')
     {
        ResponseFindSimilar(rValue)
     }
    else if(Checkstring=='CompProf')
     {
        var Arrayvalue=rValue.split("^$^"); 
       	document.getElementById('txteditcompanyName').value = Arrayvalue[1]
   	    document.getElementById('txteditcompanydescp').value = Arrayvalue[2]
   	    document.getElementById('txteditcompanyaddress1').value = Arrayvalue[3]
   	    document.getElementById('txteditcompanyaddress2').value = Arrayvalue[4]
   	    document.getElementById('txteditcompanypostcode').value = Arrayvalue[5]
   	    document.getElementById('txteditcompanyphonenumber').value = Arrayvalue[10]
   	    document.getElementById('txteditcompanyfax').value = Arrayvalue[11]
   	    //document.getElementById('txteditcompanymoble').value = Arrayvalue[12]
   	    document.getElementById('txteditcompanywebsite').value = Arrayvalue[13]
   	    document.getElementById("txthidfunctionName").value = "UpdateMyProfile";
        document.getElementById("txthidfunctionValue").value = Arrayvalue[14];
        document.getElementById('lblupdateEditcompanyprofile').innerHTML = "";
        var Ddlistper = document.getElementById('ddleditcompanycountry'); 
        var Ddllistcity = document.getElementById('ddleditcompanyprofile'); 
        var txtCity = document.getElementById('txteditcompanyprofile');
        for (var i = 0; i < Ddlistper.length; i++)
            {
                if (Ddlistper.options[i].value == Arrayvalue[7])
                    {
                        //alert("sss")
                        Ddlistper.options[i].selected = true
                    }
            }        
        if (document.getElementById('ddleditcompanyprofile')!=null)
           {
                for (var i = 0; i < Ddllistcity.length; i++)
                    {
                        if (Ddllistcity.options[i].value == Arrayvalue[8])
                            {
                                //alert("sss")
                                Ddllistcity.options[i].selected = true
                            }
                    }
            }   
         else if(Arrayvalue[6] != "")
            {
                txtCity.value = Arrayvalue[6];
            }
       
     }
     else if(Checkstring=='Recruitr')
     {
        FinalRvalue = rValue.substring(10,rValue.length+1);
        FillRecruiterUserdls(FinalRvalue);
     }
     else if(Checkstring=='Errrrror')
     {
         _IsErrorFromLogin = true;
        FinalRvalue = rValue.substring(9,rValue.length+1);
        FinalRvalue = FinalRvalue.replace("SearhGrd~[Error]~0~0~Ld","")
        Ext.MessageBox.alert('Message', FinalRvalue);
        unMaskGrid (gridMain);
     }
    else if(Checkstring=='PlzLogin')
     {
        // WHEN THE USER IS TRYING TO SEARCH SOMETHING WITHOUT LOGIN
        
        FinalRvalue = rValue.substring(9,rValue.length+1);
        _IsErrorFromLogin = true;
        Ext.EventManager.onDocumentReady(LayoutExample.showDialog, LayoutExample, true); 
        Ext.MessageBox.alert('Message', FinalRvalue);
        // SHOW HIM THE LOGIN SCREEN
        unMaskGrid (gridMain);
     }
   else
    {
      //DisplayFolders(rValue);
    }
    
        
    }
    
    function Showhidediv(divname)
{
       var RefrenceNumber = document.getElementById("txtRefrenceNumber").value;
       var cboJobTitleID=document.getElementById("cboJobTitleID").value;
       var Email=document.getElementById("txtjobpostingEmail").value;
       
        if(divname=="Paymentjob")
        {
                  
            var divposting=document.getElementById(divname);
            divposting.style.visibility = 'visible';
            var divposting=document.getElementById('posting');
            divposting.style.visibility = 'hidden';
            
            /*
            WE ARE ASSIGNING THE VALUES OF TEXT FILED TO LABLE
            */
               document.getElementById("lbljobpostingshowrefnumber").innerHTML = RefrenceNumber;
               document.getElementById("lbljobpostingjobtitle").innerHTML = cboJobTitleID;
               document.getElementById("lbljobpostingemial").innerHTML = Email;
               
              
              /*
              END OF ASSIGNING VALUES
              */         
                       
            
            
            
        }
        else
        {
            var divposting=document.getElementById(divname);
            if(divposting !=null)
            {
                divposting.style.visibility = 'visible';
            }
            divposting=document.getElementById('Paymentjob');
            if(divposting !=null)
            {
                divposting.style.visibility = 'hidden';
            }
            
          
        }
}     
function ShowContractdetails()
{
var VarcboJobTypeID = document.getElementById('cboJobTypeID')
 varcontract = VarcboJobTypeID[VarcboJobTypeID.selectedIndex].text; 
 
  //var jobpostinglabel=document.getElementById("divjobpostinglabel");
  var jopostingtextbox=document.getElementById("divjopostingtextbox");
  
  
  if (varcontract != "Select")
  { 
  
    if(varcontract=="Contract")
        {
           jopostingtextbox.style.visibility = 'visible'; 
           jopostingtextbox.style.display="block";
        }
    else
        {
            jopostingtextbox.style.visibility = 'hidden';
            jopostingtextbox.style.display="none";
            
        }
  
  }
  
//  
//  if(varcontract=="Contract")
//  {
//  if(jobpostinglabel!=null )
//  {
//  
//   // jobpostinglabel.style.visibility = 'visible';
//    jopostingtextbox.style.visibility = 'visible';
//    jopostingtextbox.style.display="block";
//   // jobpostinglabel.style.display="block";
//  }
//  
//  }
//  else
//  {
//   if(jobpostinglabel!=null)
//  {
//  
//   // jobpostinglabel.style.visibility = 'hidden';
//    jopostingtextbox.style.visibility = 'hidden';
//    jopostingtextbox.style.display="none";
//    //jobpostinglabel.style.display="none";
//  }
//  }
//   }
//   else
//   {
//    // jobpostinglabel.style.visibility = 'hidden';
//    jopostingtextbox.style.visibility = 'hidden';
//    jopostingtextbox.style.display="none";
//    //jobpostinglabel.style.display="none";
//   }
   
} 
function PopulatingSendResumedata(scity, StrParam)
{
///lert('scity--'+scity);

  var myArray = scity.split('~');    
  var htmlstring =eval(myArray[1]);
  var Dd=new Boolean(1) //drag and drop
  var DdContext=new Boolean(1) 
 
  gridMain.dataSource.loadData(htmlstring,false);
  
   getToolbarButton(tbMainGrid, "Move To").disable();
   getToolbarButton(tbMainGrid, "Filter").disable();
   getToolbarButton(tbMainGrid, c_Send_msg_Contact).disable();
   getToolbarButton(tbMainGrid, c_SendToCollegueText).disable();
   getToolbarButton(tbMainGrid, "Find Similar CVs").disable();
}


function PopulatingSendAppdata(scity, StrParam)
{
///lert('scity--'+scity);

  var myArray = scity.split('~');    
  var htmlstring =eval(myArray[1]);
  var Dd=new Boolean(1) //drag and drop
  var DdContext=new Boolean(1) 
 
  //gridMain.dataSource.loadData(htmlstring,false);
  CheckIfTabClose (4, gridMyApplication, MyApplicationLayout, 'MyApplication');
  CreateTabGrid(4,'Send Applications',gridMyApplication, 'MyApplicationInner2', MyApplicationLayout);
  gridMyApplication.dataSource.loadData(htmlstring,false);;
  
   getToolbarButton(CVApplicationGridtb, c_Send_msg_Contact).disable();
   //getToolbarButton(CVApplicationGridtb, c_ApplicationFilterText).disable();
   getToolbarButton(CVApplicationGridtb, c_ShortlistAppText).disable();
   getToolbarButton(CVApplicationGridtb, c_SendToCollegueText).disable();
   getToolbarButton(CVApplicationGridtb, c_RejectedAppText).disable();
   getToolbarButton(CVApplicationGridtb, c_InterviewAppText).disable();
   getToolbarButton(CVApplicationGridtb, 'Filter').disable();
   getToolbarButton(CVApplicationGridtb, 'Clear Filter').disable();
   
   //inorder to disable some items in tab toolbar 
   
    IsOpenedByInvited=true;
}


function PopulatingResumedata(scity, StrParam)
{     
  var myArray = scity.split('~');    
  var htmlstring =eval(myArray[1]);
  var Dd=new Boolean(1) //drag and drop
  var DdContext=new Boolean(1) // drag and drag group
  //alert(document.getElementById('CheckSrch').value +"<------------------------->")
 
  if(document.getElementById('CheckSrch').value == 'SRCH')
     {
        
        
        var obj1SavedSearchGRD=document.getElementById('SavedSearchGRD');
        
        dsSavedSearch.loadData(htmlstring,false);
        
        /* 
        * THE SCROLL LOADING FOR MY SAVED CVS
        *
        */
        
        
         var ArrStrParam = StrParam.split('|');
         dsSavedSearch._baseParam = ArrStrParam[0]; 
         
         _CVAlertScrollBarFilter = false; 
         if (oCVAlertScrollBar == null)
          {
             oCVAlertScrollBar = new CGridScrollBar ();
             
          }
          else
          {
             oCVAlertScrollBar.currentpos = 0;
             oCVAlertScrollBar.scrollOffset = 50;
             oCVAlertScrollBar.scrollOffsetInterval = 50;
             oCVAlertScrollBar.currentPage = 1;
          } 
         
         if(_CVAlertScrollBarFilter) {
            oCVAlertScrollBar.filterType = 1;        
            
         }
         else {
            oCVAlertScrollBar.filterType = 0;  
         }
         
         
            oCVAlertScrollBar.loadingStatus = true;
            oCVAlertScrollBar.url = c_URL + 'EXT_Handler/Recruiter/GridProcessing.ashx';
            oCVAlertScrollBar.ds = dsSavedSearch;
            oCVAlertScrollBar.requestType = 'cvalrtscroll';
            oCVAlertScrollBar.addGridListener (gridSavedSearch);
            getToolbarButton(tbSavedSearch, "Clear Filter").disable();
            
        
                
        
        if (myArray[1] == "[]")
        {
          loadFunction(gridSavedSearch);  
        }        
        gridSavedSearch.container.unmask();
        
        if (menuT.items.length == 1)
            {
              LoadMoveToMenu(0,folderid);
            }
            var objMoveTomenu = tbSavedSearch.items.get('SavedSearchMoveTo');
            objMoveTomenu.menu=menuT;
            mycvsAlertContextMenu.items.get('MySavedSearchContextMoveTo').menu=menuT; 
        
        
     }
   else if(document.getElementById('CheckSrch').value = 'MYCV')
     {
       
        
         var obj1SavedSearchGRD=document.getElementById('MysavedCVsGRD')
         ///gridMySavedCvs.ds.loadData(htmlstring,false);
        // alert(htmlstring);
         dsMySavedCvs.loadData(htmlstring,false);
         var ArrStrParam = StrParam.split('|');
         dsMySavedCvs._baseParam = ArrStrParam[0]; 
         _SavedCVsScrollBarFilter = false; 
         if (oSavedCVsScrollBar == null)
          {
             oSavedCVsScrollBar = new CGridScrollBar ();
          }
          else
          {
             oSavedCVsScrollBar.currentpos = 0;
             oSavedCVsScrollBar.scrollOffset = 50;
             oSavedCVsScrollBar.scrollOffsetInterval = 50;
             oSavedCVsScrollBar.currentPage = 1;
          } 
         oSavedCVsScrollBar.filterType = 0;  
         oSavedCVsScrollBar.loadingStatus = true;
         oSavedCVsScrollBar.url = c_URL + 'EXT_Handler/Recruiter/GridProcessing.ashx';
         oSavedCVsScrollBar.ds = dsMySavedCvs;
         oSavedCVsScrollBar.requestType = 'cvscroll';
         oSavedCVsScrollBar.addGridListener (gridMySavedCvs);
        getToolbarButton(tbMySavedCvs, "Clear Filter").disable();
         
         if (myArray[1] == "[]")
            {
                loadFunction(gridMySavedCvs);  
            }
            
            if (menuT == 'undefined') {
                LoadMoveToMenu(0,folderid);
            }
            else if (menuT.items.length == 1) {
              LoadMoveToMenu(0,folderid);
            }
            
            var objMoveTomenu = tbMySavedCvs.items.get('SavedCvsMoveTo');
            objMoveTomenu.menu=menuT;
            mySavedcvsContextMenu.items.get('MySavedCvsContextMoveTo').menu=menuT;
             
            
            
     }
}
function populateLatestVCL(Sdata)
{
        var myArray = Sdata.split('~');    
      var htmlstring =eval(myArray[1]);
      
    dsVCLLetest.loadData(htmlstring,false);         
         if (myArray[1] == "[]")
            {
                //loadFunction(gridMySavedCvs); 
                 loadFunction(GridVCLLetest);
            }
}
      
function PopulatingSearchdata(Sdata, StrParam)
{
  
      var myArray = Sdata.split('~');    
      var htmlstring =eval(myArray[1]);
      var ArrStrParam = StrParam.split('|');
      if (myArray[1] == "[Error]") {
        enableKeywordSearch ();
        InvalidKeyword();
        htmlstring = "";
       // return;
      }
      dsSearch._baseParam = ArrStrParam[0];
     
      if (document.getElementById("TotalRows") != null){
               document.getElementById("TotalRows").value=myArray[2];
      }
      if (document.getElementById("NthRow") != null){
               document.getElementById("NthRow").value=myArray[3];
      }
      if(myArray[4]=="Ld"){
                dsSearch.loadData(htmlstring,false);   //false to reload the records
                var ArrStrParam = StrParam.split('|');
                dsSearch._baseParam = ArrStrParam[0];
      }
      else
            dsSearch.loadData(htmlstring,false); //true to append the records
          
            
       enableKeywordSearch ();
        
                _CVSearchScrollBarFilter = false; 
                if (oCVSearchScrollBar == null)
                  {
                    oCVSearchScrollBar = new CGridScrollBar ();
                  }
                  else
                  {
                     oCVSearchScrollBar.currentpos = 0;
                     oCVSearchScrollBar.scrollOffset = 50;
                     oCVSearchScrollBar.scrollOffsetInterval = 50;
                     oCVSearchScrollBar.currentPage = 1;
                  } 
                  
                   if(_CVSearchScrollBarFilter)
                    oCVSearchScrollBar.filterType = 1;        
                   else
                    oCVSearchScrollBar.filterType = 0;  
                  
                    oCVSearchScrollBar.loadingStatus = true;
                    oCVSearchScrollBar.url = c_URL + 'EXT_Handler/Recruiter/GridProcessing.ashx';
                    oCVSearchScrollBar.ds = dsSearch;
                    oCVSearchScrollBar.requestType = 'mnscroll';
                    oCVSearchScrollBar.addGridListener (gridMain);
                  // END OF SCROLL LOADING

      
      document.getElementById('centeriframe').src="recruiter/empty_job_preview.htm";
      //emptyPreviewPane(document.getElementById('centeriframe'),gridMain);
      disablePreviewToolbar(ObjtbPreviewpane,gridMain,'disable');
      gridMain.colModel.setColumnWidth(0,150)           
      
      if (myArray[1] == "[]") { 
            loadFunction(gridMain);  
      }
      
    if (menuT.items.length == 1) {
      LoadMoveToMenu(0,folderid);
    }
      
    dragZone = new Ext.grid.GridDragZone(gridMain, {containerScroll:true,ddGroup:'TreeDD'});
     
    gridMain.on('rowcontextmenu', function(grid, rowIndex, event){
            var data = gridMain.getSelectionModel();
            Resumesid = data.selections.items[0].data.Resumeid;     
            CName = data.selections.items[0].data.Fname + " (Ref#"+ Resumesid +")";  
            //Resumesid = dsSearch.data.items[rowIndex].json[1];
           // CName = data.selections.items[0].data.Fname; 
    	    var rowEl = gridMain.getView().getRow(rowIndex);
            var record = gridMain.getDataSource().getAt(rowIndex);    
            contextmenu1.showAt(event.getXY());
        }); 
        
    
    contextmenu1 = new Ext.menu.Menu({
            id:'contextmenu'
            , items: [
                new Ext.menu.Item({
                    id:'NewTab'
                    , handler:MultipleTabOpen               
                    , icon: "Images/new_tab.gif"
                    , text: 'Open'
                }),
                new Ext.menu.Item({
                    id:'MoveTo'                           
                    , icon: "Images/new_tab.gif"
                    , text: 'MoveTo'
                    , menu: menuT
                })
                
            ]
        });
    
    //_popup.hide();
   //gridMain.container.unmask();
 
   
}

function callCVAlert(){
         url="Recruiter_SavedAlerts.aspx?t=Add&searched=true&aid=";
           Js_RecSavedAlert = new RecruiterSavedAlert;
            Js_RecSavedAlert._iFrameID = "FrameID"+1;
            Js_RecSavedAlert._layerID = "Recruiter_SavedAlert_Panel";
            Js_RecSavedAlert._iframeDivID = "divRecruiter_SavedAlert_Form";
            Js_RecSavedAlert._src = url;
            Js_RecSavedAlert.init();
}
function showhidegridposting(postingdivid)
{
//alert(postingdivid);

    var DivPostingFrame=document.getElementById("DivPostingFrame");
    var divPanelfolder=document.getElementById("divPanelfolder");
    if(postingdivid=="DivPostingFrame")
    {
         if(DivPostingFrame.style.visibility != 'visible')
         {
           
            DivPostingFrame.style.visibility = 'visible';
            divPanelfolder.style.visibility = 'hidden';
            DivPostingFrame.style.display="block";
            divPanelfolder.style.display="none";
            
           
          }  
    }
    else
    {
        //if(divPanelfolder.style.visibility != 'visible')
         //{
            DivPostingFrame.style.visibility = 'hidden';
             DivPostingFrame.style.display="none";
            divPanelfolder.style.visibility = 'visible';
            divPanelfolder.style.display="block";
           
          //}
    }
    

}


function FilterIcon()
{  
FilterSelect=false;
var ListBoxElements = new Array(14)
    ListBoxElements[0]= 'ListBoxSector';
    ListBoxElements[1]= 'ListBoxYearsOfEx';    
    ListBoxElements[2]= 'ListBoxJobTitle';
    ListBoxElements[3]= 'ListBoxDesiredJobTitle';
    ListBoxElements[4]= 'ListBoxDesiredSalary';    
    ListBoxElements[5]= 'ListBoxDesiredSector';
    ListBoxElements[6]= 'ListBoxDesiredLocation';
    ListBoxElements[7]= 'ListBoxUniversity';
    ListBoxElements[8]= 'ListBoxDesipline';    
    ListBoxElements[9]= 'ListBoxCourseTitle';
    ListBoxElements[10]= 'ListBoxGrade';
    ListBoxElements[11]= 'ListBoxSalary';
    ListBoxElements[12]= 'ListBoxCountry';
    ListBoxElements[13]= 'ListBoxLanguages';
    ListBoxElements[14]= 'ListBoxAvailability';


   for(i=0;i<ListBoxElements.length;i++) 
   {
    
  if (document.getElementById(ListBoxElements[i])!=null)
    {
      itm = document.getElementById(ListBoxElements[i]);      
        for(j=0;j<itm.length;j++)
            {
                if(itm.options[j].selected==true)
                {                    
                    FilterSelect=true;
                    chageicon();
                    break;
                }
                
            }
    
    }
  } 
    
    
}

function SelectFilterIcon()
{
    if (FilterSelect==true)
    {   
        Showicon="Images/showfilter1.jpg";
        Hideicon="Images/hidefilter1.jpg";
        ActiveTooltip="Filter applied";
    }
    else 
        {
        Showicon="Images/showfilter2.jpg";
        Hideicon="Images/hidefilter2.jpg";
        ActiveTooltip="No Filter applied";
    }
    
}

function chageicon()
{
SelectFilterIcon();
 if (document.getElementById("btnhide").value=="Show Filters")

        {
            
            //innerLayout.getRegion('north').resizeTo(165);
            //document.getElementById("divCreditSystemBottomPart").style.display = "block";
            //document.getElementById("divCreditSystemBottomPart").style.visibility="hidden";
            //document.getElementById("btnhide").value="Hide Filter";
            imagehide.src=Hideicon;

        }
    else
        {
            //innerLayout.getRegion('north').resizeTo(82);
            //document.getElementById("divCreditSystemBottomPart").style.visibility="visible";
            //document.getElementById("divCreditSystemBottomPart").style.display = "none";
            //document.getElementById("btnhide").value="Show Filters";
            imagehide.src=Showicon;

        }

}
function MultipleTabOpen()
{

  var dss=""; 
    ActivePanelId=innerLayout.getRegion('center').activePanel.Id; // to diffrenciate the filter based on the TabPanel
     
     //alert(ActivePanelId);
     if (ActivePanelId == 'main1')
        {            
            multipletttb(gridMain,dsSearch)
         
        }
     else if (ActivePanelId == '1')
        {
            multipletttb(gridMySavedCvs,dsMySavedCvs)
            
        }
     else if (ActivePanelId == '2')
        {
            multipletttb(gridSavedSearch,dsSavedSearch)
            
            
        }
    
  
}

function multipletttb(GridObj,DsObj)
{
//alert(datasource);
    var sm=GridObj.getSelectionModel();
			var rows=sm.getSelections();
			//var cindex=dd.getDragData(e).rowIndex;			
			for(i = 0; i < rows.length; i++) {
				rowData = DsObj.getById(rows[i].id);
				var ResumeID = rowData.data.Resumeid;
				var Cname = rowData.data.Fname + "(Ref# "+ ResumeID +")"
				CreateTab1(ResumeID, Cname);				
			}	
}
function callcheck()
{
   // alert('calling');
}
function PopulatingPostingdata(scity, StrParam)
{ 
   //alert(folderid)
//getToolbarButton(tbMainGrid, "Clear Filter").disable ();
 gridJobpostingHeader = gridJobposting.getView().getHeaderPanel(true); 
    if (folderid == 'JOBPSDraft')
        {
        	CVJobPostingGrid(gridJobpostingHeader,'1'); 
        	R_ContextMenu = JobPostingContextMenu('1')
        }
    else if (folderid == 'JOBPSLive')
        {
        	CVJobPostingGrid(gridJobpostingHeader,'2'); 
        	R_ContextMenu = JobPostingContextMenu('2')
        	if (document.getElementById("perJobposting").value == "0")
        	 {
        	   tbjobposting.items.items[3].disabled = true
        	   R_ContextMenu.items.items[1].disabled = true
            }
        }
    else if (folderid == 'JOBPSArchive')
        {
        	CVJobPostingGrid(gridJobpostingHeader,'3'); 
        	R_ContextMenu = JobPostingContextMenu('3')
        }
        getToolbarButton(tbjobposting, "Clear Filter").disable ();    

      var myArray = scity.split('~');    
      var htmlstring =eval(myArray[1]);
      dsJobPosting.loadData(htmlstring,false);
      var ArrStrParam = StrParam.split('|');
      dsJobPosting._baseParam = ArrStrParam[0];
      
      var Dd=new Boolean(0) //drag and drop
      var Ddcontext=new Boolean(0) // drag and drag group     
      
      // START OF IMPLEMENTING THE SCROLL LOADING 
      if (oJobGridScrollBar == null)
      {
        oJobGridScrollBar = new CGridScrollBar ();
        _JobGridScrollBarFilter = false; 
      }
      else
      {
         oJobGridScrollBar.currentpos = 0;
         oJobGridScrollBar.scrollOffset = 50;
         oJobGridScrollBar.scrollOffsetInterval = 50;
         oJobGridScrollBar.currentPage = 1;
      } 
      
       if(_JobGridScrollBarFilter) {
            oJobGridScrollBar.filterType = 1;        
            getToolbarButton(tbjobposting, "Clear Filter").enable();        
        }
       else {
            oJobGridScrollBar.filterType = 0; 
             
        }
      
        oJobGridScrollBar.loadingStatus = true;
        oJobGridScrollBar.url = c_URL + 'EXT_Handler/Recruiter/GridProcessing.ashx';
        oJobGridScrollBar.ds = dsJobPosting;
        oJobGridScrollBar.requestType = 'scroll';
        oJobGridScrollBar.addGridListener (gridJobposting);
      // END OF SCROLL LOADING
      
      
      
      if (myArray[1] == "[]")
        {
          loadFunction(gridJobposting);  
        }
 
      
      
}


function InvalidKeyword()
{
    Ext.MessageBox.alert("Error", "Invalid keyword found. Please check for closing brackets and quotes." );
}

function loadFunction(grid)
{
//    if(this.grid.dataSource.getCount() == 0)
//        {
            grid.view.mainBody.update("<div align='center' style='height:50px; font:11px arial, helvetica;padding:10px;'>No Records found</div>");
            //grid.PreviewPane=='empty';
//        }
//    else
//    {
//        gridJobposting.grid.selModel.selectFirstRow();
   // }
}


function ShowLoadingMsgInGrid(grid, ds, msg)
{
    ds.removeAll()
    grid.view.mainBody.update("<div align='center' style='height:50px; font:11px arial, helvetica;padding:10px;'>"+ msg +"</div>");    
}



function AppsResponse(ResponseString, StrParam)
{
    var myArray = ResponseString.split('~');
    var htmlstring =eval(myArray[1]);
    dsMYApplication.loadData(htmlstring,false); 
   // gridMyApplication.ds.loadData(htmlstring,false);
    var ArrStrParam = StrParam.split('|');
    dsMYApplication._baseParam = ArrStrParam[0];
    // gridMyApplication.ds._baseParam = ArrStrParam[0];
    
    
    if (oJobAppGridScrollBar == null)
    {
        oJobAppGridScrollBar = new CGridScrollBar ();
    }
    else
    {
       oJobAppGridScrollBar.currentpos = 0;
       oJobAppGridScrollBar.scrollOffset = 50;
       oJobAppGridScrollBar.scrollOffsetInterval = 50;
       oJobAppGridScrollBar.currentPage = 1;
    }
    if(_JobAppGridScrollBarFilter) {
     oJobAppGridScrollBar.filterType = 1;   
     getToolbarButton(CVApplicationGridtb, "Clear Filter").enable(); 
     getToolbarButton(CVApplicationGridtb, "Clear Filter").param = StrParam
    }
    else {
        oJobAppGridScrollBar.filterType = 0; 
        getToolbarButton(CVApplicationGridtb, "Clear Filter").searchAction = StrParam    
     }
    oJobAppGridScrollBar.loadingStatus = true;
    oJobAppGridScrollBar.url = c_URL + 'EXT_Handler/Recruiter/GridProcessing.ashx';
    oJobAppGridScrollBar.ds = dsMYApplication;
    oJobAppGridScrollBar.requestType = 'appscroll';
    oJobAppGridScrollBar.addGridListener (gridMyApplication);
                     
    var Dd=new Boolean(0) //drag and drop
    var Ddcontext=new Boolean(0) // drag and drag group
    
    gridMyApplication.autoSize();
    //CVApplicationGridtb.items.get('ShortlistAppText').enable();  
   // CVApplicationGridtb.items.get('RejectedAppText').enable(); 
    
    
    
    if (myArray[1] == "[]")
        {
          loadFunction(gridMyApplication);  
        }
    
}
function PrivResponse(ResponseString)
{
    var myArray = ResponseString.split('~');
    var htmlstring =eval(myArray[1]);
    dsMyPrivateResume.loadData(htmlstring,false);                  
    var Dd=new Boolean(0) //drag and drop
    var Ddcontext=new Boolean(0) // drag and drag group
    CreateTabGrid('5','Private CVs Request','','',MyPrivateLayout,'');
    if (myArray[1] == "[]")
    {
      loadFunction(gridMyPrivateResume);  
    }
}
function ResponseFindSimilar(ResponseString)
{
     var myArray = ResponseString.split('~');
    var htmlstring =eval(myArray[1]);
    dsFindSimilarCVs.loadData(htmlstring,false);
    
   if (myArray[1] == "[]")
    {
      loadFunction(gridFindSimilarCVs);  
    }
}



function HideDropDown()
{
    if (document.getElementById("SignOut") == null)
    {       
        //return false;
    }
    var obj=$find("AutoCompleteJava");    
    if(obj !=null)
    {        
        if (document.getElementById("SignOut") != null)            
            {
                if (document.getElementById("testDIV") != null)        
                {
                    document.getElementById("testDIV").style.display="none";
                }
            }
    }
}



//Added by Jiju
function ShowSettingsLayer()
{
    
   Ext.EventManager.onDocumentReady(Layout_Settings.init, Layout_Settings, true); 
}

var Layout_Settings = 
{
    init : function()
            {
                 dialogSettings = new Ext.LayoutDialog("Recruiter_Settings_Panel", 
                { 
                    modal:false,
                    width:890,
                    height:550,
                    shadow:false,
                    proxyDrag: true,
                    resizable : false,
                    closable : true, 
                    center: 
                    {
                        autoScroll:true,
                        tabPosition: 'top',
                        closeOnTab: true,
                        alwaysShowTabs: false,
                        resizeTabs:false
                    }
                });
                dialogSettings.addKeyListener(27, dialogSettings.hide, dialogSettings);
                dialogSettings.addButton('Close',dialogSettings.hide, dialogSettings);
                layoutSettings = dialogSettings.getLayout();
                layoutSettings.beginUpdate();
                
                Settingspanel = new Ext.ContentPanel(
                        Ext.DomHelper.overwrite('divRecruiter_Settings_Form', {
                        tag: 'iframe',
                        id: 'ifrSettings',
                        frameBorder: 0,
                        width: "100%",
                        height: "500px",
                        src: "Setting.aspx"
                    }));
                    //,{title: 'Recruiter Registration', closable: true , text: "Please wait. Loading..."});              

                layoutSettings.add('center', new Ext.ContentPanel('divRecruiter_Settings_Form',{title: 'Settings'}));
             
                layoutSettings.endUpdate();
                dialogSettings.show();
            }    
}    


function ShowRegistration(sTargetLayer)
{
   // alert('i am here')
   //Ext.onReady(Layout_Reg.init, Layout_Reg, true); 
   JS_RecruiterRegistration = null;
   if (JS_RecruiterRegistration == null) { 
    JS_RecruiterRegistration = new Layout_Reg;
   JS_RecruiterRegistration._TargetLayer = sTargetLayer;
    JS_RecruiterRegistration.init();
   }
   else
    {
        JS_RecruiterRegistration.ShowDialog();
    }
}



function CloseMyLayer()
{
    // if (JS_RecruiterRegistration != null) { 
        // JS_RecruiterRegistration = new Layout_Reg;
        //JS_RecruiterRegistration.hideDialog();
     //}
}

var Layout_Reg = 
{
    init : function()
    
            {
                dialogReg = new Ext.LayoutDialog("Recruiter_Reg_Panel", 
                { 
                    modal:false,
                    width:600,
                    height:650,
                    shadow:false,
                    proxyDrag: true,
                    resizable : false,
                    closable : true, 
                    center: 
                    {
                        autoScroll:false,
                        tabPosition: 'top',
                        closeOnTab: true,
                        alwaysShowTabs: false,
                        resizeTabs:false
                    }
                });
                dialogReg.addKeyListener(27, dialogReg.hide, dialogReg);
                
                layoutReg = dialogReg.getLayout();
                layoutReg.beginUpdate();
                
                Regpanel = new Ext.ContentPanel(
                        Ext.DomHelper.overwrite('divRecruiter_Reg_Form', {
                        tag: 'iframe',
                        id: 'ifrReg',
                        frameBorder: 0,
                        width: "100%",
                        height: "650px",
                        src: "recruiter_registration.aspx"
                    }));
                    //,{title: 'Recruiter Registration', closable: true , text: "Please wait. Loading..."});              

                layoutReg.add('center', new Ext.ContentPanel('divRecruiter_Reg_Form',{title: 'Recruiter Registration'}));
             
                layoutReg.endUpdate();
                dialogReg.show();
            }// end of init
          
            
    
            
                
     }
     
     
     
     
     
 //-----------------------------------------------------
 /*   START LAYOUT FOR REGISTRATION                    */
 //-----------------------------------------------------
     
     
     
var Layout_Reg = function () 
 {
    this._TargetLayer  = null;
    this.init = function()
            {
               this.dialog = new Ext.LayoutDialog('Recruiter_Reg_Panel', 
                { 
                    modal:false,
                    width:600,
                    height:600,
                    shadow:false,                    
                    proxyDrag: true,
                    resizable : false,
                    closable : true, 
                    autoScroll:true,
                    center: 
                    {
                        autoScroll:false,
                        tabPosition: 'top',
                        closeOnTab: true,
                        alwaysShowTabs: false,
                        resizeTabs:true
                    }
                });                
                
                this.dialog.addKeyListener(27, this.dialog.hide, this.dialog);
                //this.dialog.addButton('Show Results',this.dialog.hide, this.dialog);
                this.layout = this.dialog.getLayout();
                this.layout.beginUpdate();
                
                this.CVLpanel = new Ext.ContentPanel(
                        Ext.DomHelper.overwrite('divRecruiter_Reg_Form', {
                        tag: 'iframe',
                        Id: 'ifrReg',
                        frameBorder: 0,
                        width: "100%",
                        height: "650px",
                        src: "recruiter_registration.aspx?tp="+this._TargetLayer
                    }),{});

		        this.layout.add('center', new Ext.ContentPanel('divRecruiter_Reg_Form',{title: 'Recruiter Registration'}));             
                this.layout.endUpdate();
                this.dialog.show();
                };   // end initp           

this.hideDialog = function ()
 {
   this.dialog.hide();
  } 
  
  
  this.ShowDialog = function ()
 {
   this.dialog.show();
  }


} //end of  class
     
     
 //-----------------------------------------------------
 /*   END LAYOUT FOR REGISTRATION                     */
 //-----------------------------------------------------
 
function PopulateRecruiterMailbox(ResponseString)
{
    var myArray = ResponseString.split('~');
    var htmlstring =eval(myArray[1]);
    dsRecruiterMailbox.loadData(htmlstring,false);                  
    CreateTabGrid('6',document.getElementById('SelectedFolderText').value,'','',RecruiterMailLayout,'');
    if (myArray[1] == "[]")
    {
      loadFunction(gridRecruiterMail);  
    }    

}     
     
/*function ShowFilterLayer()
{
   Ext.onReady(Layout_Reg.init(), Layout_Reg, true); 
}

var Layout_Reg = 
{
    init : function()
            {
            
            if(!dialogReg)
            {
                
                dialogReg = new Ext.LayoutDialog("Recruiter_Filter_Panel", 
                { 
                    modal:false,
                    width:350,
                    height:700,
                    shadow:false,
                    minWidth:550,
                    minHeight:650,
                    proxyDrag: true,
                    resizable : true,
                    closable : true, 
                    center: 
                    {
                        autoScroll:true,
                        tabPosition: 'top',
                        closeOnTab: true,
                        alwaysShowTabs: false,
                        resizeTabs:true
                    }
                });
                dialogReg.addKeyListener(27, dialogReg.hide, dialogReg);
                
                layoutReg = dialogReg.getLayout();
                layoutReg.beginUpdate();
                
                Regpanel = new Ext.ContentPanel(
                        Ext.DomHelper.overwrite('divRecruiter_Filter_Form', {
                        tag: 'iframe',
                        id: 'ifrReg',
                        frameBorder: 0,
                        width: "100%",
                        height: "700px",
                        src: "RecruiterSearchFilter.aspx"
                    }));
                    //,{title: 'Recruiter Registration', closable: true , text: "Please wait. Loading..."});              

                layoutReg.add('center', new Ext.ContentPanel('divRecruiter_Filter_Form',{title: 'Recruiter Search Filter'}));
             
                layoutReg.endUpdate();
                dialogReg.show();
                }
                else
                {
                    dialogReg.show();
                    
                }
            }    
} */
     


