﻿$(document).ready(function() { BindVeil(); BindAccordion(); GridHeightAsLargest(); BindDoubleArrowNavigationEvents(); BindThumbnailHover(); BindThumbnailAction(); BindNewsBodyLinks(); BindFilterLinks() }); $(window).load(function() { }); function BindVeil() { $("#veil").fadeTo(0, 0); $("#veil").css("display", "inline-block"); $("#veil").css("height", "100%"); $("#veil").hide() } function BindAccordion() { var b = function(d) { d.preventDefault(); d.stopImmediatePropagation(); var e = $(this); if ($("#accordion > .rightContent:visible").index(e.next()) == -1) { $("#veil").css("display", "inline-block"); $(e.next()).load(e.attr("href") + " .contentSlider", function() { if ($("#accordion > .rightContent:visible").length != 0) { $("#accordion > a").removeClass("rightBoxBlue"); $("#accordion > a").addClass("rightBox"); e.removeClass("rightBox"); e.addClass("rightBoxBlue"); $("#accordion > .rightContent:visible").slideUp("slow", function() { $(this).empty(); $(this).hide(); $("#accordion").animate({ top: (110 - e.position().top) + "px" }, 500, function() { e.next().slideDown("slow", function() { GridHeightAsLargest(); $("#veil").hide(); FilterThumbs() }) }) }) } else { e.removeClass("rightBox"); e.addClass("rightBoxBlue"); $("#accordion").animate({ top: (110 - $(e).position().top) + "px" }, 500, function() { e.next().slideDown("slow", function() { GridHeightAsLargest(); $("#veil").hide(); FilterThumbs() }) }) } }) } else { $("#accordion > a:first").each(function(f, g) { if (g == e[0]) { $("#accordion .contentSlider:first #back").each(function(i, j) { var k = $(this).attr("href"); if (!!k) { var h = k + " .filters > *"; var l = $(".title"); $("#veil").css("display", "inline-block"); l.load(h, function() { l.removeClass("blue"); l.removeClass("title"); l.addClass("filters"); h = k + " .navigation > *"; $(" .navigation").load(h, function() { h = k + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(h, function() { SlideRight(); $("#veil").hide(); FilterThumbs() }) }) }) } }) } }) } return false }; $("#accordion > a").livequery("click", b); $("#accordion").accordion({ collapsible: true, active: "none", autoHeight: false, clearStyle: true }); if ($(".contentSlider").length == 0) { $("#accordion .rightBox:last").click() } else { $("#accordion").css("top", "10px"); var c = $(".contentSlider").parent().prev(); $(".rightContent").empty(); var a = c.attr("href"); c.attr("href", document.location.href); c.click(); c.attr("href", a) } } function GridHeightAsLargest() { $(".grid").css("height", $(".grid > *:nth-child(3)").height() + "px") } function BindDoubleArrowNavigationEvents() { $(".navigation .leftDoubleArrow").livequery("click", function(c) { c.preventDefault(); var b = this.href + ""; var a = b + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { var d = b + " .contentSlider .navigation > *"; $(".contentSlider .navigation").load(d, null, function() { SlideRight(); FilterThumbs(); $(".filterLinkBlue").addClass("filterLink"); $(".filterLinkBlue").removeClass("filterLinkBlue") }) }); return false }); $(".navigation .rightDoubleArrow").livequery("click", function(c) { c.preventDefault(); var b = this.href + ""; var a = this.href + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { var d = b + " .contentSlider .navigation > *"; $(".contentSlider .navigation").load(d, null, function() { FilterThumbs(); SlideLeft(); $(".filterLinkBlue").addClass("filterLink"); $(".filterLinkBlue").removeClass("filterLinkBlue") }) }); return false }); $(".navigation .text").livequery("click", function(c) { c.preventDefault(); var b = this.href + ""; var a = this.href + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { var d = b + " .contentSlider .navigation > *"; $(".contentSlider .navigation").load(d, null, function() { SlideLeft() }) }); return false }); $(".navigation .leftArrow").livequery("click", function(c) { c.preventDefault(); var b = this.href + ""; var a = b + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { var d = b + " .contentSlider .navigation > *"; $(".contentSlider .navigation").load(d, null, function() { var e = b + " .contentSlider .title > *"; $(".contentSlider .title").load(e, null, function() { SlideRight() }) }) }); return false }); $(".navigation .rightArrow").livequery("click", function(c) { c.preventDefault(); var b = this.href + ""; var a = this.href + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { var d = b + " .contentSlider .navigation > *"; $(".contentSlider .navigation").load(d, null, function() { var e = b + " .contentSlider .title > *"; $(".contentSlider .title").load(e, null, function() { SlideLeft() }) }) }); return false }) } function BindThumbnailHover() { $(".thumb").livequery("mouseover", function() { $(".overlay", $(this)).css("display", "inline-block") }); $(".thumb").livequery("mouseout", function() { $(".overlay", $(this)).css("display", "none") }) } function BindThumbnailAction() { $(".thumb").livequery("click", function(d) { d.preventDefault(); var c = this.href + ""; var a = c + " .navigation > *"; if ($("#accordion .rightContent:first .contentSlider").length > 0) { $(".navigation").load(a); a = c + " .title > *"; var b = $(".filters, .title"); b.load(a, null, function() { b.removeClass("filters"); b.removeClass("blue"); b.removeClass("title"); b.addClass("blue"); b.addClass("title") }); a = c + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { SlideLeft() }) } else { $(".rightContent .contentSlider").parent().slideUp("slow", function() { $(this).empty(); var e = $("#accordion .rightContent:first"); $("#accordion").animate({ top: (110 - e.position().top) + "px" }, 500, function() { var f = c + " .contentSlider"; $("#accordion .rightContent:first").load(f, function() { $("#accordion .rightContent:first").slideDown("slow", function() { }) }) }) }) } return false }) } function BindNewsBodyLinks() { $(".moreNews").livequery("click", function(c) { c.preventDefault(); var b = this.href + ""; var a = b + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { var d = b + " .contentSlider .navigation > *"; $(".contentSlider .navigation").load(d, null, function() { SlideLeft(); GridHeightAsLargest() }) }); return false }); $(".backToNews").livequery("click", function(c) { c.preventDefault(); var b = this.href + ""; var a = b + " .grid > *:nth-child(2) > *"; $(".grid > *:nth-child(3)").load(a, null, function() { var d = b + " .contentSlider .navigation > *"; $(".contentSlider .navigation").load(d, null, function() { SlideRight(); GridHeightAsLargest() }) }); return false }) } function BindFilterLinks() { $(".filters .filterLink").livequery("click", function(c) { c.preventDefault(); var b = $(this); $(".filterLinkBlue").addClass("filterLink"); $(".filterLinkBlue").removeClass("filterLinkBlue"); b.addClass("filterLinkBlue"); b.removeClass("filterLink"); var a = b.attr("href"); if (!!a) { $("#filterLinks").fadeTo(0, 0, function() { $("#filterLinks").css("display", "inline-block"); var d = a + " #filterLinks > *"; $("#filterLinks").load(d, function() { $("#filterLinks > *:first").fadeTo(0, 0.9); $("#filterLinks").fadeTo("slow", 1) }) }) } }); $(".filters .filterLinkBlue").livequery("click", function(b) { b.preventDefault(); var a = $(this); $(".filterLinkBlue").addClass("filterLink"); $(".filterLinkBlue").removeClass("filterLinkBlue"); a.addClass("filterLink"); a.removeClass("filterLinkBlue"); $("#filterLinks").fadeTo("slow", 0, function() { $("#filterLinks").css("display", "none") }) }); $("#filterLinks .filterLink").livequery("click", function(d) { d.preventDefault(); var c = $(this); var b = c.attr("href"); if (!!b) { var a = b + " #filterLinks + div:first > *"; $("#filterLinks + div:first ").load(a, function() { FilterThumbs(); a = b + " .navigation > *"; $(".navigation").load(a, function() { $("#filterLinks").fadeTo("slow", 0, function() { $("#filterLinks").css("display", "none"); $(".filterLinkBlue").addClass("filterLink"); $(".filterLinkBlue").removeClass("filterLinkBlue") }) }) }) } }) } function FilterThumbs() { $(".FilteredThumb").fadeTo(0, 0.2) } function SlideRight() { if ($(".grid > *").hasClass("left")) { $(".grid > *").removeClass("left") } if (!$(".grid > *").hasClass("right")) { $(".grid > *").addClass("right") } $(".grid > *:nth-child(1)").animate({ width: "0px" }, "fast", "easeInOutCubic", SwapFirstAndExpand) } function SlideLeft() { if (!$(".grid > *").hasClass("left")) { $(".grid > *").addClass("left") } if ($(".grid > *").hasClass("right")) { $(".grid > *").removeClass("right") } $(".grid > *:nth-child(1)").animate({ width: "0px" }, "fast", "easeInOutCubic", SwapFirstAndExpand) } function SwapFirstAndExpand() { $(".grid > *:nth-child(1)").remove().appendTo(".grid"); $(".grid > *:nth-child(3)").removeAttr("style") };
