// break out of frameset if (top.location != location) top.location.href = document.location.href; jQuery.noConflict(); var is_touch_device = 'ontouchstart' in document.documentElement; // used below to disable hover menu var currentClass; jQuery(function () { if (jQuery('table.TableHover tr') != null) { if (is_touch_device) return; jQuery('table.TableHover tr').hover( function () { jQuery(this).children().addClass('TableHoverRow'); }, function () { jQuery(this).children().removeClass('TableHoverRow'); }); } //New Grad Profile //ACCORDION BUTTON ACTION jQuery('div.accordionButton').click(function () { jQuery('div.accordionContent').slideUp('normal'); jQuery(this).next().slideDown('normal'); }); //HIDE THE DIVS ON PAGE LOAD jQuery("div.accordionContent").hide(); // setup any tabs if they are on the page jQuery('#TabContainer').tabs({ onClick: TabClicked }); TabClicked(null, null, null); if (!is_touch_device) { // setup the top nav jQuery('a[class^=TopMenuHover]').hover(function () { var id = jQuery(this).attr('class').split('_'); lastMenuClass = jQuery(this).attr('class'); jQuery('div[id^=' + id[1].replace('-clicked', '') + ']').show(); if (id[1] != 'Logo') jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').hide(); highlightedId = id[1]; }, function () { jQuery('div[class^=TopMenuDiv]').each(function () { jQuery(this).hide(); jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').show(); }); }); jQuery('div[class^=TopMenuDiv]').hover(function () { jQuery(this).show(); jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').hide(); jQuery('a.TopMenuHover_' + highlightedId).attr('class', jQuery('a.TopMenuHover_' + highlightedId).attr('class').replace('-clicked', '') + '-selected'); }, function () { jQuery('div[class^=TopMenuDiv]').each(function () { jQuery(this).hide(); }); jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').show(); jQuery('a.TopMenuHover_' + highlightedId.replace('-clicked', '') + '-selected').attr('class', lastMenuClass); }); } jQuery(".HistoryNav").css('opacity', '0.5'); jQuery(".HistoryNav ul").css('opacity', '1.0'); jQuery('.HistoryNav').each(function () { jQuery(this).find('a:first').attr('class', 'active'); }); jQuery('.StoryboardThumbOverlay').css('opacity', '0.5'); jQuery('.StoryboardThumbOverlay:first').css('opacity', '0'); jQuery(function () { // DOM Ready Shortcut // Hide to start jQuery('#SRDownload').hide(); if (jQuery('table.TableHover tr') != null) { if (!is_touch_device) { jQuery('table.TableHover tr').hover( function () { jQuery(this).children().addClass('TableHoverRow'); }, function () { jQuery(this).children().removeClass('TableHoverRow'); }); } } var activeSlideMenuItem = jQuery('#HomeBannerSlideMenu a').eq(0); // Setup banner's zindex var numberOfBanners = jQuery('.HomeBanner').length; jQuery('.HomeBanner').hide(); var currentBanner = jQuery('.HomeBanner').eq(0).show(); // Banner Page Numbers activeSlideMenuItem.addClass('active'); jQuery('#HomeBannerSlideMenu a').click(function (e) { e.preventDefault(); activeSlideMenuItem.removeClass('active'); activeSlideMenuItem = jQuery(this).addClass('active'); currentBanner.css({ 'z-index': 1 }).fadeOut(750); currentBanner = jQuery(this.hash).css({ 'z-index': 2 }).fadeIn(750); }); // setup any tabs if they are on the page jQuery('#TabContainer').tabs({ onClick: TabClicked }); TabClicked(null, null, null); // add a left class to the first for divs if the logo doesn't exist in the menu if (!jQuery('#TopMenu .Logo').length) { jQuery('.TopMenuDiv').slice(0, 3).addClass('TopMenuDivLeft'); } if (!is_touch_device) { // setup the top nav jQuery('#TopMenu a').hover(function () { var id = jQuery(this).attr('id').replace(/^TopMenuAnchor/, ''); // Store previous menu item hoveredMenuItem = jQuery(this).eq(0); jQuery('#' + id).show(); // No idea what element this but left it in as to not break anything - JP if (id != 'Logo') { jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').hide(); } }, function () { // No idea what element this but left it in as to not break anything - JP jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').show(); // Hide all Top Menu Divs jQuery('.TopMenuDiv').hide(); }); jQuery('.TopMenuDiv').hover(function () { // Keep this div open jQuery(this).show(); // No idea what element this but left it in as to not break anything - JP jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').hide(); // Add a hover class from the menu item that opened this div if (jQuery(hoveredMenuItem).length) hoveredMenuItem.addClass('hover'); }, function () { // Hide all Top Menu Divs jQuery('.TopMenuDiv').hide(); // No idea what element this but left it in as to not break anything - JP jQuery('#main_0_content_0_contentright_0_c_ctl01_ctl00_ctl00').show(); // Remove the hover class from the menu item if (jQuery(hoveredMenuItem).length) hoveredMenuItem.removeClass('hover'); }); } jQuery(".HistoryNav").css('opacity', '0.5'); jQuery(".HistoryNav ul").css('opacity', '1.0'); jQuery('.HistoryNav').each(function () { jQuery(this).find('a:first').attr('class', 'active'); }); jQuery('.StoryboardThumbOverlay').css('opacity', '0.5'); jQuery('.StoryboardThumbOverlay:first').css('opacity', '0'); // Replace all PopupLink with new window jQuery('a.PopupLink').each(function () { jQuery(this).click(function () { var left = (screen.width / 2) - (670 / 2); var top = (screen.height / 2) - (600 / 2); var new_window = window.open(jQuery(this).attr('href'), '', 'scrollbars=yes,menubar=no,height=600,width=670,resizable=no,toolbar=no,location=no,status=no,top=' + top + ',left=' + left + '\''); return false; }); }); }); }); // Public functions function TabClicked(clicked, content, hidden) { if (clicked == null) { if (jQuery('li.tabs-selected') != null) clicked = jQuery('li.tabs-selected >a').attr('href'); } if (clicked != null) { var id = clicked.toString(); id = id.split('#'); var link = jQuery('#link-' + id[1]).attr('value'); jQuery('a.PagePrintLink').attr('href', link + '?p=1'); } } function SwitchStoryboardTab(id, el) { jQuery('.StoryboardThumbOverlay').css('opacity', 0.5); jQuery('.StoryboardBannerIndividualBanner').fadeOut(); jQuery('.' + id).fadeIn(); el.css('opacity', '0.1'); return false; } function createCookie(name, value) { document.cookie = name + "=" + value + "; path=/"; } function readCookie(name) { var nameEQ = name + "="; var results = document.cookie.split(';'); for (var i = 0; i < results.length; i++) { var c = results[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } function fncPrint(objLink) { strUri = document.location.href; if (strUri.indexOf('?') == -1) jQuery(objLink).attr('href', strUri + '?p=1'); else jQuery(objLink).attr('href', strUri + '&p=1'); jQuery(objLink).attr('target', '_blank'); return true; } // search section cannot be isolated via asp:panel, since black bar nav used XSL, not ASP.NET, this is the workaround function fncSearchSection_Submit() { /* SECTION SEARCH */ var intLen = document.forms[0].q.length; for (var i = 0; i < intLen; i++) if (document.forms[0].q[i]) if (document.forms[0].q[i].value != document.forms[0].q[i].defaultValue) break; if (i != intLen) { // if site section submitted then redirect document.location.href = "/SearchResults.aspx?q=" + document.forms[0].q[i].value + "&sk=" + jQuery(document.forms[0].q[i]).attr('sec'); return false; } /* FORMSTACK - Contact */ if (jQuery("script[src*='formstack']").length > 0) document.forms[0].action = 'http://www.formstack.com/forms/index.php'; else if (jQuery("script[src*='formspring']").length > 0) document.forms[0].action = 'http://www.formspring.com/forms/index.php'; } function fncSearchSection_Click(objLink, strInput, strName) { /* on hyperlink */ if (jQuery('#' + strInput).val().toLowerCase() == 'search this section') jQuery('#' + strInput).val(''); document.location.href = "/SearchResults.aspx?q=" + jQuery('#' + strInput).val() + "&sk=" + strName; } function fncSearchSection_Blur(objInput) { if (jQuery(objInput).val().length == 0) jQuery(objInput).val('SEARCH THIS SECTION'); } function fncSearchSection_Focus(objInput) { if (jQuery(objInput).val().toLowerCase() == 'search this section') jQuery(objInput).val(''); } function fncPrintSitemap() { // see print.js } jQuery(document).ready(function () { SetVertSpacer(); TrackVanityUrls(); BindDownloadTracking(); }); function SetVertSpacer() { if (jQuery('.flexvertspacer') == null) { return; } jQuery('.flexvertspacer').each(function (index) { var divParent = jQuery(this).parent(); var height = divParent.height() - 40; jQuery(this).height(height); }); } var MEDIA_START_CONST = "~/media"; function TrackMediaDownload(downloadLink) { var startIndex = downloadLink.toLowerCase().indexOf(MEDIA_START_CONST) + MEDIA_START_CONST.length + 1; var trackText = downloadLink.substr(startIndex, downloadLink.length - startIndex); var s = s_gi('nexencnoocltdsitecore'); s.tl(this, 'o', trackText); } function BindDownloadTracking() { jQuery('a').each(function() { var href = jQuery(this).attr('href'); if (href.toLowerCase().indexOf(MEDIA_START_CONST) >= 0) { jQuery(this).click(function(event) { TrackMediaDownload(this.href); if (jQuery(this).attr('target') != undefined && jQuery(this).attr('target').toLowerCase() != '_blank') { event.preventDefault(); setTimeout(function() { location.href = href; }, 200); return false; } }); } }); } function TrackVanityUrls() { if (location.pathname.toLowerCase() === "/ukcareers") { s.tl(true, 'o', 'UKCareers'); } else if (location.pathname.toLowerCase() === "/community") { s.tl(true, 'o', 'Alias-Community'); } else if (location.pathname.toLowerCase() === "/reccentre") { s.tl(true, 'o', 'Alias - Anzac Rec Centre Feature'); } else if (location.pathname.toLowerCase() === "/marketing") { s.tl(true, 'o', 'Alias - Energy Marketing'); } else if (location.pathname.toLowerCase() === "/fourpillars") { s.tl(true, 'o', 'Alias - Four Pillars'); } else if (location.pathname.toLowerCase() === "/thecall") { s.tl(true, 'o', 'Alias - Distress Centre'); } else if (location.pathname.toLowerCase() === "/nait") { s.tl(true, 'o', 'Alias - NAIT'); } else if (location.pathname.toLowerCase() === "/fracing") { s.tl(true, 'o', 'Alias - Fracing Animation'); } else if (location.pathname.toLowerCase() === "/fracking") { s.tl(true, 'o', 'Alias - Fracking Animation'); } else if (location.pathname.toLowerCase() === "/education") { s.tl(true, 'o', 'Alias - Oil Sands Scholarship'); } else if (location.pathname.toLowerCase() === "/oilsands") { s.tl(true, 'o', 'Alias - Oil Sands Operations'); } else return null; }