$(document).ready(function(){ if($.browser.msie && parseInt($.browser.version) < 7){ DD_belatedPNG.fix('.pngfix, li.sub_level_0, div, a, img, h1, h2, h3, table, tr, td, th, #header-project-left, #header-project-right'); } var url = window.location.href; var spliturl = url.split('/'); spliturl.splice(0,1); spliturl.splice(0,1); spliturl.splice(0,1); spliturl.splice(0,1); $('#navigation ul li').find('a').each(function(){ var link = $(this).text().toLowerCase(); if(link == spliturl[0]) $(this).parent().addClass('current'); }) try{Typekit.load({ loading: function() { $('#navigation').css('display','none'); // Javascript to execute when fonts start loading }, active: function() { // Javascript to execute when fonts become active $('#navigation').css('display','block'); initMenu(); }, inactive: function() { // Javascript to execute when fonts become inactive $('#navigation').css('display','block'); initMenu(); } });}catch(e){ $('#indicator').css('display','none'); } $('#login input').focus(function(){ if($(this).attr('rel') == $(this).attr('value')){ currentsignupvalue = $(this).attr('value'); $(this).attr('value',''); } }) $('#aboutus #header li.aboutus').addClass('current'); $('#services #header li.services').addClass('current'); $('#projects #header li.projects').addClass('current'); $('#commitment #header li.commitment').addClass('current'); $('#tenders #header li.tenders').addClass('current'); $('#careers #header li.careers').addClass('current'); $('#inductions #header li.inductions').addClass('current'); $('#contactus #header li.contactus').addClass('current'); $('#login input').blur(function(){ if($(this).attr('value') == '') $(this).attr('value',$(this).attr('rel')); }) $('#navigation a:last').css('border-right','none'); var navwidth = 0; $('#navigation li').each(function(){ var itemwidth = $(this).width(); navwidth += itemwidth; }) function initMenu(){ var current; var defaultpos; var defaultleft; var defaultalpha; var defaultwidth; $('#navigation').fadeIn('slow',function(){ if($('#navigation li.current').length){ current = $('#navigation li.current'); defaultpos = current.position(); defaultleft = defaultpos.left; defaultalpha = 1; defaultwidth = current.width(); $('#indicator').css('left',defaultleft) $('#indicator').css('width',current.width()) } else if($('.index').length){ current = $('#navigation li:first'); defaultpos = current.position(); defaultleft = defaultpos.left; defaultalpha = 0; defaultwidth = current.width(); $('#indicator').css('left',defaultleft) $('#indicator').css('width',current.width()) $('#indicator').css('opacity',defaultalpha) } if($('#navigation li.parent_current').length){ current = $('#navigation li.parent_current'); defaultpos = current.position(); defaultleft = defaultpos.left; defaultalpha = 1; defaultwidth = current.width(); $('#indicator').css('left',defaultleft) $('#indicator').css('width',current.width()) } $('#navigation ul').mouseleave(function(){ $('#indicator').stop(); $('#indicator').animate({ left: defaultleft, width: defaultwidth, opacity: defaultalpha }) }) var anim; var targetpos; $('#navigation li').mouseenter(function(){ $('#indicator').stop(); var p = $(this); var position = p.position(); targetpos = position.left; var itemwidth = $(this).width(); $('#indicator').animate({ left: targetpos, width: itemwidth, opacity: 1 }) }) }) } var projectimgcount = 0; $('#project-details-right a:last').find('img').css('margin-right',0); $('#project-details-right').find('img').each(function(){ projectimgcount ++; $(this).attr('rel',projectimgcount); if(projectimgcount == 3){ $(this).css('margin-right',0); } if(projectimgcount == 4 || projectimgcount == 5 || projectimgcount == 6){ $(this).css('margin-bottom',0); } }) $('#project-details-left dd:last').css('padding-bottom','0') var pdright = $('#project-details-right').height()+22; var pdleft = $('#project-details-left').height()+22; if(pdright > pdleft) { $('#project-details-left').css('height',pdright-22) $('#project-details').css('height',pdright) } else { $('#project-details-right').css('height',pdleft-22) $('#project-details').css('height',pdleft) } $('#sidebar ul:first li:last').css('padding-bottom','1px'); if($('#image-slideshow img').length > 1){ $('#image-slideshow').find('img:first').addClass('active'); $('#image-slideshow').find('img:not(:first)').fadeOut(); setInterval(function(){ var $active = $('#image-slideshow .active'); var $next = ($('#image-slideshow .active').next().length > 0) ? $('#image-slideshow .active').next() : $('#image-slideshow img:first'); $active.fadeOut(1000) $active.removeClass('active'); $next.fadeIn(1000).addClass('active'); }, 5000); } $('#sidebar:not(.projects-sidebar) #sidebar-bg').find('a').each(function(){ if($(this).parent().find('ul').length){ } else { } }) $("a[rel^='prettyPhoto']").prettyPhoto({overlay_gallery: false,animationSpeed:'slow',theme:'dark_square'}); if($('.individual-projects').length == 0){ // if($('.index #header-image-source').length){ // var projectsheader = $('#header-image-source').text(); // $('#header #feature').css('background','url('+projectsheader+')'); // } // $('.delete-this #header-project-link').remove(); // if($('#main-content #header-project-source-single').length){ // var projectsheader = $('#main-content #header-project-source-single').text(); // $('#header #feature').css('background','url('+projectsheader+')'); // } else if($('#header-project-source').length){ // var projectsheader = $('#header-project-source').text(); // $('#header #feature').css('background','url('+projectsheader+')'); // } $('#feature').find('.feature-item:first').css('display','block').addClass('active'); $('#feature').find('.feature-item:not(:first)').css('display','none'); setInterval(function(){ var $active = $('#feature .active'); var $next = ($('#feature .active').next().length > 0) ? $('#feature .active').next() : $('#feature .feature-item:first'); // if($.browser.msie && parseInt($.browser.version) <= 8){ // $active.css('display','none').removeClass('active'); // $next.css('display','block').addClass('active'); // } else { $active.fadeOut(1000) $active.removeClass('active'); $next.fadeIn(1000).addClass('active'); $next.find('#header-project-link').each(function(){ var left = $(this).find('#header-project-left').height(); var right = $(this).find('#header-project-right').height(); if(left > right){ $(this).find('#header-project-right').css('height',left); } else { $(this).find('#header-project-left').css('height',right); } }) // } }, 10000); $(this).find('#header-project-link:first').each(function(){ var left = $(this).find('#header-project-left').height(); var right = $(this).find('#header-project-right').height(); if(left > right){ $(this).find('#header-project-right').css('height',left); } else { $(this).find('#header-project-left').css('height',right); } }) // $('#feature-overlay').find('a:first').addClass('active'); // $('#feature-overlay').find('a:not(:first)').fadeOut(); // setInterval(function(){ // var $active = $('#feature-overlay .active'); // var $next = ($('#feature-overlay .active').next().length > 0) ? $('#feature-overlay .active').next() : $('#feature-overlay a:first'); // $active.fadeOut(1000) // $active.removeClass('active'); // $next.fadeIn(1000).addClass('active'); // }, 5000); } else { if($('#main-content #header-project-source-single').length){ var projectsheader = $('#main-content #header-project-source-single').text(); $('#header #feature').css('background','url('+projectsheader+')'); } } $("form#search-fields").submit(function() { if ($("input#search-client").val() == "Client") { $("input#search-client").val(""); } }); // $('#map_wrapper').find("search_items").ready(function(){ // if($(this).find(".project_client").html() != ""){ // project_client = jQuery.trim($(this).find(".project_client").html()); // $("input#search-client").val(project_client); // } // if($(this).find(".project_state").html() != ""){ // project_state = jQuery.trim($(this).find(".project_client").html()); // $("input#search-state").val(project_state); // } // }); if($('.projects').length && $('.individual-projects').length == 0){ $(this).find('.search_results:first').each(function(){ $(this).addClass('table_header_row'); }) $(this).find('.search_results tr').each(function(){ var tdcount = 1; $(this).find('td').each(function(){ $(this).addClass('results_td_'+tdcount); tdcount ++; }) var thcount = 1; $(this).find('th').each(function(){ $(this).addClass('results_td_'+thcount); thcount ++; }) }) var count = 0; $('#map_wrapper').find('div.projects').each(function(){ if($(this).find('.map-coords').attr('rel') != '' && $(this).find('.map-coords').attr('rel') != '{project_map}'){ count ++; $(this).addClass('hasRel topTen'); var rel = $(this).attr('rel'); var coords = $(this).find('.map-coords').attr('rel'); var coordsSplit = coords.split(','); var left = coordsSplit[0]-66; var top = coordsSplit[1]-144; $(this).css('left',left+'px'); $(this).css('top',top+'px'); } else { $(this).hide(); } }) $('.search_results').find('tr').mouseenter(function(){ $(this).css('color','#fff'); var rel = $(this).attr('class'); $('#map_wrapper').find('div.'+rel).each(function(){ if($(this).hasClass('hasRel notTop')){ $(this).css('z-index',500); $(this).show(); } else if($(this).hasClass('hasRel topTen')){ $(this).css('z-index',500); $(this).find('.map-data').show(); } }) }) $('.search_results').find('tr').mouseleave(function(){ $(this).css('color','#94a7b7'); var rel = $(this).attr('class'); $('#map_wrapper').find('div.'+rel).each(function(){ if($(this).hasClass('notTop')){ $(this).css('z-index',20); $(this).hide(); } else if($(this).hasClass('topTen')){ $(this).css('z-index',20); $(this).find('.map-data').hide(); } }) }) } if($('#category_id').length){ var id = $('#category_id').attr('class'); var projectscounter = 0; var active = 500; $('.projects-sidebar #sidebar-bg ul:first').find('ul').each(function(){ if($(this).parent().attr('id') == id){ active = projectscounter; } projectscounter ++; }) $('.projects-sidebar #sidebar-bg ul:first').accordion({ autoHeight: false, collapsible:true, active:active }); } else { $('.projects-sidebar #sidebar-bg ul:first').accordion({ autoHeight: false, collapsible:true, active:500 }); } $('.projects-sidebar #sidebar-bg ul:first').find('a').each(function(){ var href=$(this).attr('href'); if(href == window.location.href){ $(this).addClass('currentproject'); $(this).parent().parent().parent().find('a:first').addClass('currentprojectparent'); } }) $('#login #user_session_submit').click(function(){ $('#login-bg').fadeIn('slow'); $('#login-box').fadeIn('slow'); }) $('#login-bg').click(function(){ $('#login-bg').fadeOut('slow'); $('#login-box').fadeOut('slow'); }) if($('.leaders').length){ var numLow = 0; var numHigh = 9; var adjustedHigh = (parseFloat(numHigh) - parseFloat(numLow)) + 1; $(this).find('.leaders').each(function(){ var rdmbg = Math.floor(Math.random()*adjustedHigh) + parseFloat(numLow); $(this).css('background','url("http://badge.net.au/images/uploads/site/leaderbg_'+rdmbg+'.jpg") white'); var href = $(this).attr('href').replace('#',''); var col = $(document).find('div.'+href).css('background'); var bw = $(this).find('span').css('background'); $(this).mouseenter(function(){ $(this).find('span').css('background',col); }) $(this).mouseleave(function(){ $(this).find('span').css('background',bw); }) }) } $(this).find('.here.sub_level_0').each(function(){ if($(this).find('ul').length == 0){ $(this).find('a:first').css('background','#8996A0 url(http://badge.net.au/images/uploads/site/sidebar-closed.png) no-repeat 0% 50%') } }) var projectcount = 0; var pagecount = 1; $('#search-results-list').find('a').each(function(){ $(this).css('display','block'); projectcount ++; $(this).addClass('page_'+pagecount); if(projectcount == 1){ $(this).addClass('first'); } else if (projectcount == 10){ $(this).addClass('last'); projectcount = 0; pagecount ++; } $(this).hide(); }) $('#search-results-list').find('a.page_1').fadeIn('slow'); $('#prevpage').hide(); if(pagecount == 1){ $('#results-nav').hide(); } var currentpage = 1; $('#pages').text(currentpage+' of '+pagecount); $('#nextpage').click(function(){ $('#prevpage').show(); if(currentpage <= pagecount){ $('#search-results-list').css('height',$('#search-results-list').height()); $('#search-results-list').find('a.page_'+currentpage).hide(); currentpage ++; $('#search-results-list').find('a.page_'+currentpage).fadeIn('slow'); $('#search-results-list').css('height','auto'); $('#pages').text(currentpage+' of '+pagecount); } if(currentpage == pagecount){ $('#nextpage').hide(); } else { $('#nextpage').show(); } }) $('#prevpage').click(function(){ $('#nextpage').show(); if(currentpage >= 1){ $('#search-results-list').css('height',$('#search-results-list').height()); $('#search-results-list').find('a.page_'+currentpage).hide(); currentpage --; $('#search-results-list').find('a.page_'+currentpage).fadeIn('slow'); $('#search-results-list').css('height','auto'); $('#pages').text(currentpage+' of '+pagecount); } if(currentpage == 1){ $('#prevpage').hide(); } else { $('#prevpage').show(); } }) $('#search-fields input').focus(function(){ if($(this).attr('rel') == $(this).attr('value')){ currentsignupvalue = $(this).attr('value'); $(this).attr('value',''); } }) $('#search-fields input').blur(function(){ if($(this).attr('value') == '') $(this).attr('value',$(this).attr('rel')); }) if($('#search-results-list a').length == 0){ $('#search-results-list').html('

No projects found
'); } $('#footer ul li:last a').css('border','none'); if($('#results-anchor').length){ window.location = window.location.href+'#results-anchor'; } });