	/*!
 * Copyright (c) 2010 Liberty Concepts
 * http://www.libertyconcepts.com
 * All right reserved *
 * @version 1.5
 * @description Put all jQuery code into engine.structure.allBrowsers
 * engine.structure.ie is reserved only for IE lte 8.0 browsers
 */

var engine = {
    structure: {
        init : function(){
            if (!jQuery.support.opacity) { //Change this to jQuery.browser.msie when IE9 will be released.
                this.ie();
                this.allBrowsers();
            }
            
            else {
                this.allBrowsers();
            }
        },
        ie : function(){
        //HERE GOES jQUERY FOR IE BROWSERS ONLY!
        },
        allBrowsers : function(){
			
    	// HOMEPAGE SLIDESHOW
		$j("#home-slideshow").cycle({
				fx: 'scrollHorz',
				timeout: 0,
				cleartypeNoBg: true,
				speed: 500,
				updateActivePagerLink: null,
				requeueOnImageNotLoaded: true,
				pager: '.video-nav',
                		pagerAnchorBuilder: function(idx, slide) {
					return '<li class="video-select"><a href="#"><img src="images/spacer.gif" width="100%" height="100%"/></a></li>';
				}		
		});
			
		$j("#home-video-menu").multipleElementsCycle({
				Elementcontainer: '.video-menu',
				nextElement: '.next',
				prevElement: '.prev',
				overrideStart: 0,
				element: 'li.video-item',
				count: 4,
				showCount: 7,
				speed: 500
			});
		
		
			$j('a.next, a.prev').hover(function(){
				$j(this).addClass('hover');
				}, function() {
					$j(this).removeClass('hover');
			});
		
			
            if ($j("ul.sf-menu").length) {
                $j("ul.sf-menu").supersubs({
                    minWidth:15, //minimum width (in em units) of sub-menus
                    maxWidth:20, //maximum width (in em units) of sub-menus
                    extraWidth:1 //extra width can ensure lines don't sometimes turn over due to slight rounding differences and font-family
                }).superfish({delay:0}).find('ul').bgIframe({
                    opacity:false
                });			
            } 
        }
    }
}

$j(function(){
    $j.fn.formLabels() //optional: {excludeElts: 'elts to exclude'} see the source for more options
    engine.structure.init();
    plugins.pageTools.init("#contentHere"); //change #contentHere for the selector of block with the main page content
    plugins.externalLinks(); //When specified, browser will open external links in new tab (or window)
    plugins.flickrFeed({
            cont: "#flickr",
            type: "",                    //anything other than 'set' will be treated as userID.
            set: "",       //put set number if type: "set", otherwise property will be ignored.
            userId : "61893621@N04",                    //leave blank when working with type: "set", otherwise put userID http://idgettr.com/
            num: 5,                         //how many photos to show on a page.
            limit: 25                      //how many photos to retrive from Flickr.
    });

	
	//misc styles
	$j('ul.actions li:odd').css('border-right', '0');
	$j('ul.actions li:eq(0), ul.actions li:eq(1)').css('min-height', '144px');
	$j('ul.actions li:eq(3) p').css('margin-top', '20px');
	$j('ul.actions li:eq(4), ul.actions li:eq(5)').css('border-bottom', '0');
	
})


