﻿$(document).ready(function(){
    $(".tip_icons a").mouseover(function() {
        var bgImage = $(this).css("backgroundImage");
        var newbgImage = bgImage.replace("_out.","_over.");
        $(this).css("backgroundImage",newbgImage);
        
        var selectedTip = $(this).html();
        selectedTip = selectedTip.replace(" ","");
        
        var tipContent = "";
        var tipStarContent = "";
        
        switch(selectedTip)
        {
            case "Cookerhob":
                tipContent = "Ideally, your hob should be cleaned immediately after each use when spills are still fresh and a lot easier to remove. A quick wipe over with damp Plenty will keep it pristine."
			    break;
            case "Pans":
                tipContent = "Remove black tarnish on uncoated aluminium pans by boiling water with several slices of fresh lemon.  Pour water away and rub over the area with a sheet of Plenty.";
			    break;
            case "Spills":
                tipContent = "Plenty is so absorbent that it will soak up spills such as red wine, coffee and even baby food! Simply rinse and re-use the sheet as you go.";
			    break;
            case "Glasses":
                tipContent = "Wash glasses by hand in warm water and washing up liquid, then rinse in hot water containing a few drops of white vinegar for added shine.  Drain and pat dry with Plenty.";
			    break;
            case "CarpetScrubbing":
                tipContent = "To remove car or bicycle grease from your carpet, squirt a few drops of a water displacement spray on the affected area, wait about 30 seconds and then blot with a sheet of Plenty White, to soak up the stain. Work from the outside inwards and use a delicate, dabbing motion so you don't push the stain deeper. This will also work on a shoe polish stain.";
			    break;
            case "Toilet":
                tipContent = "Washing soda will clear limescale from around the inside of the toilet bowl: sprinkle in some crystals, leave to soak overnight, flush away and then wipe clean with Plenty*.";
                tipStarContent = "*Plenty recommends disposal with normal household waste.  Please do not flush down the toilet.";
			    break;
            case "Kitchen":
                tipContent = "To remove stains on a food processor bowl, rub with a sheet of Plenty moistened with vegetable oil, then wash in hot, soapy water.";
			    break;
            case "Bathroom":
                tipContent = "Ensure your mirrors are smear-free by cleaning them with a little white vinegar and buffing to a shine with Plenty*.";
                tipStarContent = "*Plenty recommends disposal with normal household waste.  Please do not flush down the toilet.";
			    break;
            case "Outdoors":
                tipContent = "Plenty is an ideal alternative to napkins to clean little ones' hands – or even your own!  Make sure you keep a roll handy in your car or child's buggy so that you are prepared for any occasion.";
                break;
            case "Pets":
                tipContent = "Keep dirty paws clean with Plenty – it's really strong, even when wet and muddy!";
                break;
        }
        
        $("#tip_header").html('<img src="images/toptips_' + selectedTip + '_text.gif" width="191" height="18" alt="' + selectedTip + '" title="' + selectedTip + '" />')
        $("#tip_text").html('<p>' + tipContent + '</p>');
        if (tipStarContent != "") {
            $("#tip_text p").append('<span>' + tipStarContent + '</span>');
        }
    });
    
    $(".tip_icons a").mouseout(function() {
        var bgImage = $(this).css("backgroundImage");
        var newbgImage = bgImage.replace("_over.","_out.");
        $(this).css("backgroundImage",newbgImage);
        $("#tip_header").html('');
        $("#tip_text").html('');
    });

});