// JavaScript Document
   
   
$(function(){
$(".block").hide();	
$("#aboutSub").hide();
$("#productSub").hide();
//$("#sideshoppingcart").hide();


/*************  ALL THE FADING DIVS*********************/
$('.indexFlash').innerfade({
					speed: 3000,
					timeout: 6000,
					type: 'sequence',
					containerheight: '276px'
});


// SMALL BEDS UP TOP //

$('.bed1').innerfade({
					speed: 3000,
					timeout: 6000,
					type: 'sequence',
					containerheight: '75px'
});

$('.bed2').innerfade({
					speed: 3000,
					timeout: 6000,
					type: 'sequence',
					containerheight: '75px'
});

$('.bed3').innerfade({
					speed: 3000,
					timeout: 6000,
					type: 'sequence',
					containerheight: '75px'
});
/**********************************************************/

$('#pic2').innerfade({
					speed: 3000,
					timeout: 6000,
					type: 'sequence',
					containerheight: '259px'
});

$('#pic1').innerfade({
					speed: 3000,
					timeout: 6000,
					type: 'sequence',
					containerheight: '259px'
});	

			  });
			  
  function openReturn(cat){
	 $(".block").hide(0);
	$("#"+cat).slideDown(200);
	
  }
  
  function openPrivacy(cat){
	$(".block").hide(0);
	$("#"+cat).slideDown(200);
  }

  
  function additionalImages(s, i){
	var image = document.getElementById('product_image_' + i);
	image.src= s;

	  
  }
 
 
 function openNav(x){
	 if(x == "aboutSub"){
		$("#productSub").slideUp('fast');
	 	$("#aboutSub").slideDown('fast');
	 } else{
		$("#productSub").slideDown('fast');
	 	$("#aboutSub").slideUp('fast');
	 }
		 
 }
 
 
var icpForm2050 = document.getElementById('icpsignup2050');

if (document.location.protocol === "https:")

	icpForm2050.action = "https://app.icontact.com/icp/signup.php";
function verifyRequired2050() {
  if (icpForm2050["fields_email"].value == "") {
    icpForm2050["fields_email"].focus();
    alert("The Email field is required.");
    return false;
  }
  if (icpForm2050["fields_fname"].value == "") {
    icpForm2050["fields_fname"].focus();
    alert("The First Name field is required.");
    return false;
  }
  if (icpForm2050["fields_lname"].value == "") {
    icpForm2050["fields_lname"].focus();
    alert("The Last Name field is required.");
    return false;
  }


return true;
}



function newsroomPhotos(s){
	var image = document.getElementById('news_main');
	image.src= s;	
}

function getCart(){
	$("#sideshoppingcart").animate( {width : "show" } );
}

function hideCart(){
	$("#sideshoppingcart").animate( {width : "hide" } );
}


function shippingChecked(){	
  var frm = document.shipMeth.length;
    if(frm == 0){alert("You must calculate shipping costs for this order.  Please use the shipping calculator at the top of the screen.  If the shipping costs do not calculate for your region, please call us to place your order at +1 (415) 939-NEKO (6356) or email us at custservice@nekohabitat.com");
	return false;
	}
	var t = document.shipMeth.shipping_method.length;	
	for(i=0; i< t; i++){
		if(document.shipMeth.shipping_method[i].checked){
			return true;
		} else{
			alert("You Must Enter a shipping option in order to proceed");
			return false;
		}
	}
}