// Image gallery tabs

		$(function () {
			var tabContainers = $('div.images > div');
			tabContainers.hide().filter(':first').show();
			
			$('div.tabs ul.tabNavigation a').click(function () {
				tabContainers.hide();
				tabContainers.filter(this.hash).show();
				$('div.tabs ul.tabNavigation a').removeClass('selected');
				$(this).addClass('selected');
				return false;
			}).filter(':first').click();
		});



// For the Suckerfish menu

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

// jQuery(document).ready(function($){
//    $('form#contactForm').submit(function(e){
//		$('input#contactSubmit').attr('disabled', 'disabled').val('Sending...');
//        return false;
//    });
// });

$(document).ready(function() { 
    var options = { 
    target:        '#alert'
    }; 
    $('#contactForm').ajaxForm(options); 
    
    
	 $(".form-button").click(function() {
	 	var parts = $(this).attr("id").split("-");
	 	var id = parts[3];
	 	location.href = $("#link-" + id).val();
	});
    }); 
    
    $.fn.clearForm = function() {
      return this.each(function() {
        var type = this.type, tag = this.tagName.toLowerCase();
        if (tag == 'form')
          return $(':input',this).clearForm();
        if (type == 'text' || type == 'password' || tag == 'textarea')
          this.value = '';
        else if (type == 'checkbox' || type == 'radio')
          this.checked = false;
        else if (tag == 'select')
          this.selectedIndex = -1;
      });
    };
	
	$(function() {
		$('.store .item a.lbimage').lightBox();

	});