
 $(document).ready(function(){
	 
	  $(".demo").fancybox({
		'width'				: 599,
		'height'			: 540,
		'autoScale'			: false,
		'type'				: 'iframe',
		'scrolling'			: 'no',
		'overlayColor'		: '#c09240',
		'overlayOpacity'	: '0.5'
	});
	  
		
	var url = $.url().attr('file'); // for determining the current page we're viewing
	initMenu();
	if ($("#longNews").length != 0) { //check if there exists an id of 'longNews' for custom scrollbar
		$("#longNews").mCustomScrollbar("vertical",200,"easeOutCirc",1.02,"auto","yes","no",0); // for custom scrollbars
	}
	
	/*if ($.browser.msie && $.browser.version=="6.0") { // only allow a hover class for ie6
		$("#nav ul li").hover( function() {
			$(this).toggleClass('hover');
		},function(){
			$(this).toggleClass('hover');
		});	
	}*/
	//$('#nav ul li').hover(function() {
	//	$(this).next('ul').show();
	//});
	$(function(){ // Scrollable list for news items.
      $("#myScroll").mbScrollable({
        width:350,
        elementsInPage:3,
        elementMargin:4,
		dir:"vertical",
      	//shadow:"#999 2px 2px 2px",
        height: 260,
        controls:"#controls",
        slideTimer:600,
        autoscroll:false,
        scrollTimer:2000 
      });
    });
	
	if (url.toLowerCase() == 'communities.html') {
		//var onMouseOutOpacity = 0.67;
		//$('#thumbs ul.thumbs li').opacityrollover({
		//			mouseOutOpacity:   onMouseOutOpacity,
		//			mouseOverOpacity:  1.0,
		//			fadeSpeed:         'fast',
		//			exemptionSelector: '.selected'
		//		});
	    var gallery = $('#thumbs').galleriffic({ // Home Page at: http://www.twospy.com/galleriffic/index.html
													// Updates/comments at: http://code.google.com/p/galleriffic/updates/list
        delay:                     5000, // in milliseconds
        //numThumbs:                 5, // The number of thumbnails to show page
        //preloadAhead:              8, // Set to -1 to preload all images
        //enableTopPager:            false,
        //enableBottomPager:         false,
		//controlsContainerSel:   	'#controls',
        imageContainerSel:         '#slideshow', // The CSS selector for the element within which the main slideshow image should be rendered
        //captionContainerSel:       '', // The CSS selector for the element within which the captions should be rendered
        //renderSSControls:          false, // Specifies whether the slideshow's Play and Pause links should be rendered
        //renderNavControls:         false, // Specifies whether the slideshow's Next and Previous links should be rendered
        //prevLinkText:              '',
        //nextLinkText:              '',
        //nextPageLinkText:          'Next &rsaquo;',
        //prevPageLinkText:          '&lsaquo; Prev',
        //autoStart:                 false, // Specifies whether the slideshow should be playing or paused when the page first loads
        //syncTransitions:           true, // Specifies whether the out and in transitions occur simultaneously or distinctly
        defaultTransitionDuration: 1000 // If using the default transitions, specifies the duration of the transitions
        //onSlideChange: function(prevIndex, nextIndex) {
		//	this.find('ul.thumbs').children()
		//		.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
		//		.eq(nextIndex).fadeTo('fast', 1.0);
		//}

    });
	}
	
	
});
