jQuery.noConflict();

Cufon.replace('#navigation a, #action-box dt a, #action-box dd, #content h1, #home h2, #sidebar-wrap h2', {hover: true}, {fontFamily: 'Meta'});


function form_input_classes(){

    jQuery('input[type="text"]').addClass('text');
    jQuery('input[type="email"]').addClass('text');
    jQuery('input[type="tel"]').addClass('text');
    jQuery('input[type="password"]').addClass('text');
    jQuery('input[type="checkbox"]').addClass('checkbox');
    jQuery('input[type="radio"]').addClass('radiobutton');
    jQuery('input[type="submit"]').addClass('submit');
    jQuery('input[type="image"]').addClass('buttonImage');

}

function superfish(){
    jQuery('ul.sf-menu').superfish({ 
        delay:       500,                            // delay on mouseout 
        dropShadows: false                            // disable drop shadows 
    });
}

function cycle_lite(){
    jQuery('#rotator').cycle({ 
      timeout: 10000,
      pager: '#pager-nums'
});
}

function assign_fitted(){
  jQuery('.clickable').fitted();
}

function form_labelize(){  jQuery(".labelize input:text").clearingInput(); }   

function lightbox (){
    var modal = jQuery.cookie('mw');
    //get the page url
    var locationHref = document.location.href;
    var bsdFrameworkUrlStructure = /\/page\//;
 
    //conditional for the modal window
    if(modal != 'visited') {

        jQuery.cookie('mw', 'visited', { expires: 30, domain: 'liveunited.org' });
        jQuery("#lightbox").show();
        jQuery.fn.colorbox({inline:true, href:"#lightbox", open:true, transition:"none", opacity: .75}); 
        jQuery(".cb-close").click(function () { 
            jQuery.fn.colorbox.close(); return false;
        });
        jQuery().bind('cbox_cleanup', function(){
            jQuery("#lightbox").hide();
        });
    }
}

 
function validation() {
	jQuery("#uww-local").validate();
	jQuery("#cse-search-box").validate();
}


function ext_link() {
    jQuery('a:not([@href*=liveunited.org/])').not('[href^=#]').click(function(){
        jQuery(this).attr('target','_blank').addClass("external");
    });
    //Read more: http://wpcult.com/open-external-links-in-a-new-window/#ixzz0vSSECpkw
}

jQuery(document).ready(function() {
    form_labelize();
    form_input_classes();
    assign_fitted();
    superfish();
    cycle_lite();
    validation();
//    ext_link();
});
