$(document).ready(function() {

	$('.slidetabs').tabs('.slideshow > .myshow', {
		effect: 'fade',
		fadeOutSpeed: 'slow',
		rotate: true
	}).slideshow({autoplay: true,interval:5000,clickable:false});

	var path = location.pathname.substring(1);
	newpath = path.split("/", 1)
	if (newpath == '') { //check for homepage
		$('#smoothmenu1 a[href$="/"]').addClass('selected');
	} else {
		$('#smoothmenu1 a[href$="' + newpath + '"]').addClass('selected');
	}

	// Bookmark site
	if(window.opera) {
		if ($("a.bookmark").attr("rel") != ""){
			$("a.bookmark").attr("rel","sidebar");
		} 
	}

	$("a.bookmark").click(function(event){
		event.preventDefault();
		var url = this.href;
		var title = this.title;

		if (window.sidebar) { 
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { 
			window.external.AddFavorite( url, title);
		} else if(window.opera) { 
			return false; 
		} else { 
			 alert('Sorry, your browser does not support the requested action,'
			 + ' please add this page manually to your bookmarks.');
		}
	});

	$('.lightbox').lightBox({fixedNavigation:true,containerBorderSize:70});

	ddsmoothmenu.init({
		mainmenuid: "smoothmenu1", 
		orientation: 'h', 
		classname: 'ddsmoothmenu', 
		contentsource: "markup" 
	});

});

