﻿$(document).ready(function() {
    $('#hidePrompt').click(function(e) {
        $('#cartPrompt').hide();
        e.preventDefault();
    });

    $('input.btn-add').hide();

    $('.checkout-box input[type=text]').focus(function() {
        $(this).addClass('focus');
    }).blur(function() {
        $(this).removeClass('focus');
    });

//    $('div.product-slide-pod div.innertube').css('border-color', '#ffffff');
//    $('div.product-pod div.innertube').css('border-color', '#ffffff');

    $('.search-box input').focus(function() {
        if ($(this).val() == 'Search site...')
            $(this).val('');
    });

//    $('div.product').hover(function() {
//        $(this).find('input.btn-add').show();
//    }, function() {
//        $(this).find('input.btn-add').hide();
//    });

//    $('div.product-slide-pod div.innertube').hover(function() {
//        $(this).css('border-color', '#f1f1f1');
//    }, function() {
//        $(this).css('border-color', '#ffffff');
//    });


//    $('div.product-pod div.innertube').hover(function() {
//        $(this).css('border-color', '#f1f1f1');
//    }, function() {
//        $(this).css('border-color', '#ffffff');
//    });

    $('div.footer-helpline').hover(function() {
        $(this).addClass('footer-helpline-on');
    }, function() {
        $(this).removeClass('footer-helpline-on');
    });

    $('a.helpline').hover(function() {
        $(this).addClass('helpline-on');
    }, function() {
        $(this).removeClass('helpline-on');
    });

    $('div.image').hover(function() {
        $(this).find('span.enlarge').show();
    }, function() {
        $(this).find('span.enlarge').hide();
    });
});

function SetUniqueRadioButton(nameregex, current)
{
   re = new RegExp(nameregex);
   for(i = 0; i < document.forms[0].elements.length; i++)
   {
      elm = document.forms[0].elements[i]
      if (elm.type == 'radio')
      {
         if (re.test(elm.name))
         {
            elm.checked = false;
         }
      }
   }
   current.checked = true;
}
