﻿
$(document).ready(function() {

	// PAGE REDIRECT
	
		$("a[href='http://vhr.dev.webcessity.com.au/contact-us/webmail.aspx']").attr('href', 'https://remote.vhr.com.au/owa/ ')

    // MENU RELATED

    $('#menu ul.tabs li ul').addClass('dropdown');
    $('#menu ul.tabs ul.dropdown ul').removeClass('dropdown');
    $('#navigation').css('overflow', 'visible');

    //$('#menu ul.tabs ul.dropdown ul.big_dropdown').after('<div class="blank">&nbsp;</div>');

    var $kids = $('#menu ul.tabs ul.dropdown li').children('ul');
    $kids.parent().wrap("<div class='big_dropdown'></div>");

    $('.big_dropdown ul').addClass('big_dropdown_ul');

    $('.big_dropdown li a:first-child').addClass('drop_title');
    $('.big_dropdown_ul a').removeClass('drop_title');

    // var $find_dropdown_height = $('.big_dropdown_ul').children().length;
    //var $dropdown_height = ($find_dropdown_height * 33);
    //$('#menu ul.tabs ul.dropdown li').css('height', $dropdown_height);


    // IE 7 Z-INDEX BUG
    //$(function() {
        //if ($.browser.msie) {
           // $('div').each(function(i) {
              //  if ($(this).css('position') != 'absolute') $(this).css('zIndex', 1000 - (i * 10));
            //});
       // }
   // })
    
    //SNIPPETS

		//STAFF SNIPPET

		var image_width = $('._contact_us_our_staff .two_column .image_with_text_align_left img.image').width();
		var image_padding = image_width + 15;
		$('._contact_us_our_staff .two_column .image_with_text_align_left .text').css('margin-left', image_padding);
	
	
        // TESTIMONIAL SNIPPET

        $(".testimonial h2:empty").css('display', 'none');

        // CODE SNIPPET EXPAND / HIDE

        $('#code_snippet span.expand').text('Expand');
        $('#code_snippet span.hide').text('Hide');

        // CODE SNIPPET EXPAND
        $('#code_snippet span.expand').click(function() {
            $('.code_box').slideDown('slow', function() {
                $('#code_snippet span.expand').slideUp('fast', function() {
                    $('#code_snippet span.hide').slideDown('fast');
                });
            });

        });

        // CODE SNIPPET HIDE
        $('#code_snippet span.hide').click(function() {
            $('.code_box').slideUp('slow', function() {
                $('#code_snippet span.hide').slideUp('fast', function() {
                    $('#code_snippet span.expand').slideDown('fast');
                });
            });

        });

        //  search text
        $('.search_text').each(function() {

            //  remove inactive when focused
            $(this).focus(function() {
                $(this).removeClass('search_text_inactive');
                if ($(this).val() == 'Search') {
                    $(this).val('');
                }
            });

            //  add inactive when blurred
            $(this).blur(function() {
                if ($(this).val() == '') {
                    $(this).addClass('search_text_inactive');
                    $(this).val('Search');
                }
            });

        });

});

