$(document).ready(function(){
	$(".input").focus(function(){
		// Select input field contents
		$(this).css('border','1px solid #0b6d96');
	}),
	$(".input").blur(function(){
		// Select input field contents
		$(this).css('border','1px solid #ccc');
	});
});

$(function() {	

	// Check to see if enter key(13) is hit within the login form, and trigger login button
	$('#form1').keypress(function(event){
		var keycode = (event.keyCode ? event.keyCode : event.which);
		if(keycode == '13'){
			document.getElementById('login_button').click();	
		}
	});

	$("#sign_in_toggle").click(function(e) { // when sign in is clicked, show/hide the login box
		$("#login_box").toggle();	
		$(this).blur(); 
		return false;
	});
		
	$("body").click(function(e) { // fires when they click anywhere on the page
			// when the document is clicked on, hide the login box
			// is the login box visible? then hide it
		if ($("#login_box").is(":visible")) {
			var mouse_x = e.pageX;
			var mouse_y = e.pageY;
				if (mouse_x > 0) { // mouse_x is 0 when the slider slides, so don't hide the box then
					// get position and width of login box					
					var login_position = $("#login_box_wrap").offset();
					var login_x = login_position.left;
					var login_y = login_position.top;
					var login_w = $("#login_box_wrap").width();
					var login_h = $("#login_box_wrap").height();
					// did they click inside the login box?
					if (mouse_x >= login_x && mouse_x <= login_x + login_w &&
						mouse_y >= login_y && mouse_y <= login_y + login_h
						) {
						// they clicked inside the login box. Do not hide the login box
						;
					} else {
						// they clciekd outside the logix box. Hide the login box.
						$("#login_box").hide();							 
					}
				}
			}
	});
});

Cufon.replace('.cufon_shadow', {
	textShadow: '#861545 0px -1px'
});
Cufon.replace('.cufon_blue_shadow', {
	textShadow: '#0f597e 0px -1px'
});
Cufon.replace('.cufon_white_shadow', {
	textShadow: '#fff 0px -1px'
});

$(document).ready( 
	function(){ $('#news').innerfade({ 
		animationtype: 'slide', 
    	speed: 950, 
    	timeout: 5000, 
    	//type: 'random', 
    	type: 'sequence', 
    	containerheight: '1em' }
	);
}); 

$(document).ready(function(){	
	$("#tourslider").easySlider();
	$("a").focus(function() {  $(this).blur(); });
});

$(document).ready(function(){
	$('.highlight').bt({
		padding: 15,
		spikeLength: 15,
		spikeGirth: 15,
		cornerRadius: 7,
		width: 300,
		fill: 'rgba(22, 22, 22, .9)',
		strokeWidth: 1,
		strokeStyle: '#eee',
		shadow: true,
		positions: 'right, top',
		shadowColor: 'rgba(0,0,0,.4)',
		shadowBlur: 16,
		shadowOffsetX: 4,
		shadowOffsetY: 2,
		cssStyles: {color: '#fff', fontWeight: 'normal', fontSize: '1em'},
		contentSelector: "$(this).attr('title')"				
	});
});

$(document).ready(function(){
   	$(".activate").colorbox({opacity:0.7});
});

$(function() {
	var maxheight=0;
	$(".equalcolumn2").each(function() {
		var h= $(this).height();
		if (h > maxheight) maxheight = h;
	});
		
	maxheight += 30;
		
	// 2) go and set position of buttons
	$("#prevBtn").css('top', maxheight + 'px');
	$("#nextBtn").css('top', maxheight + 'px');
});


		$(document).ready(function() {	
		 
			//Show Banner
			$(".imagerotate .desc").show(); //Show Banner
			$(".imagerotate .block").animate({ opacity: 0.80 }, 1 ); //Set Opacity
		 
			//Click and Hover events for thumbnail list
			$(".imagecontrols ul li:first").addClass('active'); 
			$(".imagecontrols ul li").click(function(){ 
				//Set Variables
				var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
				var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
				var imgDesc = $(this).find('.block').html(); 	//Get HTML of block
				var imgDescHeight = $(".imagerotate").find('.block').height();	//Calculate height of block	
				
				if ($(this).is(".active")) {  //If it's already active, then...
					return false; // Don't click through
				} else {
					//Animate the Teaser				
					$(".imagerotate .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
						$(".imagerotate .block").html(imgDesc).animate({ opacity: 0.85,	marginBottom: "0" }, 250 );
						$(".imagerotate img").attr({ src: imgTitle , alt: imgAlt});
					});
				}
				
				$(".imagecontrols ul li").removeClass('active'); //Remove class of 'active' on all lists
				$(this).addClass('active');  //add class of 'active' on this list only
				return false;
				
			}) .hover(function(){
				$(this).addClass('hover');
				}, function() {
				$(this).removeClass('hover');
			});
					
			//Toggle Teaser
			$("a.collapse").click(function(){
				$(".imagerotate .block").slideToggle();
				$("a.collapse").toggleClass("show");
			});
			
		});//Close Function
		
		<!-- PRODUCT TABS -->

			$(document).ready(function() {
			
				//When page loads...
				$(".tab_content").hide(); //Hide all content
				$("ul.tabs li:first").addClass("active").show(); //Activate first tab
				$(".tab_content:first").show(); //Show first tab content
			
				//On Click Event
				$("ul.tabs li").click(function() {
			
					$("ul.tabs li").removeClass("active"); //Remove any "active" class
					$(this).addClass("active"); //Add "active" class to selected tab
					$(".tab_content").hide(); //Hide all tab content
			
					var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
					$(activeTab).fadeIn(); //Fade in the active ID content
					return false;
				});
			
			});




