/* =====================================================================
// EFFP UI
// Created September 2010 - KJR | WAA Ltd.
// jQuery
===================================================================== */

// Function to add in abbr tags for EFFP

jQuery.noConflict();


jQuery(document).ready(function () {
    jQuery('.no-js').addClass('js').removeClass('no-js');

    if (jQuery('.sf_wrapper').length == 0) {

        // Make whole sign-post clickable  
        jQuery('div.sign-posting > ul > li').not('div.sign-posting > ul > li.news-letter').click(function () {
            window.location = jQuery(this).find('a').attr('href');
            return false;
        });

        jQuery('div.sign-posting > ul > li').not('div.sign-posting > ul > li.news-letter').hover(function () {
            jQuery(this).toggleClass('hover');
        });

        /* Hide the anchor off screen when JavaScript is enabled */
        jQuery('div.sign-posting a.button').addClass('hide-2');

        // Add presentational classes to provide support for older browsers

        jQuery('table tbody tr:nth-of-type(even)').addClass('even');
        jQuery('table tbody td:last-of-type').addClass('last');

        jQuery('#share-print').click(function () {
            printpage()
        });

        if (jQuery('#modal-box-screen').length > 0) {
            jQuery('#modal-box-screen').remove().clone(true).appendTo('body');
        }

        jQuery('#overlay').click(function () {
            var scrollTop = jQuery(window).scrollTop();

            jQuery('html').addClass('screen').find('#modal-box-screen').css('top', scrollTop).addClass('active');
            return false;
        });

        jQuery('.overlay-swf').click(function () {

            var scrollTop = jQuery(window).scrollTop();
            var swf = jQuery(this).attr('href');
            var flashvars = {};
            var params = {};
 	    params.allowFullScreen = "true";
            var attributes = {};
            attributes.type = "swf";
	    attributes.allowFullScreen = "true";
            swfobject.embedSWF(swf, 'media-content', '817', '459', '9.0.0', false, flashvars, params, attributes);
            jQuery('html').addClass('screen').find('#modal-box-screen').css('top', scrollTop).addClass('active');
            return false;
        });

        jQuery('#modal-box-screen #close-button').click(function () {
            jQuery('html').removeClass('screen').find('#modal-box-screen').removeClass('active');
            return false;
        });
    }

});

function printpage() {
  window.print();
}

function WriteVideo(flvUrl) {
    var flashvars = {};
    flashvars.flvUrl = flvUrl;
    var params = {};
    var attributes = {};
    swfobject.embedSWF("/website/flash/player_CS4.swf", "media-content", "817", "459", "9.0.0", false, flashvars, params, attributes);
}



