/*!
 * Copyright (c) 2010 Liberty Concepts
 * http://www.libertyconcepts.com
 * All right reserved *
 * @version 1.1
 * @changelog
 *      v1.1
 *          + Added formLabels support
 *          + Flickr tool call was commented out
 *
 * @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) {
                this.ie();
                this.allBrowsers();
            }
            else {
                this.allBrowsers();
            }
        },
        ie : function(){
            $j('#header p a:first-child').css({
                'margin-right':'12px',
                'padding-right':'12px',
                'border-right':'1px solid #a5c3df'
            });
            $j('#nav li:last-child a').css({
                'border-right':'none'
            });
            $j('#tabNav li:first-child a').css({
                'padding-right':'15px',
                'border-right':'1px solid #c9d8eb'
            });
        },
        allBrowsers : function(){
            //fonts
            Cufon.replace('.signup label:first, .pgHead h1, .cFB span, #slideShow h2',{
                fontFamily: 'Gotham Bold'
            });
            Cufon.replace('.cFB span',{
                fontFamily: 'Gotham Bold',
                'color':'-linear-gradient(#3576bc,#235caa'
            });
            Cufon.replace('.social h3, .content h3',{
                fontFamily: 'Gotham Book'
            });
            Cufon.replace('.submit',{fontFamily: 'Gotham Medium'});
            Cufon.replace('.actions a, a.contribute',{
                fontFamily: 'Gotham Medium'
            });
            Cufon.replace('#nav>ul>li>a',{
                fontFamily: 'Gotham Medium',
                'color':'-linear-gradient(#3576bc,#235caa',
                textShadow: '0 1px rgba(255,255,255,0.6)'
            });
            Cufon.replace('.content h2',{
                fontFamily: 'Gotham Book',
                'color':'-linear-gradient(#3576bc,#235caa'
            });
            Cufon.CSS.ready(function() { 
               $j.fn.formLabels({labelParent:'form'})            
            })
            //home page tab widget
            $j('#tabs li').click(
                function () {
                    var $myId = $j(this).find('a').attr('href');
                    var $myTab = $j('#tabs').find('div#'+$myId);
                    $j(this).addClass('sel');
                    $j(this).siblings('li').removeClass('sel');
                    $j($myTab).parent('div').siblings('div').children('div.tab').hide();
                    $j($myTab).fadeIn();
                    return false;
                });
            //menus
            if ($j("ul.sf-menu").length) {
                $j("ul.sf-menu").supersubs({
                    minWidth:15,
                    maxWidth:30,
                    extraWidth:1
                }).superfish().find('ul').bgIframe({
                    opacity:false
                });
            }
            //UX
            $j("div.actions").fadingSiblings()
        }
    }
}

$j(function(){
    
     //optional: {excludeElts: 'elts to exclude'}
    engine.structure.init();
    plugins.pageTools.init("#contentHere");
    plugins.externalLinks();

    if ($j("#flickr").length) {
        plugins.flickrFeed({
type: "user",
        userId: "52761542@N07",        
            num: 6
            
        });
    }
	
});
