//jQuery
$(document).ready(function(){
						   
						   
$('.top_nav').hover(function(){
	var temp=$(this).attr('src')
	temp=temp.replace('.gif', '_over.gif');
	$(this).attr('src', temp);
	}, 
	function() {
	var temp=$(this).attr('src')
	temp=temp.replace('_over.gif', '.gif');
	$(this).attr('src', temp);
	});						   
						   

$(".product_title").click(function(){
//$(".faq_a:eq(" + vindex + ")").slideToggle();
var vindex=$(".product_title").index(this);
if ($(".product_item:eq(" + vindex + ")").is(":visible")) {
	$(".product_item:eq(" + vindex + ")").slideUp();
//$(this).css({'color': '#000000'});	
} else {
$(".product_item:eq(" + vindex + ")").slideDown();	
//$(this).css({'color': '#007cb7'});	
}
});

$(".cat_title").click(function(){
//$(".faq_a:eq(" + vindex + ")").slideToggle();
var vindex=$(".cat_title").index(this);
if ($(".cat_item:eq(" + vindex + ")").is(":visible")) {
	$(".cat_item:eq(" + vindex + ")").slideUp();
//$(this).css({'color': '#000000'});	
} else {
$(".cat_item:eq(" + vindex + ")").slideDown();	
//$(this).css({'color': '#007cb7'});	
}
});

$(".tech_info").click(function(){
//$(".faq_a:eq(" + vindex + ")").slideToggle();
var vindex=$(".tech_info").index(this);
if ($(".tech_item:eq(" + vindex + ")").is(":visible")) {
	$(".tech_item:eq(" + vindex + ")").slideUp();
$(".tech_info_toggle:eq(" + vindex + ")").text("[+]");
//$(this).css({'color': '#000000'});	
} else {
$(".tech_item:eq(" + vindex + ")").slideDown();	
//$(this).css({'color': '#007cb7'});	
$(".tech_info_toggle:eq(" + vindex + ")").text("[-]");
}
});


//$("a[rel='gallery-photos']").click(function() {
//							  alert("what?");
//$("a[rel='gallery-photos']").colorbox();
//$(".inset-photo").colorbox();
// });

$(".photo_thumb_link").fancybox({
		'hideOnContentClick': true,
		'titlePosition'	: 'inside',
		'overlayColor' : '#000'
});
						   
$('.photo_thumbs_container').hover(function(){
 roll_index=$('.photo_thumbs_container').index(this);
//animate can only manipulate css with numeric values.
//$(this).animate( { opacity: .5 }, 'slow');
 $(this).css('border', '1px solid #000000');
}, function(){
//$(this).animate( { opacity: 1 }, 'slow');	
	$(this).css('border', '1px solid transparent');
});


					   
	$('.sub_nav').hover(function(){
	var temp=$(this).attr('src')
	temp=temp.replace('.gif', '-over.gif');
	$(this).attr('src', temp);
	}, 
	function() {
	var temp=$(this).attr('src')
	temp=temp.replace('-over.gif', '.gif');
	$(this).attr('src', temp);
	});
	
	
	
var tab_on=0;	
$('.item_tab').click(function() {
var index=$('.item_tab').index(this);
tab_on=index;
for (var i=0; i<$('.item_tab').length ;i++) {
var t=$('.item_tab:eq(' + i + ')').attr('src');
if (i==index) {
t=t.replace('_down.gif', '_up.gif');
$('.item_tab:eq(' + i + ')').attr('src', t);
$('.tab_container:eq(' + i + ')').fadeIn(300);
} else {
t=t.replace('_up.gif', '_down.gif');
$('.item_tab:eq(' + i + ')').attr('src', t);
$('.tab_container:eq(' + i + ')').hide();
}
}
return false;
});

var tab_org;
$('.item_tab').hover(function(){
var temp=$(this).attr('src');
tab_org=temp;
temp=temp.replace('_down.gif', '_up.gif');
$(this).attr('src', temp);
}, 
function() {
if ($('.item_tab').index(this)!=tab_on) {
$(this).attr('src', tab_org);		
}

});
/* */


$("input#footer_zip").focus(function() {
	$(this).attr("value", "");									 
 });

$("input#contact_email").focus(function(){
	$(this).attr("value", "");
});

$("#signup_submit").click(function(event){
var email=$("input#contact_email").val();
if (email!="") {
var dataString = 'contact_email=' + email; // + '&phone=' + phone;   
//alert (dataString);return false;   


$.ajax({   
  type: "POST",   
  url: "/contact/contact_newsletter.aspx",   
  data: dataString,  
  success: function(xml) { 
	$(xml).find('message').each(function(){
	var msg = $(this).attr('id');
	if (msg=='failed') {
	$("input#contact_email").val("Error. Please try again");
	}else{
	$("input#contact_email").val("Thank You!");	
	//$('#signup_form').html("<div id='message'><p>Thank You!</p></div>");
	}
	});
  
  }   
});
}
return false;
});  


		
}); // end ready

