﻿function pc(b, c, d, a) { return (c + d) * a + b }$(document).ready(function () {var b = $("#nav").width(), c = ($("body").outerWidth(!0) - b) / 2; $(window).resize(function () { c = ($("body").outerWidth(!0) - b) / 2; $("#pnlhome").css("left", c); $("#pnlabout").css("left", pc(c, b, 585, 1)); $("#pnlgames").css("left", pc(c, b, 585, 2)); $("#pnlcareers").css("left", pc(c, b, 585, 3)); $("#pnlshowcase").css("left", pc(c, b, 585, 4)) }); $("#pnlhome").css("left", c); $("#pnlabout").css("left", pc(c, b, 585, 1)); $("#pnlgames").css("left", pc(c, b, 585, 2)); $("#pnlcareers").css("left", pc(c, b, 585, 3)); $("#pnlshowcase").css("left",pc(c, b, 585, 4)); var d = document.title; $.History.bind(function (a) { a = a.replace("/", ""); a = a.substring(0, 1).toUpperCase() + a.substring(1, a.length); document.title = a + " | " + d }); $.History.bind("/home", function () { $("#nav img").each(function () { this.src = this.src.replace("_on", "_off") }); $("#nav a.active").removeClass("active"); $("#nav a.nvh").addClass("active"); $("img", $("#nav .nvh")).attr("src", $("img", $("#nav .nvh")).attr("src").replace("_off", "_on")); $("#space").animate({ left: "0px" }, 1E3) }); $.History.bind("/about",function () { $("#nav img").each(function () { this.src = this.src.replace("_on", "_off") }); $("#nav a.active").removeClass("active"); $("#nav a.nva").addClass("active"); $("img", $("#nav .nva")).attr("src", $("img", $("#nav .nva")).attr("src").replace("_off", "_on")); $("#space").animate({ left: "-" + pc(0, b, 585, 1) + "px" }, 1E3) }); $.History.bind("/games", function () {$("#nav img").each(function () { this.src = this.src.replace("_on", "_off") }); $("#nav a.active").removeClass("active"); $("#nav .nvg").addClass("active"); $("img", $("#nav .nvg")).attr("src",$("img", $("#nav .nvg")).attr("src").replace("_off", "_on")); $("#space").animate({ left: "-" + pc(0, b, 585, 2) + "px" }, 1E3)}); $.History.bind("/careers", function () { $("#nav img").each(function () { this.src = this.src.replace("_on", "_off") }); $("#nav a.active").removeClass("active"); $("#nav .nvc").addClass("active"); $("img", $("#nav .nvc")).attr("src", $("img", $("#nav .nvc")).attr("src").replace("_off", "_on")); $("#space").animate({ left: "-" + pc(0, b, 585, 3) + "px" }, 1E3) }); $.History.bind("/showcase", function () {$("#nav img").each(function () {this.src =this.src.replace("_on", "_off")}); $("#nav a.active").removeClass("active"); $("#nav .nvs").addClass("active"); $("img", $("#nav .nvs")).attr("src", $("img", $("#nav .nvs")).attr("src").replace("_off", "_on")); $("#space").animate({ left: "-" + pc(0, b, 585, 4) + "px" }, 1E3)}); $("#nav a").mouseover(function () { $(this).hasClass("active") || $("img", $(this)).attr("src", $("img", $(this)).attr("src").replace("_off", "_on")) }).mouseout(function () {$(this).hasClass("active") || $("img", $(this)).attr("src", $("img", $(this)).attr("src").replace("_on","_off"))}); $("#pnlabout a").mouseover(function () { $(this).hasClass("active") || $("img", $(this)).attr("src", $("img", $(this)).attr("src").replace("_off", "_on")) }).mouseout(function () { $(this).hasClass("active") || $("img", $(this)).attr("src", $("img", $(this)).attr("src").replace("_on", "_off")) }); $("#pnlabout .nav a").click(function (a) {a.preventDefault(); $("#pnlabout .content .pane").hide(); $("#pnlabout #" + $(this).attr("rel")).show(); $("#pnlabout .nav img").each(function () {this.src = this.src.replace("_on","_off")}); $("#pnlabout .nav a.active").removeClass("active"); $(this).addClass("active"); $("img", $(this)).attr("src", $("img", $(this)).attr("src").replace("_off", "_on"))}); $(".panel .drg").draggable({ stack: ".panel .drg", scroll: !1 }); $("#jobsfeed").PaRSS("http://www.microsoft-careers.com/xml/category214334.xml", 2, "", !1, "Read more", "r-arrow"); $("#jobsfeedb").PaRSS("http://www.microsoft-careers.com/xml/category214334.xml", 4, "", !1, "Find out more", "r-arrow-w"); $(".overlay .close").click(function () { $(this).parent().hide() });$(".game a").click(function () { $("#" + $(this).attr("rel") + "overlay").show() }); $(".overlay .slider img").click(function () { $(".overlay .slider img").each(function () { $(this).removeClass("active") }); $(this).addClass("active"); $(".photo img", $(this).parent().parent().parent().parent()).attr("src", $(this).attr("src").replace("th_", "")) }); $(".overlay .snav .leftarrow").click(function () {var a = $(".slider .imgframe", $(this).parent().parent()).position().left; a < 0 && $(".slider .imgframe", $(this).parent().parent()).animate({ left: a +127 + "px"}, 500)}); $(".overlay .snav .rightarrow").click(function () { var a = $(".slider .imgframe", $(this).parent().parent()).position().left; a > -381 && $(".slider .imgframe", $(this).parent().parent()).animate({ left: a - 127 + "px" }, 500) })});
