var arPersonal = new Array('/RandomImages/Personal/sihle_personal_quote_1.jpg','/RandomImages/Personal/sihle_personal_quote_2.jpg','/RandomImages/Personal/sihle_personal_quote_3.jpg','/RandomImages/Personal/sihle_personal_quote_4.jpg');
var arBusiness = new Array('/RandomImages/Business/sihle_business_quote_1.jpg','/RandomImages/Business/sihle_business_quote_2.jpg','/RandomImages/Business/sihle_business_quote_3.jpg','/RandomImages/Business/sihle_business_quote_4.jpg');

var typeToPull = "r";
var imageToPull = "";

$(document).ready(function(){

    var currentPage = location.pathname.toLowerCase();
    

    if (currentPage.indexOf("/personal/") != -1) {
        typeToPull = "p";
    }
     
    if (currentPage.indexOf("/business/") != -1) {
        typeToPull = "b";
    }
    
    switch (typeToPull)
    {
    
        case "p":
        
            var ranNum = Math.floor(Math.random() * arPersonal.length);
            imageToPull = arPersonal[ranNum];
        
            break;            
        
        case "b":
        
            var ranNum = Math.floor(Math.random() * arBusiness.length);
            imageToPull = arBusiness[ranNum];
            
            break;
            
        default:
        
            var arAll = arPersonal.concat(arBusiness);
            var ranNum = Math.floor(Math.random() * arAll.length);
            imageToPull = arAll[ranNum];
            
            break;
            
    
    }
    

	// this is where we will set the random image

	$("#getQuoteCTA").css("background-image", "url('" + imageToPull + "')");


});

