$(document).ready(function () { if (jQuery.browser.msie && jQuery.browser.version < "7.0") { $("body").addClass("ie6"); if ($(".nav-item") != null) { $(".nav-item").children(".tier-2").not("#partners, #communities").css("width", "770px") } } if ($(".nav-item") != null) { $(".nav-item").children(".tier-2").not("#partners, #contact").css("left", "0") } if ($("#partners") != null) { $("#partners").css("right", "0") } if ($("#contact") != null) { $("#contact").css("right", "1px") } if ($("#partners") != null) { $("#partners").css("width", "210px") } if ($("#contact") != null) { $("#contact").css("width", "220px") } if ($(".nav-item") != null) { $(".nav-item").hover(function () { $("div:first", this).css("display", "block"); $(this).addClass("active"); $(this).siblings().addClass("inactive"); if ($(this).children("#communities")) { $("#communities").parent("li").css("position", "relative") } if ($(this).children("#partners")) { $("#partners").parent("li").css("position", "relative") } if ($(this).children("#contact")) { $("#contact").parent("li").css("position", "relative") } }, function () { $("div:first", this).css("display", "none"); $(this).removeClass("active"); $(this).siblings("li").removeClass("inactive") }) } if ($("#callchat").length > 0) { $("#callchat a").hover(function () { $(this).css("left", "0") }, function () { $(this).css("left", "2px") }) } }); function sameSize(b) { if ($(b).length > 0) { var a = 0; $(b).attr("style", ""); $(b).find(".more3").css("position", "static"); $(b).find(".bottom").css("position", "static"); $(b).each(function () { if ($(this).innerHeight() > a) { a = $(this).innerHeight() } }); $(b).each(function () { var c = parseInt($(this).css("padding-top")); var d = parseInt($(this).css("padding-bottom")); $(this).height(a - c - d) }); $(b).find(".bottom").css("position", "absolute"); $(b).find(".more3").css("position", "absolute"); if ($(b).children("#page-tools2").size() > 0) { $(b).children("#page-tools2").css("position", "absolute") } } } function SubmitFormForSearch() { var h = document.getElementById("borderInput").value; h = h.replace(/javascript/gi, ""); var b = location.href; b = b.replace(location.search, ""); b = b.replace(location.protocol + "//" + location.hostname, ""); var d = b.split("/"); var l = ""; for (x = 0; x < d.length; x++) { if (d[x].length == 2) { l = l + "/" + d[x] } } var f = location.protocol + "//" + location.hostname + l + "/search/default.aspx?q=" + h + "&sk=ca.com"; var e = location.href; var k = e.indexOf("/search/"); if (k < 0) { f += "&backUrl=" + encodeURIComponent(location.href) } else { var m = document.location.search; m = m.substring(1); var j = m.split("&"); for (i = 0; i < j.length; i++) { var c = j[i].split("="); var a = c[0]; var g = c[1]; if ((a.indexOf("backURL") > -1)) { g = g.replace(/javascript/gi, ""); g = g.toLowerCase(); if (g.indexOf("ca.com") > -1) { f += "&backUrl=" + g } } } } window.location.href = f } function getKeyCode(a, b) { if (document.all) { if (window.event) { if (window.event.keyCode == 13) { GetWindowSubmitEvent(a, b) } } else { if (a.keyCode == 13) { GetEventSubmitEvent(a, b) } } return false } else { if (document.getElementById) { if (window.event) { if (window.event.keyCode == 13) { GetWindowSubmitEvent(a, b) } } else { if (a.keyCode == 13) { GetEventSubmitEvent(a, b) } } return false } else { if (document.layers) { if (window.event) { if (window.event.keyCode == 13) { GetWindowSubmitEvent(a, b) } } else { if (a.keyCode == 13) { GetEventSubmitEvent(a, b) } } return false } } } return false } function GetWindowSubmitEvent(b, c) { var a = c; window.event.cancelBubble = true; window.event.returnValue = false; window.event.cancel = true; document.getElementById(a).onclick(); return false } function GetEventSubmitEvent(b, c) { var a = c; b.cancelBubble = true; b.returnValue = false; b.preventDefault(); b.cancel = true; document.getElementById(c).onclick(); return false } function GetCookie(c) { var d = document.cookie.indexOf(c + "="); var a = d + c.length + 1; if ((!d) && (c != document.cookie.substring(0, c.length))) { return null } if (d == -1) { return null } var b = document.cookie.indexOf(";", a); if (b == -1) { b = document.cookie.length } return unescape(document.cookie.substring(a, b)) } function SetCookie(a, b) { document.cookie = a + "=" + escape(b) + ";path=/;domain=.ca.com" } function openPopup(a, f, e) { var c = (screen.width / 2) - (e / 2); var b = (screen.height / 2) - (f / 2); var d = "height=" + f + ",width=" + e + ",top=" + b + ",left=" + c + ",titlebar=no,toolbar=no,resizable=no,scrollbars=no,menubar=no,resize=no"; window.open(a, "popWin", d) } function getHeadCkValue(a) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(a + "="); if (c_start != -1) { c_start = c_start + a.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) { c_end = document.cookie.length } return document.cookie.substring(c_start, c_end) } } return "" } function getLink() { var b = false; if (getHeadCkValue("SMSESSION").length > 0) { if (getHeadCkValue("SMSESSION") != "LOGGEDOFF") { if (getHeadCkValue("pcSSO").length > 0) { if (getHeadCkValue("pcSSO") == "true") { if (getHeadCkValue("pcID").length > 0) { b = true } } } } } var g = document.getElementsByTagName("input"); if (g != null) { if (g.length == 0) { } } var o = ""; var j = ""; var l = ""; var n = ""; var k = ""; var a = ""; var f = ""; for (var e = 0; e < g.length; e++) { if (g[e].getAttribute("type") == "hidden") { if (g[e].getAttribute("name").indexOf("hidReturn") > 0 || g[e].getAttribute("name") == "hidReturn") { j = g[e].getAttribute("value") } if (g[e].getAttribute("name").indexOf("hidPrepend") > 0 || g[e].getAttribute("name") == "hidPrepend") { o = g[e].getAttribute("value"); if (o == "/us/na") { o = "/us" } } if (g[e].getAttribute("name").indexOf("hidWelcome") > 0 || g[e].getAttribute("name") == "hidWelcome") { a = g[e].getAttribute("value") } if (g[e].getAttribute("name").indexOf("hidmode") > 0 || g[e].getAttribute("name") == "hidmode") { f = g[e].getAttribute("value") } if (g[e].getAttribute("name").indexOf("hidMyCA") > 0 || g[e].getAttribute("name") == "hidMyCA") { k = g[e].getAttribute("value") } if (b) { if (g[e].getAttribute("name").indexOf("hidLogout") > 0 || g[e].getAttribute("name") == "hidLogout") { l = g[e].getAttribute("value") } if (g[e].getAttribute("name").indexOf("hidUpdate") > 0 || g[e].getAttribute("name") == "hidUpdate") { n = g[e].getAttribute("value") } } else { if (g[e].getAttribute("name").indexOf("hidLogin") > 0 || g[e].getAttribute("name") == "hidLogin") { l = g[e].getAttribute("value") } if (g[e].getAttribute("name").indexOf("hidRegister") > 0 || g[e].getAttribute("name") == "hidRegister") { n = g[e].getAttribute("value") } } } } if (o == null) { o = "" } if (j == null) { j = "" } if (f == null) { f = "true" } if (k == null) { k = "MyCA" } if (b) { if (l == null) { l = "login" } if (n == null) { n = "register" } if (a == null) { a = "Welcome back," } } else { if (l == null) { l = "log out" } if (n == null) { n = "" } if (a == null) { a = "" } } if (o == "null") { o = "" } if (j == "null") { j = "" } if (f == "null") { f = "true" } if (k == "null") { k = "MyCA" } if (b) { if (l == "null") { l = "login" } if (n == "null") { n = "" } if (a == "null") { a = "Welcome back," } } else { if (l == "null") { l = "log out" } if (n == "null") { n = "" } if (a == "null") { a = "" } } var d; var h; if (j.length == 0) { var m = window.location.pathname; if (m.indexOf("default.aspx") > 0) { j = window.location.pathname } } if (o.length == 6) { if (o.substr(0, 3) == o.substr(3, 3)) { o = o.substr(0, 3) } } if (b) { if (document.getElementById("divLogin") != null) { if (getHeadCkValue("pcFNAME").length > 0) { h = o + "/register/updateprofile.aspx?returnURL=" + j; var c = decodeURI(getHeadCkValue("pcFNAME")); if (c != null) { if (c.indexOf("+")) { c = c.replace("+", " ") } } } document.getElementById("divLogin").innerHTML = a + "&nbsp;<a href='" + h + "' >" + c + "</a>&nbsp;" } if (document.getElementById("divRegister") != null) { h = o + "/register/logout.aspx?returnURL=" + j; document.getElementById("divRegister").innerHTML = "<a href='" + h + "' >" + l + "</a>&nbsp;" } if (document.getElementById("divMyCA") != null) { if (f == "true") { document.getElementById("divMyCA").innerHTML = "<a href='https://communities.ca.com/web/myca/' >" + k + "</a>&nbsp;" } else { document.getElementById("divMyCA").innerHTML = "<a href='https://qa.communities.ca.com/web/myca/' >" + k + "</a>&nbsp;" } } } else { if (document.getElementById("divLogin") != null) { d = o + "/register/login.aspx?returnURL=" + j; document.getElementById("divLogin").innerHTML = "<a href='" + d + "' >" + l + "</a>&nbsp;" } if (document.getElementById("divRegister") != null) { h = o + "/register/createprofile.aspx?returnURL=" + j; document.getElementById("divRegister").innerHTML = "<a href='" + h + "' >" + n + "</a>&nbsp;" } if (document.getElementById("divMyCA") != null) { if (f == "true") { document.getElementById("divMyCA").innerHTML = "<a href='https://communities.ca.com/c/portal/login?p_l_id=10141' >" + k + "</a>&nbsp;" } else { document.getElementById("divMyCA").innerHTML = "<a href='https://qa.communities.ca.com/c/portal/login?p_l_id=10141' >" + k + "</a>&nbsp;" } } } };
