﻿function photoURLBuilder(id)
{
    var URL = '<img src="../images/BeforeAfter/' + id + '_sm.jpg" />';
    return URL;
}

function setupBeforeAfter(id)
{
    var before_photo;
    var after_photo;
    var description;
    
    switch(id)
    {
        case (id = "1"):                 
            before_photo = photoURLBuilder(9);
            after_photo = photoURLBuilder(10);
            description = 'Root canalled teeth can darken over time.  A whitening agent can be placed inside the tooth for 1-2 days until the color matches the rest of the teeth.';        
            break;
        case (id = "2"):
            before_photo = photoURLBuilder(26);
            after_photo = photoURLBuilder(27);
            description = 'White fillings will yellow over time.  These fillings can easily be replaced with new fillings that match the natural tooth color.';        
            break;
        case (id = "3"):
            before_photo = photoURLBuilder(24);
            after_photo = photoURLBuilder(25);
            description = 'Teeth can become discolored from too much fluoride (fluorosis) or poor oral hygiene.  This case demonstrates discolored teeth from poor oral hygiene during orthodontic treatment.  A thin layer of white filling material was used to cover the unsightly white spots.';        
            break;
        case (id = "4"):
            before_photo = photoURLBuilder(30);
            after_photo = photoURLBuilder(31);
            description = 'White fillings can be used to close gaps between the teeth.  This technique requires no drilling, no needles, and is completely reversible.';        
            break;
        case (id = "5"):
            before_photo = photoURLBuilder(32);
            after_photo = photoURLBuilder(33);
            description = 'Older crowns have dark grey edges.  Coupled with gum recession, these crowns can ruin a smile.  In this case, Dr. Freiberg eliminated the dark edges by replacing this old bridge with newer, more esthetic materials';        
            break;                
        case (id = "6"):
            before_photo = photoURLBuilder(38);
            after_photo = photoURLBuilder(39);
            description = 'Some teeth develop smaller than normal.  These teeth can be built to normal size and shape with white filling material or with porcelain.  In this case, Dr. Freiberg used a laser to re-contour the gum tissue and placed porcelain crowns over the two miniature teeth to create this beautiful smile.) ';        
            break;            
        case (id = "7"):
            before_photo = photoURLBuilder(28);
            after_photo = photoURLBuilder(29);
            description = 'Some teeth develop smaller than normal.  These teeth can be built to normal size and shape with white filling material or with porcelain.  In this case, Dr. Freiberg sculpted these teeth using white filling material.  This technique requires no drilling, no needles, and is completely reversible';        
            break;
        case (id = "8"):
            before_photo = photoURLBuilder(44);
            after_photo = photoURLBuilder(45);
            description = 'Some teeth develop smaller than normal.  These teeth can be built to normal size and shape with white filling material or with porcelain.  In this case, Dr. Freiberg sculpted these teeth using white filling material.  This technique requires no drilling, no needles, and is completely reversible';        
            break;
        case (id = "9"):
            before_photo = photoURLBuilder(46);
            after_photo = photoURLBuilder(47);
            description = 'What a difference a little filling material can make in creating a beautiful smile!';        
            break;                
        case (id = "10"):
            before_photo = photoURLBuilder(34);
            after_photo = photoURLBuilder(35);
            description = 'Crooked teeth can be instantly straighter and whiter with porcelain veneers and crowns.  In this case, Dr. Freiberg used a combination of porcelain crowns and veneers to create this stunning smile.';        
            break;            
        case (id = "11"):
            before_photo = photoURLBuilder(36);
            after_photo = photoURLBuilder(37);
            description = 'Crooked teeth can be instantly straighter and whiter with porcelain veneers and crowns.  In this case, Dr. Freiberg used a combination of porcelain crowns and veneers to transform crooked, worn teeth into a youthful, attractive smile.';        
            break;                
        case (id = "12"):
            before_photo = photoURLBuilder(48);
            after_photo = photoURLBuilder(49);
            description = 'Sometimes teeth fail to develop or are lost to decay or trauma.  In this case, Dr. Freiberg bonded a porcelain tooth in the space of a congenitally missing tooth.  This technique required no needles and no drilling of the adjacent teeth.  Dental implants can also be used in cases like this.';        
            break;
        case (id = "13"):
            before_photo = photoURLBuilder(11);
            after_photo = photoURLBuilder(12);
            description = 'Mercury fillings are not only linked to health problems but they are very unsightly.  Dr. Freiberg restored these teeth to health and natural beauty utilizing white fillings and porcelain inlays, onlays, and crowns.';        
            break;                
        case (id = "14"):
            before_photo = photoURLBuilder(13);
            after_photo = photoURLBuilder(14);
            description = 'Mercury fillings are not only linked to health problems but they are very unsightly.  Dr. Freiberg restored these teeth to health and natural beauty utilizing white fillings and porcelain inlays, onlays, and crowns.';        
            break;            
        case (id = "15"):
            before_photo = photoURLBuilder(16);
            after_photo = photoURLBuilder(17);
            description = 'Although these teeth caused no pain, the mercury fillings were extremely worn and needed to be replaced.  Dr. Freiberg restored these teeth to health and natural beauty utilizing porcelain inlays and crowns.';        
            break;
        case (id = "16"):
            before_photo = photoURLBuilder(18);
            after_photo = photoURLBuilder(19);
            description = 'These fillings were about 15 years old and are typical of most mercury fillings in the mouth. Cracks in the fillings and in the enamel can be observed.  Dr. Freiberg used porcelain crowns and onlays to strengthen these teeth and to restore them to their natural beauty.';        
            break;
        case (id = "17"):
            before_photo = photoURLBuilder(20);
            after_photo = photoURLBuilder(21);
            description = 'Large mercury fillings can jeopardize the integrity of a tooth.  Their design weakens the remaining enamel, causing cracks that can eventually break the tooth.  Fortunately, Dr. Freiberg was able to save all of these teeth using porcelain crowns and onlays.';        
            break;                
        case (id = "18"):
            before_photo = photoURLBuilder(40);
            after_photo = photoURLBuilder(41);
            description = 'Mercury fillings usually only last 12-15 years.  Newer materials can last equally as long and actually strengthen the remaining tooth structure.  In this case, Dr. Freiberg replaced the larger mercury fillings with porcelain crowns and restored the smaller mercury fillings with composite filling material.';        
            break;            
        case (id = "19"):
            before_photo = photoURLBuilder(1);
            after_photo = photoURLBuilder(2);
            description = 'Years of yellowing were removed in just over one hour with ZOOM! In-office whitening system.';        
            break;                
        case (id = "20"):
            before_photo = photoURLBuilder(3);
            after_photo = photoURLBuilder(4);
            description = 'Years of yellowing were removed in just over one hour with ZOOM! In-office whitening system.';        
            break;                    
        case (id = "21"):
            before_photo = photoURLBuilder(5);
            after_photo = photoURLBuilder(6);
            description = 'Tetracycline (an antibiotic) used during tooth development caused the dark grey appearance of these teeth.  Although the dark color is deep within the tooth, ZOOM! whitening dramatically improved the appearance of these teeth.';        
            break;                
        case (id = "22"):
            before_photo = photoURLBuilder(7);
            after_photo = photoURLBuilder(8);
            description = 'Years of yellowing were removed in just over one hour with ZOOM! In-office whitening system.';        
            break;                    
        }               
        
        change(before_photo, after_photo, description)
}

function change(before_img, after_img, description)
{
    var b = $('before-photo');
    var a = $('after-photo');
    var d = $('description');
    
    b.innerHTML = before_img;
    a.innerHTML = after_img;
    d.innerHTML = description;
}

