$(document).ready(function(){


function onAfter(curr, next, opts) {
    var caption = $(next).find('.image').text();
    $('#caption').html(caption);
}


	Cufon.replace('header nav ul li, footer nav ul li, footer .websiteby, .content article  h2.intro, .content article h2.intro2 , .top .contacts h2.hours,.top .contacts h2.italics, .desc h1, ul.subnav li a, .help h3, .desc .text a.rental, article .top .details .hours, article .top .details .call ',{hover:true, fontFamily:'HelveticaNeueLTStdCn'});
	Cufon.replace('aside ul li h3, .content article h1.intro, .content article h4.intro, .losenge h3, #showcase .image a, .request a.download, .request2 a.download ,.trainingform h3',{hover:true, fontFamily:'EurostileLTStdBoldEx2'});
	
	Cufon.replace('h2.title, .text.extend h3',{hover:true, fontFamily:'Eurostile'});
	
	$('aside ul li').hover(function(){
		$(this).addClass('active');
		Cufon.replace('aside ul li h3',{hover:true, fontFamily:'EurostileLTStdBoldEx2'});
	},function(){
		$(this).removeClass('active');
		Cufon.replace('aside ul li h3',{hover:true, fontFamily:'EurostileLTStdBoldEx2'});
		
	});
	
	$('#showcase').cycle({ 
    fx:     'fade', 	
    timeout: 2000, 
    after:   onAfter 
});


$('#slider').before('<ul id="nav">').cycle({ 
    fx:     'fade', 
    timeout: 2000, 
    pager:  '#nav', 
     
    // callback fn that creates a thumbnail to use as pager anchor 
    pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"><img src="' + slide.src + '" width="80" height="112" /></a></li>'; 
    } 
});

	$('table.specs tr:odd').addClass('odd');
	
	
	var clearFocus ='';

// clear input on focus
$('.clearFocus input').focus(function()
{
if($(this).val()==$(this).attr('title'))
{
clearFocus = $(this).val();
$(this).val('');
}
});

// if field is empty afterward, add text again
$('.clearFocus input').blur(function()
{
if($(this).val()='')
{
$(this).val(clearFocus);
}
});
	

});
