﻿// JScript File

    function doUsefullLinks()
    {
        try
        {
            window.location = 'UsefullLinks.aspx';
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }        
    }
    
    function doLegal()
    {
        try
        {
            window.location = 'Legal.aspx';
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }        
    }    

    function doAwards()
    {
        try
        {
            location.href = 'Awards.aspx';
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }        
    }    
        
    function onSiteMap()
    {
        try
        {
            window.location = 'HBISiteMap.aspx';
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }        
    }        
    
    function goToHoggettBowersExecutiveSearch()
    {
        try
        {
            window.location = 'http://www.hoggett-bowers.com/';
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }  
    }
    
    function doContactUs()
    {
        try
        {
            window.location = 'ContactUs.aspx';
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }        
    }    
    
    
    function onRightNavClick(sender)
    {
        try
        {
            if(sender.navid.length > 0)
            {
                window.location =  sender.navigateURL+"?Section="+sender.section+"&_sNavId="+sender.navid
                throw new exception();
            }
            if(sender.section.length > 0)
            {
                window.location = sender.navigateURL+"?Section="+sender.section;
            }        
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }
    }
        
    function doSubmitCV()
    {
        try
        {
           window.location =  "SubmitCv.aspx?Section=[ASSIGNMENTS]&AssigmentAction=yes";
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }  
    }
   
    function doCaseStudy()
    {
        try
        {
            window.location =  "CaseStudy.aspx?Section=[CASE_STUDY]";
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }
    }   
    
    function doTestimonial()
    {
        try
        {
            window.location =  "Testimonial.aspx?Section=[TESTIMONIAL]";
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }        
    }
    
    function processJobRequest(sJobId, sApplyNow, sEmailFriend)
    {
        if(sApplyNow == 1)
        {
            window.location = 'SubmitCv.aspx?Section=[ASSIGNMENTS]&sJobId=' + sJobId + '&sApplyNow=1&sEmailFriend=0';
        }
        else if ( sEmailFriend == 1 )
        {
            window.location = 'SubmitCv.aspx?Section=[ASSIGNMENTS]&sJobId=' + sJobId + '&sApplyNow=0&sEmailFriend=1';
        }
    }      
    
    function ScrollTop()
    {
        try
        {
            window.scrollTo(0,0);
        }
        catch(e)
        {
        }
    }
    
    function _GoBack()
    {
        history.go(-1);         
    }    
    
    function onConsultantClick(consultantId)
    {
        try
        {
            window.location = 'Consultants.aspx?Section=[CONSULTANTS]&consultantId='+ consultantId;
        }
        catch(e)
        {
            alert('e.message: ' + e.message);
        }        
    }
    
    function clearText(sender)
    {
        sender.value = '';
    }

    function alignText(sender, orientation)
    {
        sender.style.textAlign = orientation;
    }

    function userInfomation(sender)
    {
        try
        {
            if ( document.getElementById(sender.id) == null )
            {
                throw exception();
            }
            else
            {
                sender = document.getElementById(sender.id)    
            }
            
        }
        catch(e)
        {
            sender = document.getElementById(sender)
        }
        sender.focus();
        alert('Please enter your search criteria !');
    }

