$(document).ready(function(){

// home page slide show index.php
$('#homeslide').cycle({
fx:    'fade',
speed:  4000
});

// home.php slideshow
$('#slideshow').cycle({
fx:    'fade',
speed:  4000
});


//highlight the current page
var path = location.pathname;
path = path.substring(path.lastIndexOf('/') + 1);
if(path=='index.php' || path==''){
   path='index.php';
}
else{
  path='home.php';
}
 $('.clickable a[href$="' + path + '"]').parent().css('background-image', 'url(img/button_bg_ov.png');

//highlight the current page
path = location.pathname;
path = path.substring(path.lastIndexOf('/') + 1);
if( path ) {
   $('.side_menu a[href$="' + path + '"]').parent().css('background-color','white');
   //$('.side_menu a[href$="' + path + '"]').parent().attr('class', 'selected');
}



$('li.clickable').css('cursor', 'pointer')
// iterate through all <li> elements with CSS class = "clickable"
// and bind onclick event to each of them
.click(function() {
    // when user clicks this <li> element, redirect it to the page
    // to where the fist child <a> element points
    window.location = $('a', this).attr('href');
});


//and <strong> to first word in h1 tag so it can by styled differntly
/*
$('h1').each(function(){
    var me = $(this);
    me.html( me.text().replace(/(^\w+)/,'<strong>$1</strong>') );
});
*/
});



