$(document).ready(function(){

    $('#m_slideshow').cycle({
        fx:     'fade',
        speed:   2000,
        timeout: 6000,
        pager:  '#ssnav',
        pagerAnchorBuilder: function(idx, slide) {
        return '#ssnav li:eq(' + (idx) + ') a';
        }
   });

   $('#ssnav').append("<li><a id='pbtn' class='pause'>&nbsp;</a></li>");
	var bplplay = true;
	$('#pbtn').click(function() {
			
	if (bplplay) {
	   $('#m_slideshow').cycle('pause');
	   $('#pbtn').removeClass('pause').addClass('play')
	   bplplay = false;
	} else {
	   $('#m_slideshow').cycle('resume');
	   $('#pbtn').removeClass('play').addClass('pause')
	   bplplay = true;
	}
    });

$('#searchwrapper input[name=search_this]')
      .val('Search...')
      .click(function() {
        if ($(this).val() == 'Search...')
          $(this).val('')
      }).blur(function() {
        if ($(this).val() == '')
          $(this).val('Search...')
      });

$('.navbar li').hover(
	function () {
        $('ul', this).show();
        }, 
	function () {
	$('ul', this).hide();			
	}
    );


    $("h1").each(function() { 
        if($(this).children().length==0) { 
            $(this).text($(this).text().replace('-', ' & ')); 
        } 
    });

});

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
