jQuery(document).ready(function() {

    if(jQuery('div.product_info_v1 div.product_details.tabs').html() != null) {
        jQuery('div.product_info_v1 div.product_details.tabs').accessibleTabs({
            tabhead: 'h2',
            tabbody: '.tabcontent',
            wrapperClass: 'tcontent'
        });
    }

    jQuery('input.srstec-button, img.srstec-button').each(function() {
        jQuery(this).hover(function() {
            var src = jQuery(this).attr('src');
            newSrc = jQuery.fn.srsHoverButton.getHoverSrc(src);
            jQuery(this).attr('src',newSrc);
        }, function() {
            var src = jQuery(this).attr('src');
            newSrc = jQuery.fn.srsHoverButton.getOrigSrc(src);
            jQuery(this).attr('src',newSrc);
        })
    })
    
    $('input.defaultval').each(function() {
      $(this).focusin(function() {
        if($(this).val() == $(this).attr('rel')) {
          $(this).val('');
        }
      }).focusout(function() {
        if($(this).val() == '') {
          $(this).val($(this).attr('rel'));
        }
      });
    });



});

jQuery.fn.srsHoverButton = function() {

}

jQuery.fn.srsHoverButton.getHoverSrc  = function(src) {
    var regex = /.?([a-zA-Z]+)$/;
    var new_src = src.replace(regex, '_hover.');
    new_src += RegExp.$1;
    return new_src;
}

jQuery.fn.srsHoverButton.getOrigSrc  = function(src) {
    var regex = /_hover/;
    return src.replace(regex, '');
}
