
/*
FILE CONCAT ADD FILE
PATH: /ft/resources/style/investmentBanking/main.css.asp
*/


#wsod.investmentBanking FIELDSET.blockContainer {
	float: left;
	padding-right: 20px;
}

#wsod.investmentBanking FIELDSET.blockContainer.last {
	padding-right: 0px;
	_width: auto;
}

#wsod.investmentBanking FORM {
	padding-bottom: 20px;
}

#wsod.investmentBanking LABEL.block,
#wsod.investmentBanking LABEL.radio,
#wsod.investmentBanking .dealValueAndFeesContainer .instructionText {
	color: #666;
	font-size: 12px;
}

#wsod.investmentBanking LABEL.block {
	display: block;
	padding-bottom: 5px;
}

#wsod.investmentBanking .bold {
	font-weight: bold;
}

#wsod.investmentBanking .noBold {
	font-size: 11px;
	font-weight: normal;
}

#wsod.investmentBanking .dealValueAndFeesContainer {
	background-color: #f6e9d8;
	clear: both;
	float: left;
	width: 100%;
}

#wsod.investmentBanking .dealValueAndFeesContainer FIELDSET {
	padding: 5px 0 5px 5px;
}

#wsod.investmentBanking .dealValueAndFeesContainer .instructionText,
#wsod.investmentBanking .dealValueAndFeesContainer .radioContainer {
	float: left;
}

#wsod.investmentBanking .dealValueAndFeesContainer .instructionText {
	position: relative;
	top: -1px;
	padding-right: 5px;
}

#wsod.investmentBanking .dealValueAndFeesContainer .radioContainer.last {
	padding-left: 15px;
	_width: auto;
}

#wsod.investmentBanking .dealValueAndFeesContainer .radioContainer LABEL {
	padding-left: 5px;
	line-height: 11px;
	height: 12px;
	zoom: 1;
	position: relative;
	*top: 1px;
}

#wsod.investmentBanking .dealValueAndFeesContainer .radioContainer input {
	height: 12px;
	width: 12px;
	margin: 0;
	padding: 0;
	vertical-align: middle;
}

#wsod.investmentBanking .wsod-tabs-main {
	margin-bottom: 2px;
}

#wsod.investmentBanking .wsod-tabs-main LI.last {
	_width: auto;
}

#wsod.investmentBanking .logoLink.hidden {
	display: none;
}

#wsod.investmentBanking .logoLink.last {
	padding-left: 15px;
}

#wsod div.worldMapText p.bold{
	font-size: 14px;
}


#wsod h1{
	border-bottom: 3px solid #A7A49B !important;
    color: #666666 !important;
    float: left !important;
    font-size: 25px !important;
    font-weight: normal !important;
    line-height: 28px !important;
    margin-bottom: 10px !important;
    padding-bottom: 5px !important;
    position: relative !important;
    text-transform: none !important;
    width: 100% !important;
}

#wsod p {
    font-size: 12px !important;
    line-height: 18px !important;
}

#wsod.investmentBanking #dataDates #dataFrom{
	float: left;
}

#wsod.investmentBanking #dataDates #dataAsOf{
	float: right;
}

/*
FILE CONCAT ADD FILE
PATH: /ft/resources/style/sectorsAndIndustries.main.css.asp
*/


/**************************************
** Sectors & Industries - Global styles
***************************************/

#wsod .contentModule.pageHeaderModule {
    margin-bottom: 0px;
}

#wsod .contentModule.pageHeaderModule SPAN.parentText {
    float: left;
    font-size: 15px;
}

#wsod .contentModule.sectorsAndIndustriesModule H2 {
    width: 100%;
}

#wsod .contentModule.sectorsAndIndustriesModule A {
    font-weight: bold;
    font-size: 12px;
}

#wsod .contentModule.sectorsAndIndustriesModule A:hover {
	color: #000;
}

#wsod .contentModule.sectorsAndIndustriesModule .exchangeDisplay, 
#wsod .contentModule.sectorsAndIndustriesModule .currency {
    color: #777;
    font-size: 11px;
}

/** News Modules **/

#wsod .contentModule.sectorsAndIndustriesModule .detail{
    font-size: 12px;
    color: #777;
    display: inline;
    margin-left: 2px;
}

#wsod .contentModule.sectorsAndIndustriesModule .storiesHolder {
    margin-top: 5px;
    border-bottom:1px solid #E7E2DB;
}

#wsod .contentModule.sectorsAndIndustriesModule .storiesHolder.noBorder {
    border-bottom: none;
}

#wsod .contentModule.sectorsAndIndustriesModule .storiesHolder LI {
		margin-top: 10px;
    margin-bottom: 10px;
}

/** Table Stuff **/

#wsod .contentModule.sectorsAndIndustriesModule .tableHolder {
    float:left;
    width: 100%;
    position: relative; /*This is for the loading graphic to work properly*/
}

#wsod .contentModule.sectorsAndIndustriesModule TABLE THEAD.backgroundFill {
    background-color:#F6E9D8;
}

#wsod .contentModule.sectorsAndIndustriesModule TABLE TH.textBold,
#wsod .contentModule.sectorsAndIndustriesModule TABLE TD.textBold {
    font-weight: bold;
}

#wsod .contentModule.sectorsAndIndustriesModule TABLE TH.textLeft,
#wsod .contentModule.sectorsAndIndustriesModule TABLE TD.textLeft,
#wsodPop .popup.industryListDropDown TABLE TD.textLeft {
    text-align: left;    
}

#wsod .contentModule.sectorsAndIndustriesModule TABLE TH.textRight,
#wsod .contentModule.sectorsAndIndustriesModule TABLE TD.textRight {
    text-align: right;    
}

#wsod .contentModule.sectorsAndIndustriesModule TABLE TH.textCenter,
#wsod .contentModule.sectorsAndIndustriesModule TABLE TD.textCenter {
    text-align: center;    
}

/** Links CSS **/

#wsod .contentModule.sectorsAndIndustriesModule .linksHolder {
    background-color:#F6E9D8;
    float: left;
    width: 100%;
    margin-bottom: 5px;
}

#wsod .contentModule.sectorsAndIndustriesModule .linksHolder UL LI {
    float: left;
    margin: 5px;
}

#wsod .contentModule.sectorsAndIndustriesModule .linksHolder .active {
    color: black;
}

/** Blank td's for IC and IR **/

#wsod .contentModule.sectorsAndIndustriesModule .ic-blank{
    height:17px;
    width:17px;
}

#wsod .contentModule.sectorsAndIndustriesModule P.industryDisclaimer {
    color:#777;
    font-size:10px;
    line-height:12px;
}

/** Industry Drop Down **/

#wsodPop .popup.industryListDropDown .popupInner {
    background-color:#FFFFFF;
    border:1px solid #9E9E9E;
    width:275px;
}

#wsodPop .popup.industryListDropDown .closeDropDown {
    display:block;
    position:absolute;
}

#wsodPop .popup.industryListDropDown .industryDropDownText{
    font-size: 12px;
    border-bottom: 2px solid #E7E2DB;
    padding-bottom: 5px;
}

#wsodPop .popup.industryListDropDown TABLE TD {
    padding: 3px 4px;
}

#wsodPop .popup.industryListDropDown {
    z-index:2000;
}

/*
FILE CONCAT ADD FILE
PATH: /ft/resources/client/modules/markets/sectorsAndIndustries/industryDropDown.js
*/
var IndustryDropDown = function() {
    this.hasTitle(false);
    this.hasCloseLink(false);

    var preload = new Image();
        preload.src = this.SRC_ACTIVE_ICON;
}

IndustryDropDown.Extend(Popup);

IndustryDropDown.prototype.ICON_SIZE = 24;
IndustryDropDown.prototype.ICON_HORIZONTAL_OFFSET = 10;
IndustryDropDown.prototype.POPUP_SIZE = 325;

IndustryDropDown.prototype.CSS_DROPDOWN = "industryListDropDown";
IndustryDropDown.prototype.CSS_DROPDOWN_TEXT = "industryDropDownText";
IndustryDropDown.prototype.BUFFER_URL = '/ft/resources/buffer/sectorsAndIndustries/getListOfIndustries.asp'
IndustryDropDown.prototype.URL_LINKS = "/ft/markets/sectorsAndIndustries/industries.asp";
IndustryDropDown.prototype.SRC_ACTIVE_ICON = "/ft/resources/image/dropdown-active.gif";

IndustryDropDown.prototype.init = function() {
    var dropDownLink = WSDOM.Element.get('industryDropDown');
    WSDOM.Events.add(dropDownLink, 'click', this.draw, this)
}

IndustryDropDown.prototype.getAnchorElement = function() { return null; }
IndustryDropDown.prototype.setAnchorElement = function(el) {
    el = Element.get(el);

    this.getAnchorElement = function() {
        return el;
    }
}

IndustryDropDown.prototype.position = function() {
    var contentWell = Element.getXY(Element.get("wsod"));

    var view = Element.getViewport();
    var frame = this.getFrame();

    var frameSize = Element.getSize(frame);

    var frameTop, frameLeft;
    if (this.getAnchorElement()) {
        var anchorXY = Element.getXY(this.getAnchorElement());
        var anchorSize = Element.getSize(this.getAnchorElement());

        frameTop = anchorXY.y + this.ICON_SIZE;

        if (anchorXY.x - this.POPUP_SIZE < contentWell.x) {
            frameLeft = anchorXY.x - this.ICON_HORIZONTAL_OFFSET;
        } else {
            frameLeft = anchorXY.x + anchorSize.width - frameSize.width + this.ICON_HORIZONTAL_OFFSET;
        }
    } else {
        frameTop = Math.max(view.top + (view.height / 2) - (frameSize.height / 2), 0) - contentWell.y;
        frameLeft = Math.max((view.width / 2) - (frameSize.width / 2), 0) - contentWell.x;
    }

    Element.setXY(frame, frameLeft, frameTop);
    this.sizeShim();
    // add a class instead
    frame.style.visibility = 'visible';
};

IndustryDropDown.prototype.getDropDownListContent = function(args) {
    
    var cb = this.getContentBuffer();

    var conn = cb.load({
        debug: true,
        url: this.BUFFER_URL,
        method: "post",
        contentType: "text/javascript",
        preventEval: true,
        context: this,
        data: {
            wsodIssue: args.symbol
            ,pageType: args.pageType
        },
        onload: this.buildDropDown
    });
}

IndustryDropDown.prototype.close = function(e, el) {
    IndustryDropDown.Super(this, ["close"]);
};

IndustryDropDown.prototype.draw = function(e, el) {
    this.setAnchorElement(el);

    if (!Element.hasClass(this.getFrame(), this.CSS_DROPDOWN)) {
        Element.addClass(this.getFrame(), this.CSS_DROPDOWN);

        Element.addChild(this.getContent(),
			    Element.create("div", { "class": "placeholder" })
		    );

        var closeSide = "right";
        if (Element.getXY(this.getAnchorElement()).x - this.POPUP_SIZE < Element.getXY("wsod").x) {
            closeSide = "left";
        }

        Element.addChild(this.getFrame(),
			    Element.create("img", { "class": "closeDropDown", "src": this.SRC_ACTIVE_ICON, "style": "top:" + ((this.ICON_SIZE - 1) * -1) + "px;" + closeSide + ":" + this.ICON_HORIZONTAL_OFFSET + "px;", "Events":
				    { "type": "click", "handler": this.close, "context": this }
			    })
		    );
    }

    var frame = this.getFrame();
    Element.removeClass(frame, this.CSS_HIDDEN);

    this.position();
    
    this.SECTOR_NAME = el.getAttribute('sectorName');
    this.IS_INDUSTRY = el.getAttribute('isIndustry');

    this.getDropDownListContent({
        symbol: el.getAttribute('symbol')
	    , pageType: el.getAttribute('pageType')
    });

    //IndustryDropDown.Super(this, ["draw"]);    
}

IndustryDropDown.prototype.buildDropDown = function(cb) {
    var results = new Serializer().deserialize(cb.getResult());

    Element.removeChildNodes(this.getContent());

    var dropDownContent = Element.create("div"),
        table,
        tbody;

    table = Element.create("table", {}, [
		tbody = Element.create("tbody")
	])

    for (var i = 0; i < results.length; i++) {
        if (results[i].wsodIssue != -32768) {
            Element.create("tr", {}, [
			    Element.create("td", { "class": "textLeft" }, [
				    Element.create("a", { "href": this.URL_LINKS + "?s=" + results[i].wsodIssue }, results[i].fullName)
			    ]),
		    ], tbody);
        }
    }

    if (results.length) {
        if (this.IS_INDUSTRY == 'true') {
            var text = "There are " + results.length + " other industries in the " + this.SECTOR_NAME + " sector.";
        } else {
            var text = "There are " + results.length + " industries in the " + this.SECTOR_NAME + " sector.";
        }
        Element.create("div", { "class": this.CSS_DROPDOWN_TEXT }, text, dropDownContent)
    }

    Element.addChild(dropDownContent, table);

    Element.addChild(this.getContent(), dropDownContent);

    this.sizeShim();

    this.getDropDownListContent = function() { return; }
    this.buildDropDown = function() { return; }
}

IndustryDropDown.prototype.getContentBuffer = function() {
    var cb = new ContentBuffer();

    this.getContentBuffer = function() {
        return cb;
    }

    return this.getContentBuffer();
}