/*initial styles set for javascript enabled browsers*/
$(document).ready(function()
{
	$('div.hersbuttondiv').css({'height':'108px'});
	$('div.hisbuttondiv').css({'height':'110px'});
	$('div.leatherbuttondiv').css({'height':'102px'});
	$('div.hardbuttondiv').css({'height':'69px'});
	$('#firstclick').show();
	$('#info').css({'marginTop':'-450px'});
	$('#rhsimage').show();
	$('div.rhstopimage').hide();
	$('div.hovertext').hide();
}
);
/*button length changes, rhs image change, info extend*/
$(document).ready(function()
{
	$('#firstclick').click(function()
		{
		$('#firstclick').hide();
		$('div.buttondiv').animate({'height':'+=200'},1500,'swing');
		$('#rhsimage').fadeOut(1500);
		$('div.rhstopimage').fadeIn(1500);		
		$('#info').animate({'marginTop':'0px'},1500);
		return false;
		});
}
);
/*extended buttons hover jiggle*/
$(document).ready(function()
{
	$('div.buttondiv').hover(
		function()
		{
		var height = $(this).css('height');
		var newheight = parseInt(height.replace(/px/, "")) - 10;
		$(this).css('height', newheight +'px');
		var hoverText = '#' + $(this).attr('id') + 'hover';
		$(hoverText).show();
		},
		function()
		{
		var height = $(this).css('height');
		var newheight = parseInt(height.replace(/px/, "")) + 10;
		$(this).css('height', newheight +'px');
		var hoverText = '#' + $(this).attr('id') + 'hover';
		$(hoverText).hide();
		}
		);
}
);
/*reduced buttons hover jiggle*/
$(document).ready(function()
{
	$('div.hover').hover(
		function()
		{
		var top = $(this).css('top');
		var newtop = parseInt(top.replace(/px/, "")) - 10;
		$(this).css('top', newtop +'px');
		var hoverText = '#' + $(this).attr('id') + 'hover';
		$(hoverText).show();
		},
		function()
		{
		var top = $(this).css('top');
		var newtop = parseInt(top.replace(/px/, "")) + 10;
		$(this).css('top', newtop +'px');
		var hoverText = '#' + $(this).attr('id') + 'hover';
		$(hoverText).hide();
		}
		);
});
/*preloader*/
$(document).ready(function()
{
jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}
});
/*create your own material picker*/
$(document).ready(function()
{
	$('#nojavascript').hide();
}
);

$(document).ready(function()
{
	$('.materialthumbouter').click(function()
	{
		var thisAlt = $(this).attr('alt');
		$('#outerfabric').text(thisAlt);
		$('input[name=fulloutername]').val(thisAlt);
		var thisAlt = thisAlt.toLowerCase().replace(/ /g,'').replace(/&/g,'').replace(/'/g,'');
		$('#outermaterial').css({'backgroundImage':'url(images/blueprint/outer/'+thisAlt+'.png)'});
		$('input[name=outer]').val(thisAlt);
	});
}
);
$(document).ready(function()
{
	$('.materialthumbinner').click(function()
	{
		var thisAlt = $(this).attr('alt');
		$('#innerfabric').text(thisAlt);
		$('input[name=fullinnername]').val(thisAlt);
		var thisAlt = thisAlt.toLowerCase().replace(/ /g,'').replace(/&/g,'').replace(/'/g,'');
		$('#innermaterial').css({'backgroundImage':'url(images/blueprint/inner/'+thisAlt+'.png)'});
		$('input[name=inner]').val(thisAlt);
	});
}
);

