﻿
<!--
var product_selector = 
{
    //PROPERTIES
    
    image_id : "product_image",
    products :
    {
    
         1: {"path":"/common/img/home_product/1.png", "link":"sure-original-solid.aspx"}   //"Sure Original Regular, Sure Original Fresh"
        ,2: {"path":"/common/img/home_product/2.png", "link":"sure-original-solid.aspx"}   //"Sure Original Unscented"
        ,3: {"path":"/common/img/home_product/3.png", "link":"sure-for-men.aspx"}          //"Sure for Men Mountain Frost, Sure for Men Outdoor Sport, Sure for Men Crisp Breeze"
        ,4: {"path":"/common/img/home_product/4.png", "link":"sure-invisible-solid.aspx"}  //"Sure Invisible Solid Regular, Sure Invisible Solid Fresh"
        ,5: {"path":"/common/img/home_product/5.png", "link":"sure-invisible-solid.aspx"}  //"Sure Invisible Solid Unscented"
        ,6: {"path":"/common/img/home_product/6.png", "link":"sure-aerosol.aspx"}          //"Sure Aerosol Regular, Sure Aerosol Fresh"
        ,7: {"path":"/common/img/home_product/7.png", "link":"sure-aerosol.aspx"}          //"Sure Aerosol Unscented"
        ,8: {"path":"/common/img/home_product/8.png", "link":"sure-original-solid.aspx"}   //"Sure Original Fresh, Sure Original Powder"
        ,9: {"path":"/common/img/home_product/9.png", "link":"sure-for-women.aspx"}        //"Sure for Women Citrus Breeze, Sure for Women Fresh Essence, Sure for Women Sparkling Bloom"
        ,10:{"path":"/common/img/home_product/10.png", "link":"sure-for-women.aspx"}       //"Sure for Women Unscented"
        ,11:{"path":"/common/img/home_product/11.png", "link":"sure-invisible-solid.aspx"} //"Sure Invisible Solid Fresh, Sure Invisible Solid Powder"
        ,12:{"path":"/common/img/home_product/12.png", "link":"sure-invisible-solid.aspx"} //"Sure Invisible Solid Unscented"
        ,13:{"path":"/common/img/home_product/13.png", "link":"sure-aerosol.aspx"}         //"Sure Aerosol Fresh"
    },
    
    product_choices :
    {
         "MSCLS" : 1
        ,"MSCLU" : 2
        ,"MSCNS" : 3
        ,"MSCNU" : 2
        ,"MICLS" : 4
        ,"MICLU" : 5
        ,"MICNS" : 3
        ,"MICNU" : 5
        ,"MACLS" : 6
        ,"MACLU" : 7
        ,"MACNS" : 6
        ,"MACNU" : 7
        ,"FSCLS" : 8
        ,"FSCLU" : 2
        ,"FSCNU" : 10
        ,"FSCNS" : 9
        ,"FICLS" : 11
        ,"FICLU" : 12
        ,"FICNS" : 9
        ,"FICNU" : 10
        ,"FACLS" : 13
        ,"FACLU" : 7
        ,"FACNS" : 13
        ,"FACNU" : 7
    },
    
    
    //METHODS
    Update_Product_Img : function(choice)
    {
        //get selected options
        if(choice == null || choice == undefined)
            choice = this.Get_Selected_Values();
        
        var product = this.products[this.product_choices[choice]];
        var image_path = product.path;
        var link = product.link;
        
        //update image info
        $("#product_image").attr("src",image_path);
        $("#product_image").ifixpng();
        $("#product_page_link").attr("href",link);
    },
    
    Get_Selected_Values : function()
    {
        var gender = $("#product_selector input[name=gender]:checked").val();
        var style = $("#product_selector input[name=ftype]:checked").val();
        var attitude = $("#product_selector input[name=attitude]:checked").val();
        var fragrance = $("#product_selector input[name=fragrance]:checked").val();
        return gender + style + attitude + fragrance;
    },
    
    Update_Product_Selectors : function(product_choice)
    {
        //product_choice example: "FICNS"
        if(product_choice == null || product_choice == undefined)
            return;
       
        //update all radio buttons to match
        var gender = product_choice.substr(0,1);
        var style = product_choice.substr(1,1);
        var attitude = product_choice.substr(2,2);
        var fragrance = product_choice.substr(4,1);
        
        $("#product_selector input[name=gender][value= "+ gender +"]").attr("checked", "checked");
        $("#product_selector input[name=ftype][value= "+ style +"]").attr("checked", "checked");
        $("#product_selector input[name=attitude][value= "+ attitude +"]").attr("checked", "checked");
        $("#product_selector input[name=fragrance][value= "+ fragrance +"]").attr("checked", "checked");
        
        //update product image
        this.Update_Product_Img(product_choice);
    },
    
    Break_Connection_With_Rotator : function()
    {
        intro_rotator.tied_to_selector=false;
    }
    
    
}
-->