﻿window.onload = function() {
    //Create Menu Settings: (Menu ID, Is Vertical, Show Timer, Hide Timer, On Click ('all', 'main' or 'lev2'), Right to Left, Horizontal Subs, Flush Left, Flush Top)
    eep();
    qm_create(0, false, 250, 0, false, false, false, false, false);
    rolloverNavIcons();
    hrefTargetBlank();
    if (typeof KickoffSearch == 'function') {
        KickoffSearch();
    }
}

function eep() {
    var flashvars = {};
    flashvars.selTileIndex = "none";
    flashvars.animateIntro = "true";
    flashvars.url1 = "http://ww5.komen.org/IWasDiagnosed/IveBeenDiagnosedwithBreastCancer.html?itc=emoentpnt:1";
    flashvars.url2 = "http://ww5.komen.org/SomeoneIKnow/SomeoneIKnowWasDiagnosed.html?itc=emoentpnt:2";
    flashvars.url3 = "http://ww5.komen.org/MakeADifference/ImHeretoMakeaDifference.html?itc=emoentpnt:3";
    flashvars.url4 = "http://ww5.komen.org/ShareStory.aspx?itc=emoentpnt:4";
    flashvars.urlLogo = "http://ww5.komen.org/default.aspx";
    var params = {};
    params.menu = "false";
    params.wmode = "transparent";
    var attributes = {};
    swfobject.embedSWF("flash/eep.swf", "sgk_emotional_entry_container", "358", "165", "9.0.0", "js/expressInstall.swf", flashvars, params, attributes);
}

function hrefTargetBlank() {
    $("a[href*='.pdf'],a[href*='.doc']").attr("target", "_blank");
}

function rolloverNavIcons() {
    $(".sgk_nav_icons a").hover(
		function() {
		    var icon = $(this).children("img");
		    if ($(icon).attr("src").indexOf("_over") == -1) {
		        var newSrc = $(icon).attr("src").replace(".jpg", "_over.jpg#hover");
		        $(icon).attr("src", newSrc);
		    }
		},
		function() {
		    var icon = $(this).children("img");
		    if ($(icon).attr("src").indexOf("_over.jpg#hover") != -1) {
		        var oldSrc = $(icon).attr("src").replace("_over.jpg#hover", ".jpg");
		        $(icon).attr("src", oldSrc);
		    }
		}
	);
}

function newsToggle(target) {
    if (target == 'breast_cancer_news') {
        $("#sgk_latest_news_tower_komen").css({ display: "none" });
        $("#sgk_latest_news_tower_breast_cancer").css({ display: "block" });
        if ($("#img_breast_cancer_news").attr("src").indexOf("_off.gif") != -1) {
            var oldSrc = $("#img_breast_cancer_news").attr("src").replace("_off.gif", "_on.gif");
            $("#img_breast_cancer_news").attr("src", oldSrc);
        }
        if ($("#img_komen_news").attr("src").indexOf("_on.gif") != -1) {
            var oldSrc = $("#img_komen_news").attr("src").replace("_on.gif", "_off.gif");
            $("#img_komen_news").attr("src", oldSrc);
        }
    }

    if (target == 'komen_news') {
        $("#sgk_latest_news_tower_breast_cancer").css({ display: "none" });
        $("#sgk_latest_news_tower_komen").css({ display: "block" });
        if ($("#img_komen_news").attr("src").indexOf("_off.gif") != -1) {
            var oldSrc = $("#img_komen_news").attr("src").replace("_off.gif", "_on.gif");
            $("#img_komen_news").attr("src", oldSrc);
        }
        if ($("#img_breast_cancer_news").attr("src").indexOf("_on.gif") != -1) {
            var oldSrc = $("#img_breast_cancer_news").attr("src").replace("_on.gif", "_off.gif");
            $("#img_breast_cancer_news").attr("src", oldSrc);
        }
    }
};