$(document).ready(function() {

// path plug in for main nav
$('ul li a:path').addClass('on');

// project page
if( $('.projItem').length > 0 ) {

// init page
$('div.item').hide();
$('div.item:first').show();
$('div.projItem:first a').addClass('on');

// nav click
$('div.projItem a').click(function() {
$('div.projItem a').removeClass('on');
$(this).parent().find('a').addClass('on');


$('div.item').hide();
var thisTarget = $(this).attr('href');
$(thisTarget).fadeIn('slow');

return false;
});

}
// END project page

// videos page
if( $('#video').length > 0 ) {
// on load set first button

$('div.videoDesc:first a').after('<span class="playing">*Playing</span>');

// reset buttons and change one clicked on
$('div.videoDesc a').click(function() {

$('span').remove();
$(this).after('<span class="playing">*Playing</span>');

return false;
});

}
// END video page

/* ---- 
email from validation 
if we're on the contact page? 
---- */

if ( $('#form1').length > 0 ) {
$('#form1').validate({ 
rules: { 
name: 'required', email: 'required email' // jquery validation plug in 
},
messages: { 
name: ' &nbsp;You do have a name, no?',
email: ' &nbsp;Try a valid address?'
}
});
}
// END contact form


});
// END dom ready

