/**
 * Browser fixes for generic.css. This file depends on jQuery.
 */

jQuery(document).ready(function($){
    var majorVersion = parseInt($.browser.version, 10);

/* @group Setup
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

/* @end
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/

/* @group Elements
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

/* @end
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/

/* @group Segment / Page Layout
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

if ($.browser.msie && majorVersion < 8) {
  $(".ac-content-footermain > .cw-table-fauxrow > .cw-table-fauxcell:last-child").css({
    "padding-right": "25px",
    "text-align": "right"});

  $(document).ready(function(){
    var wrapper = $("#cw-content-contentwrapper"),
        toolbox = $("#cw-segment-toolbox"),
        body = $("#cw-segment-body"),
        newToolbox = $("<td/>"),
        newBody = $("<td/>"),
        table = $("<table/>"),
        row = $("<tr/>");

    newToolbox.html(toolbox.html()).attr("id", "cw-segment-toolbox");
    newToolbox.attr("style", toolbox.attr("style"));
    newBody.html(body.html()).attr("id", "cw-segment-body");
    newBody.attr("style", body.attr("style")).css("vertical-align", "top");

    table.addClass("cw-table cw-table-fullsize").attr("cellspacing", "0");

    row.append(newToolbox, newBody);
    table.append(row);
    wrapper.before(table);

    wrapper.remove();
  });

  $(document).ready(function(){
    var wrapper = $("#cw-content-footerwrapper"),
        left = $("#cw-content-footerwrapper .cw-table-fauxcell:first-child"),
        right = $("#cw-content-footerwrapper .cw-table-fauxcell:last-child"),
        newLeft = $("<td/>"),
        newRight = $("<td/>"),
        table = $("<table/>"),
        row = $("<tr/>");

    newLeft.html(left.html()).attr("style", left.attr("style"));
    newRight.html(right.html()).attr("style", right.attr("style"));

    table.addClass("cw-table cw-table-fullsize ac-content-footermain").attr("cellspacing", "0");

    row.append(newLeft, newRight);
    table.append(row);
    wrapper.before(table);

    wrapper.remove();
  });
}

/* @end
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/

/* @group Success Stories
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

/* @end
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/

/* @group Outreach Kit
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

if ($.browser.msie && majorVersion < 9) {
  $(".cw-table.ac-outreachkit-links > .cw-table-fauxrow > .cw-table-fauxcell:last-child").css({
    "text-align": "right"});

  $("#ac-outreachkit table > thead > tr:nth-child(odd)").css({
    "color": "#FFFFFF"});

  $("#ac-outreachkit table > thead > tr:nth-child(even)").css({
    "background-color": "#D5D5D5"});

  $("#ac-outreachkit table > tbody > tr > th:first-child").css({
    "padding-right": "15px",
    "font-weight": "bold",
    "text-align": "left",
    "white-space": "nowrap"});

  $("#ac-outreachkit table > tbody > tr:nth-child(odd)").css({
    "background-color": "#E4E4E4"});

  $("#ac-outreachkit table > tbody > tr:nth-child(even)").css({
    "background-color": "#D5D5D5"});

  $(".ac-content-successstory:last-of-type").css({
    "margin-bottom": "0"});
}

/* @end
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/

/* @group Content
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/

if ($.browser.msie && majorVersion < 9) {
  $(".ac-content-pointer").css({
    "display": "none"});

  $(".ac-content-footermain > .cw-table-fauxrow > .cw-table-fauxcell:first-child").css({
    "padding-left": "25px"});

  $(".ac-content-footermain > .cw-table-fauxrow > .cw-table-fauxcell:last-child").css({
    "padding-right": "25px",
    "text-align": "right"});

  $(".ac-content-resourcepopup > .cw-section-body > p:first-child").css({
    "font-weight": "bold"});

  $(".ac-content-eventpopup > .cw-section-body > p:first-child").css({
    "font-weight": "bold"});
}

/* @end
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/

});

