/*!
 * Copyright (c) 2010 Liberty Concepts
 * http://www.libertyconceots.com
 * All right reserved *
 * @version 1.0
 *
 * @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("ul.sf-menu>li:last-child>a").css({
                "border-right":"none"
            })
        },
        allBrowsers : function(){
           // $j("#menu").equalWidths();
            if ($j("ul.sf-menu").length) {
                $j("ul.sf-menu").supersubs({
                    minWidth:20,
                    maxWidth:30,
                    extraWidth:1
                }).superfish().find('ul').bgIframe({
                    opacity:false
                });
            }
            Cufon.replace("#header form span.stayInformed, div.newsColumn h2", {
                fontFamily:'Futura Hv BT'
            })
            Cufon.replace("#actionCenter ul li.contribute, #actionCenter ul li.vote-early, #actionCenter ul li.take-action, div.page-header h1, .slide-title", {
                fontFamily:'Futura Hv BT',
                textShadow: '0px -1px rgba(0,0,0,0.8)'
            });
            Cufon.replace("#actionCenter ul li.join-the-party", {
                fontFamily:'Futura Hv BT',
                textShadow: '0px -1px rgba(0,0,0,0.4)'
            });
            Cufon.replace("#actionCenter ul li.candidates, #actionCenter ul li.volunteer, #actionCenter ul li.recall, li.leaderTools", {
                fontFamily:'Futura Hv BT',
                textShadow: '0px 1px rgba(255,255,255,0.8)'
            })
            
             Cufon.replace("#actionCenter ul li.recall_volunteer, #actionCenter ul li.recall_faqs, #actionCenter ul li.recall_failures, #actionCenter ul li.recall_contribute", {
                fontFamily:'Futura Hv BT',
                textShadow: '0px 1px rgba(255,255,255,0.8)'
            })
            
            
            
            
            if ($j.browser.msie && $j.browser.version == 8) {
                
            }
            else {
                Cufon.replace("#menu>li", {
                    fontFamily:'Futura Md BT',
                    hover: {
                        textShadow: '0px -1px rgba(0,0,0,0.4)'
                    },
                    hoverables:{
                        li:true
                    }
                });
            }
            $j("#slides .slideshow").cycle({
                fx: 'fade',
                timeout: 8000,
                pager: "#pager",
                prev: "#prev",
                next: "#next",
                pause: 1,
                containerResize: 1,
                cleartypeNoBg:   true
            })
            $j("#footer .social").fadingSiblings()
        }
    }
}

$j(function(){
    $j.fn.formLabels({
        labelParent:'form'
    })
    engine.structure.init();
    plugins.pageTools.init(".body-content");
    plugins.externalLinks();
    plugins.blogComments();
});
