
/*Candidate Class*/
function EmployerValidation()
{
    this.displayErrorMessage = false;
    this.validationSuccessful = true;
    this.validationMessage = "";
}

EmployerValidation.prototype.ValidateEmployerLocation = function(source)
{
    var sourcePath = source.id.substring(0,source.id.lastIndexOf("_"));
    var locations = this.GetThisFormControl(sourcePath,"lstJobLocation");
    if(locations.options.length<1)
    {
        this.validationSuccessful = false;
    }  
}
EmployerValidation.prototype.GetThisFormControl = function(sourcePath,control) 
{
    return document.getElementById(sourcePath + "_" + control);
}


/*****************************************************************/
function PopupWindow()
{
    this.args = "";
    this.OpenURLSrc = "";
}
PopupWindow.prototype.Popup = function(window,width,height,status,resizable,location,scrollbars,toolbar,top,left)
{
    this.args = "height=" + height + "px,width=" + width +"px,status:" + status + ",resizable=" + resizable + ",location=" + location +
        ",scrollbars=" + scrollbars +",toolbar=" + toolbar + ",top=" + top + ",left=" + left;       
    this.OpenURLSrc = window;      
}

/****************************************************************/
function validateEmployerLocation(source,arguments)
{
    var employer = new EmployerValidation();
    employer.ValidateEmployerLocation(source);
    arguments.IsValid = employer.validationSuccessful;
}
function PopupCandidateDetails(candidateId)
{            
    var win = "Popup/CandidateProfile.aspx?candidate=" + candidateId;
    //window,width,height,status,resizable,location,scrollbars,toolbar,top,left
     var popWindow = new PopupWindow()
     popWindow.Popup(win,960,950,"yes","yes","no","yes","yes",0,100);    
    
    window.open(popWindow.OpenURLSrc,'','height=760px,width=850px,status:yes,resizable=yes,location=no,scrollbars=yes,toolbar=yes,top=0,left=100');
    
}
function PopupCandidateStatDetails(candidateId)
{            
    var win = "Popup/CandidateStat.aspx?candidateId=" + candidateId;
    //window,width,height,status,resizable,location,scrollbars,toolbar,top,left
     var popWindow = new PopupWindow()
     popWindow.Popup(win,960,950,"yes","yes","no","yes","yes",0,100);    
    
    window.open(popWindow.OpenURLSrc,'','height=560px,width=850px,status:yes,resizable=yes,location=no,scrollbars=yes,toolbar=yes,top=0,left=100');
    
}
function PopupEmpStatDetails(employerId)
{            
    var win = "Popup/EmployerStat.aspx?employerId=" + employerId;
    //window,width,height,status,resizable,location,scrollbars,toolbar,top,left
     var popWindow = new PopupWindow()
     popWindow.Popup(win,960,950,"yes","yes","no","yes","yes",0,100);    
    
    window.open(popWindow.OpenURLSrc,'','height=560px,width=850px,status:yes,resizable=yes,location=no,scrollbars=yes,toolbar=yes,top=0,left=100');
    
}
function PopupHelp(bookmark)
{
    var win = "Popup/Help.aspx#" + bookmark;
    //window,width,height,status,resizable,location,scrollbars,toolbar,top,left
    var popWindow = new PopupWindow()
    popWindow.Popup(win,200,400,"yes","yes","no","yes","no",0,100);        
    window.open(popWindow.OpenURLSrc,'','height=400px,width=400px,status:yes,resizable=yes,location=no,scrollbars=yes,toolbar=no,top=0,left=100');
}
function PopupEmployerHelp(bookmark)
{
    var win = "Popup/EmployerHelp.aspx#" + bookmark;
    //window,width,height,status,resizable,location,scrollbars,toolbar,top,left
    var popWindow = new PopupWindow()
    popWindow.Popup(win,200,400,"yes","yes","no","yes","no",0,100);        
    window.open(popWindow.OpenURLSrc,'','height=400px,width=400px,status:yes,resizable=yes,location=no,scrollbars=yes,toolbar=no,top=0,left=100');
}
function PopupCandidateNotes(candidateId)
{
     var win = "Popup/CandidateNote.aspx?candidate=" + candidateId;
    //window,width,height,status,resizable,location,scrollbars,toolbar,top,left
     var popWindow = new PopupWindow()
     popWindow.Popup(win,960,950,"yes","yes","no","yes","yes",0,100);    
    
    window.open(popWindow.OpenURLSrc,'','height=560px,width=850px,status:yes,resizable=yes,location=no,scrollbars=yes,toolbar=yes,top=0,left=100');

}
function PopupEmpNotes(employerId)
{
    var win = "Popup/EmployerNote.aspx?employer=" + employerId;
    //window,width,height,status,resizable,location,scrollbars,toolbar,top,left
     var popWindow = new PopupWindow()
     popWindow.Popup(win,960,950,"yes","yes","no","yes","yes",0,100);    
    
    window.open(popWindow.OpenURLSrc,'','height=560px,width=850px,status:yes,resizable=yes,location=no,scrollbars=yes,toolbar=yes,top=0,left=100');

}