﻿// JScript File


strResizedPicturesFolder = '/Pictures/' // '/ResizedPictures/'

function formatImage(src, imageType)
{
    //var newSrc = src.replace('/thumb/',imageType);
    var index = src.indexOf('/Pictures/');
    var refinedSrc = src.substring(index);
    
    var newSrc = strResizedPicturesFolder + imageType + '/P/' + refinedSrc.replace('/thumb/','/Web/');
    //alert('Old: ' + src + ', New: ' + newSrc );
    return newSrc;
}


(function($) {


$(function(){

    //job of the week - job and employer home
    $("div.jobofweek img").each(function(i)
                            {   this.src = formatImage( this.src, '/147xAny/');     }
       );
       
    //Header branding image - jobs and employer details
    $("div.employerbranding img").each(function(i)
                            {   this.src = formatImage( this.src, '/984xAny/');     }
       );
       
    //Jobs Home   
   // $("#jobs_home div.employer img").each(function(i)
      //                      {   this.src = formatImage( this.src, '/66xAny/');     }
   //    );
       
    //Job Search Results
    $("#jobs_searchresults div.jobssearchresults img").each(function(i)
                            {   this.src = formatImage( this.src, '/120xAny/');     }
       );
    
    //Job Details
    //Recruiter details image
    $("#jobs_jobdetails div.employerdetails_sleeve img").each(function(i)
                            {   this.src = formatImage( this.src, '/120xAny/');     }
       );
       

       
    //Employers Home
    $("#jobs_employerhome div.employer img").each(function(i)
                            {   this.src = formatImage( this.src, '/66xAny/');     }
       );
       
    //Employer Search Results
    $("#jobs_employersearchresults div.jobssearchresults img").each(function(i)
                            {   this.src = formatImage( this.src, '/66xAny/');     }
       );
             
    //Employer Details
    //Further details image
    $("#jobs_employerdetails div.employerdetails_sleeve img").each(function(i)
                            {   this.src = formatImage( this.src, '/120xAny/');     }
       );
    //Featured job image
    $("#jobs_employerdetails div.jobssearchresults img").each(function(i)
                            {   this.src = formatImage( this.src, '/120xAny/');     }
       );
       
       
})

 })(jQuery);
