try{Typekit.load();}catch(e){}

var addthis_config = { ui_cobrand: "DNA Sports", ui_header_color: "#ffffff", ui_header_background: "#ac141a" }

$.noConflict();
jQuery(document).ready(function($){

    // External Links
    $('a[rel*=external]').click(function(){
        window.open(this.href);
        return false;
    });

    // Front Page Slider
    $('#front-slider .slides').cycle({
        timeout: 10000,
        pause: 1,
        pager: '#front-controls',
        pagerAnchorBuilder: function(idx, slide) {
            return '<li><a href="#"><span class="lnk">' + slide.title + '</span></a></li>';
        },
        activePagerClass: 'active'
    });

    // Modal Window
    $('a.modal').click(function(e){

        e.preventDefault();

        var w = $(window).width();
        var h = $(window).height();
        var dh = $(document).height();

        $('#overlay').css({'width':w,'height':dh});
        $('#overlay').fadeTo('fast',0.6);

        id = $(this).attr('href');

        $(id).css('left',w/2-$(id).width()/2);
        $(id).css('top',h/2-$(id).height()/2);
        $(id).fadeIn('fast');

    });

    $('.modal-video .close').click(function(e){

        e.preventDefault();
        $('#overlay, .modal-video').hide();
        
        if($.browser.msie){
            var clone = $(id).contents().clone(true);
            $(id).contents().remove();
            $(id).html(clone);
        }

    });
    
    $('.modal-video .close').prev('p').remove();

    $('#overlay').click(function(){

        $(this).hide();
        $('.modal-video').hide();
        
        if($.browser.msie){
            var clone = $(id).contents().clone(true);
            $(id).contents().remove();
            $(id).html(clone);
        }


    });

/* ========================= Clear 'dem Fields by Matthew Born ========================= */

	$('input').focus(function(){
	  if(!$(this).attr('placeholder')){
	    if(!$(this).val()){
	      $(this).attr('placeholder', ' ');
	      $(this).val('').addClass('active');
	    } else {
	      $(this).attr('placeholder', $(this).val());
	      $(this).val('').addClass('active');
	    }
	  } else if($(this).val() === $(this).attr('placeholder')){
	    $(this).val('').addClass('active');
	  }
	}).blur(function(){
	  if(!$(this).val()){
	    if($(this).attr('placeholder') === ' '){
	      $(this).val('');
	    } else {
	      $(this).val($(this).attr('placeholder'));
	    } $(this).removeAttr('placeholder').removeClass('active')
	  }
	});

/* ========================= Thumb Slider ========================= */
	
	$("#plainDemo").multipleElementsCycle({
	elementContainer: '#cycleElements',	// Selector for element (ul) container (Selector)
	prevElement: '#cycleElementsLeft',	// Selector to scroll previous (Selector)
	nextElement: '#cycleElementsRight',	// Selector to scroll next (Selector)
	speed: 500,				// Speed to scroll elements (int)
	containerWidth: false,			// Override default width (int)
	showCount: 3,				// Items to show from the list (int)
	overrideStart: 0,			// Override the start with a defined value (int)
	jumpTo: false,			// Selector for Jump To Links (Selector)
	vertical: false				// Whether this scroll is vertical (bool)
});

});
