﻿jQuery.noConflict();

var GoogleSearchQuery,
        GoogleSearchURL,
        GoogleSearchStart;

jQuery(document).ready(function () {
    jQuery(document).pngFix();

    jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activeparentmenu ul").wrap("<div />");
    jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activeparentmenu ul").parent().append("<ul id='te_leftmenu_bedrijven_secondPart' />");
    var itemLength = jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activeparentmenu ul li").length;
    var split = Math.ceil(itemLength / 2);
    var itemsToMove = jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activeparentmenu ul li:gt(" + (split - 1) + ")");
    jQuery("#te_leftmenu_bedrijven_secondPart").append(itemsToMove);

    jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activemenu ul").wrap("<div />");
    jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activemenu ul").parent().append("<ul id='te_leftmenu_bedrijven_secondPart' />");
    var itemLength = jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activemenu ul li").length;
    var split = Math.ceil(itemLength / 2);
    var itemsToMove = jQuery("#te_leftmenu_bedrijven li.activeparentmenu li.activemenu ul li:gt(" + (split - 1) + ")");
    jQuery("#te_leftmenu_bedrijven_secondPart").append(itemsToMove);
    if (split % 2 == 0) {
        jQuery("#te_leftmenu_bedrijven_secondPart").append('<li><a href="#"><span class="left_spacer"></span><span class="middle_spacer">&nbsp;</span><span class="right_spacer"></span></a></li>');
    }

    //Company Menu
    //jQuery(".companyMenu li ul").wrap("<div />");
    //jQuery(".companyMenu li ul").parent().append("<ul class='companyMenu_secondPart' />");
    //jQuery(".companyMenu li ul").parent().append("<div class='companyMenu_bottomLine'></div>");
    /*var itemLength = jQuery(".companyMenu li ul li").length;
    var split = Math.ceil(itemLength / 2);
    var itemsToMove = jQuery(".companyMenu li ul li:gt(" + (split - 1) + ")");
    jQuery(".companyMenu_secondPart").append(itemsToMove);
    if (split % 2 == 0) {
    jQuery(".companyMenu_secondPart").append('<li><a href="#"><span class="left_spacer"></span><span class="middle_spacer">&nbsp;</span><span class="right_spacer"></span></a></li>');
    }*/

    //Companymodule height of 3 grey elements
    jQuery(".companyDetails .companyResearch").each(function () {
        var currentTallest = 0;
        jQuery(this).find(".companyColoredTable").each(function () {
            if (jQuery(this).height() > currentTallest) {
                currentTallest = jQuery(this).height();
            }
        });
        jQuery(this).find(".companyColoredTable").css({ height: currentTallest });
    });

    //Companymodule size of logo in leftpane
    var logoImageWidth = jQuery(".companyDetails .companyInformation .companyContact img").width();
    if (logoImageWidth > 225) {
        jQuery(".companyDetails .companyInformation .companyContact img").css({ width: 225 });
    }


    jQuery("#te_breadcrumb a.SkinObject:last").css("font-weight", "bold").css("text-decoration", "none");

    /*jQuery('#te_menu ul li:not(#te_menu ul li ul li)').each(function () {
    var MenuTitle = jQuery(this).find('span.middle_spacer:not(#te_menu ul li ul li span.middle_spacer)').text();
    var MenuHref = jQuery(this).find('a:not(#te_menu ul li ul li a)').attr('href');
    var SubMenu = jQuery(this).find("ul");
    SubMenu.prepend('<li class="SubMenuItemTitle"><a href="' + MenuHref + '">' + MenuTitle + '</a></li>');
    });*/

    if (jQuery('#te_leftmenu li.activemenu li').length != 0 || jQuery('#te_leftmenu li.activeparentmenu li').length != 0) {
        jQuery("#te_leftmenu ul.menuvertical").append("<li class=\"last-item\"><span class=\"menubottomleft\"></span><span class=\"menubottomright\"></span></li>");
        jQuery('#te_leftmenu #te_pagename').css({ display: 'block' });
        jQuery("#te_leftmenu").css({ 'margin-bottom': '15px' });
    }

    jQuery('#te_content a.call_action').each(function () {
        var CallAction = jQuery(this).text();
        jQuery(this).html('<span class="call_action_left">&nbsp;</span><span class="call_action_middle">' + CallAction + '</span><span class="call_action_right">&nbsp;</span>');
    });

    setTimeout(startCarousel, 200);
    setTimeout(initBannerRotator, 200);

    GoogleSearchLoadFromHash();

    jQuery('#GoogleSearchForm #GoogleSearchSubmitButton').click(function () {
        var q = jQuery('#GoogleSearchQ').val();
        var url = jQuery('#GoogleSearchURL').val();
        var page = jQuery('#GoogleSearchPage').val() != undefined ? jQuery('#GoogleSearchPage').val() : '/Search.aspx';
        window.location.href = page + '#q=' + escape(q) + '&url=' + escape(url);
        return false;
    });

    jQuery('#GoogleSearchForm #GoogleSearchQ').keypress(function (e) {
        var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;

        if (keyCode == 13) {
            var q = jQuery('#GoogleSearchQ').val();
            var url = jQuery('#GoogleSearchURL').val();
            var page = jQuery('#GoogleSearchPage').val() != undefined ? jQuery('#GoogleSearchPage').val() : '/Search.aspx';

            window.location.href = page + '#q=' + escape(q) + '&url=' + escape(url);

            return false;
        } else {
            return true;
        }
    });

    if (jQuery('#te_banner_rotator').length) {
        TEBannerRotatorInit();
        TEBuildBannerNavigation();
        TEPositionBannerNavigation();
    }

    jQuery('#te_banner_rotator').css({ 'background': 'url(/Portals/_default/Skins/te_newdesign/images/background_black.png)' });
    if (jQuery('#te_banner_rotator').hasClass('te_banner_rotator_small')) {
        jQuery('#te_banner_rotator').css({ 'background': 'url(/Portals/_default/Skins/te_newdesign/images/background_sand.png)' });
    }
    if (jQuery('#te_banner_rotator').hasClass('te_banner_large_sand')) {
        jQuery('#te_banner_rotator').css({ 'background': 'url(/Portals/_default/Skins/te_newdesign/images/background_large_sand.png)' });
    }

    jQuery('.RotatorDefault p:first').addClass('te_rotator_quote');
    jQuery('.RotatorDefault p:last').addClass('te_rotator_name');
    jQuery('.RotatorDefault p.te_rotator_quote').prepend("<img src=\"/Portals/_default/Skins/te_newdesign/images/quotes-left.png\" class=\"te_rotator_quote_left\" border=\"0\" />");
    jQuery('.RotatorDefault p.te_rotator_quote').append("<img src=\"/Portals/_default/Skins/te_newdesign/images/quotes-right.png\" class=\"te_rotator_quote_right\" border=\"0\" />");

    jQuery('#TB_closeAjaxWindow a img').live('mouseover mouseout', function (event) {
        if (event.type == 'mouseover') {
            jQuery(this).attr('src', '/Portals/_default/Skins/te_newdesign/images/thickbosCloseButton_hover.png');
        } else {
            jQuery(this).attr('src', '/Portals/_default/Skins/te_newdesign/images/thickbosCloseButton.png');
        }
    });

    setTimeout(startEmployersHeader, 300);
});

function startEmployersHeader() {
    employersHeader.init(jQuery('#te_employers_header'));
}

var startCarousel = function () {

    jQuery(".logoList").each(function () {
        var htmlPath = jQuery(this).text();
        if (htmlPath != '') {
            jQuery(this).load(htmlPath, function () {
                jQuery(this).show();
                var CarouselRandomStart = Math.floor(Math.random() * (jQuery('#mycarousel li').length + 1));

                jQuery('#mycarousel').jcarousel({
                    wrap: 'circular',
                    scroll: 3,
                    visible: 6,
                    auto: 3,
                    animation: 'slow',
                    initCallback: mycarousel_initCallback,
                    start: CarouselRandomStart
                });
				var blackAndWhiteImg,
					colorImg;
                jQuery('.jcarousel-item a').hover(function () {
                    oldBlackAndWhiteImg = blackAndWhiteImg;
                    blackAndWhiteImg = jQuery(this).find('img:eq(0)').attr('src');
                    if (blackAndWhiteImg != colorImg) {
                        colorImg = jQuery(this).find('img:eq(1)').attr('src');
                        jQuery(this).find('img:eq(0)').attr('src', colorImg);
                    }
                    else {
                        blackAndWhiteImg = oldBlackAndWhiteImg;
                    }
                },
            function () {
                jQuery(this).find('img:eq(0)').attr('src', blackAndWhiteImg);
            });
            });
        }
    });
}

var initBannerRotator = function () {
    jQuery('#te_banner_rotator').css('visibility', 'visible');
};

jQuery(window).load(function () {
    if (jQuery('#te_banner_rotator').length != 0) {
        TEBannerRotatorInit();
        TEPositionBannerNavigation();
    }
    jQuery('#te_leftmenu').find('br').hide();
    /*var companyMenuBottomLineTop = jQuery('.companyMenu > div > ul > li > div > ul').height() + (jQuery.browser.msie ? 5 : 18);
    jQuery('.companyMenu_bottomLine').css({top: companyMenuBottomLineTop + 'px'});
    if (jQuery.browser.msie)
		jQuery('.companyMenu_bottomLine').css({left: '-3px'});*/

    companyModule2012.init();
});

var timer, // Variabele voor de timer, niet wijzigen
	timerTimeout = 6000, // Weergave tijd banner in milliseconden
	dxHoofd = 650, // Afstand hoofd vanaf linkerrand van de banner in px
	dyHoofd = 38, // Stukje hoofd wat boven de banner uitsteekt in px
	wBannerNavigation = 70, // Breedte van het balletjes dingetje
	fadeInSpeed = 'fast',
	fadeOutSpeed = 'fast',
    TEVimeoCache, // Variabele om de request van Vimeo in op te slaan
    TEVimeoUrl = 'http://www.vimeo.com/IDVimeo', // URL van de video, "id" wordt gereplacet met het title attribuut van de div #embed
    TEVimeoCallback = 'TEEmbedVideo', // Functie die wordt uitgevoerd na de request van Vimeo
    TEVimeoEndpoint = 'http://www.vimeo.com/api/oembed.json', // Vimeo request file
    TEVimeoUrl = TEVimeoEndpoint + '?url=' + encodeURIComponent(TEVimeoUrl) + '&callback=' + TEVimeoCallback + '&height=225&autoplay=1', // Request URI
	TEVimeoElement = '#Vimeo',
    TEBannerWidth = 960,
    TEBannerItemWidth = 940;

TEBannerNavigationImages = new Array();
TEBannerNavigationImages[0] = '/Portals/_default/Skins/te_newdesign/images/dot_red.png';
TEBannerNavigationImages[1] = '/Portals/_default/Skins/te_newdesign/images/dot_grey.png';

function TEBannerRotatorInit() {
	TEBannerWidth = jQuery('#te_banner_rotator').hasClass('te_banner_rotator_small') ? 630 : 960;
	TEBannerItemWidth = TEBannerWidth - 20;

	dxHoofd = jQuery('#te_banner_rotator').hasClass('te_banner_rotator_small') ? 340 : dxHoofd;

	TEBannerNavigationImages[1] = jQuery('#te_banner_rotator').hasClass('te_banner_rotator_small') || jQuery('#te_banner_rotator').hasClass('te_banner_large_sand') ? '/Portals/_default/Skins/te_newdesign/images/dot_darkgrey.png' : TEBannerNavigationImages[1]; 

}

function TEPositionHoofd(e) {
    e.each(function () {
        var TEHoofd = jQuery(this).find('.te_banner_hoofd');
        if (TEHoofd.length == 1) {
            var oTEBanner = jQuery('#te_banner_rotator').offset();

            var xTEHoofd = oTEBanner.left + dxHoofd;
            var yTEHoofd = oTEBanner.top - dyHoofd;

            TEHoofd.css({
                top: yTEHoofd + 'px',
                left: xTEHoofd + 'px'
            });

            jQuery(this).find('.te_banner_content').width((dxHoofd - 10) + 'px');
        }
    });
}


function TEPositionBannerNavigation() {
    if (jQuery('#te_banner_navigation').length == 1) {
        var TEBannerNavigation = jQuery('#te_banner_navigation'),
        oTEBanner = jQuery('#te_banner_rotator').offset();

        var xTEBannerNavigation = oTEBanner.left + (jQuery('#te_banner_rotator').width() - wBannerNavigation),
        yTEBannerNavigation = oTEBanner.top;

        TEBannerNavigation.css({
            top: yTEBannerNavigation + 'px',
            left: xTEBannerNavigation + 'px'
        });
    }
}

function TEBuildBannerNavigation() {
	var TEBannerNavigation;
	var TERotator = jQuery('#te_banner_rotator');
	var TEBanners = jQuery('.te_banner_item', TERotator);
	var TEBannerNavigation = '';
	var TEActiveBanner;

	for (var i = 0; i < TEBanners.length; i++) {
		TEBannerNavigation +=
            '<li' + (i == 0 ? ' class="current"' : '') + '>'
            + '<a href="javascript:TEShowBanner(' + i + ');">'
            + '<img src="' + TEBannerNavigationImages[jQuery('#te_banner_rotator div').index('.te_banner_item.active') == i ? 0 : 1] + '" alt="" />'
            + '</a>'
            + '</li>';

		TEActiveBanner = jQuery('#te_banner_rotator div').index('.te_banner_item.active') == i ? i : TEActiveBanner;
	}

	TEPositionHoofd(jQuery('.te_banner_item:eq(' + TEActiveBanner + ')'));
	TEPlayBanner(jQuery('.te_banner_item:eq(' + TEActiveBanner + ')'));

	jQuery('#te_banner_navigation').prepend(TEBannerNavigation);
}

function TEShowBanner(next) {
	clearTimeout(timer);

	var jQueryactive = jQuery(".te_banner_item.active");
	var jQuerynext = jQuery(".te_banner_item:eq(" + next + ")");

	var jQueryliActive = jQuery('#te_banner_navigation li.current');
	var jQueryliNext = jQuery('#te_banner_navigation li:eq(' + next + ')');

	jQueryliActive.removeClass('current');
	jQueryliActive.find('img').attr('src', TEBannerNavigationImages[1]);
	jQueryliNext.addClass('current');
	jQueryliNext.find('img').attr('src', TEBannerNavigationImages[0]);

	jQueryactive.fadeOut(fadeOutSpeed, function () {
		jQuery(this).addClass('notactive').removeClass('active');
		jQuerynext.fadeIn(fadeInSpeed, function () {
			jQuery(this).removeClass('notactive').addClass('active');
		});
	});

	TEPositionHoofd(jQuerynext);
	TEPlayBanner(jQuerynext);
	TEVimeoInit();
}

function TEPlayBanner(current) {
	var jQuerycurrent = current;
	var jQuerynext = jQuerycurrent.next().length ? jQuerycurrent.next() : jQuery('.te_banner_item:first');

	var NextIndex = jQuery('.te_banner_item').index(jQuerynext);

	timer = setTimeout('TEShowBanner(' + NextIndex + ')', timerTimeout);
}

function TEEmbedVideo(video) {
	TEVimeoCache = video;
	jQuery(TEVimeoElement).html('<a href="javascript:TEVimeoShowVideo();"><img src="' + video.thumbnail_url + '" alt="' + video.title + '" height="225" /></a>');
}

function TEVimeoShowVideo() {
	jQuery(TEVimeoElement).html(unescape(TEVimeoCache.html));
	clearTimeout(timer);
}

function TEVimeoInit() {
	TEVimeoUrl = TEVimeoUrl.replace('IDVimeo', jQuery(TEVimeoElement).attr('title'));
	var js = document.createElement('script');
	js.setAttribute('type', 'text/javascript');
	js.setAttribute('src', TEVimeoUrl);
	jQuery('head').append(js);
}

function mycarousel_initCallback(carousel) {
	// Disable autoscrolling if the user clicks the prev or next button.
	carousel.buttonNext.bind('click', function () {
		carousel.startAuto(0);
	});

	carousel.buttonPrev.bind('click', function () {
		carousel.startAuto(0);
	});

	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function () {
		carousel.stopAuto();
	}, function () {
		carousel.startAuto();
	});
};

function GoogleSearchLoadFromHash() {
    var GoogleSearchRequest = window.location.hash.split('&');

    GoogleSearchStart = 0;

    for (i = 0; i < GoogleSearchRequest.length; i++) {
        var item = GoogleSearchRequest[i].split('=');
        item[0] = item[0].replace('#', '');
        item[1] = decodeURI(item[1]);

        if (item[0] == 'q') {
            if (item[1] == GoogleSearchQuery) {
                return false;
            }
            GoogleSearchQuery = item[1];
        }

        if (item[0] == 'url') {
            GoogleSearchURL = item[1];
        }

        if (item[0] == 'start') {
            GoogleSearchStart = parseInt(item[1]);
        }
    }

    if (GoogleSearchQuery != undefined) {
        setInterval(GoogleSearchLoadFromHash, 100);
        GoogleSearch(GoogleSearchQuery, GoogleSearchURL, GoogleSearchStart);
    }

    return true;
}

var GoogleSearchReplaceElement = 'GoogleSearchResults',
	GSPreviousText = 'previous',
	GSNextText = 'next',
	GSNoResultsText = 'No results for',
	GSResultCountText = 'results for';

jQuery(document).ready(function () {
	GSNoResultsText = jQuery('#te_google_search_no_results span').html();
	GSResultCountText = jQuery('#te_google_search_results span').html();
	GSPreviousText = jQuery('#te_google_search_previous span').html();
	GSNextText = jQuery('#te_google_search_next span').html();
});

google.load('search', '1');

function GoogleSearch(q, searchUrl, start) {
	jQuery('img.GoogleSearchLoader').show();

	if (start == undefined) start = 0;
	var url = "http://ajax.googleapis.com/ajax/services/search/web?q=site:" + searchUrl + "+" + encodeURIComponent(q) + "&v=1.0&rsz=large&start=" + start;

	window.location.hash = 'start=' + start + '&q=' + encodeURIComponent(q) + '&url=' + encodeURIComponent(searchUrl);

	jQuery('#GoogleSearchForm #GoogleSearchQ').val(q);

	jQueryjQuery = jQuery('#' + GoogleSearchReplaceElement);

	jQuery.getJSON(url + '&callback=?', function (data) {
	    if (data.responseData.results && data.responseData.results.length > 0) {

	        jQueryjQuery.html('');

	        GoogleTrackEvent('Google Search', 'Search', q, data.responseStatus);

	        var results = data.responseData.results;
	        var pages = data.responseData.cursor.pages;

	        jQueryjQuery.append('<p class="GoogleSearchResultCount">' + data.responseData.cursor.estimatedResultCount + ' ' + GSResultCountText + ' <strong>' + q + '</strong></p>');

	        for (var i = 0; i < results.length; i++) {
	            jQueryjQuery.append('<div class="GoogleSearchResult">'
					+ '<p class="GoogleSearchResultTitle"><a href="' + decodeURI(results[i].unescapedUrl) + '">' + decodeURI(results[i].title) + '</a></p>'
					+ '<p class="GoogleSearchResultContent">' + results[i].content + '</p>'
					+ '<p class="GoogleSearchResultLink"><a href="' + decodeURI(results[i].unescapedUrl) + '">' + decodeURI(results[i].unescapedUrl) + '</a></p>'
					+ '</div>');
	        }

	        var data = '<div class="GoogleSearchPages">';
	        for (var i = 0; i < pages.length; i++) {
	            if (start != 0 && i == 0) {
	                data += '<a href="javascript:;" onclick="GoogleSearch(\'' + q + '\', \'' + searchUrl + '\', ' + (start - 8) + ');">' + GSPreviousText + '</a>';
	            }
	            else if (i == 0) {
	                data += '<span class="disabled">' + GSPreviousText + '</span>';
	            }

	            if (start == pages[i].start) {
	                data += '<span class="current">' + pages[i].label + '</span>';
	            }
	            else {
	                data += '<a href="javascript:;" onclick="GoogleSearch(\'' + q + '\', \'' + searchUrl + '\', ' + pages[i].start + ');">' + pages[i].label + '</a>';
	            }

	            if (i + 1 == pages.length && start != pages[i].start) {
	                data += '<a href="javascript:;" onclick="GoogleSearch(\'' + q + '\', \'' + searchUrl + '\', ' + (start + 8) + ');">' + GSNextText + '</a>';
	            }
	            else if (i + 1 == pages.length) {
	                data += '<span class="disabled">' + GSNextText + '</span>';
	            }
	        }
	        data += '</div>';

	        jQueryjQuery.append(data);
	    }
	    else {
	        jQueryjQuery.html('<div class="error" id="GoogleSearchError">' + GSNoResultsText + ' <strong>' + q + '<strong>.</div>');
	    }

	    jQuery('img.GoogleSearchLoader').hide();
	});
}

var employersHeader = {
    e: '',
    init: function (element) {
        if (element.length == 1) {
            this.e = element;
            if (!this.didUserClosePermanently()) {
                this.e.slideDown(500, function () {
                    TEPositionBannerNavigation();
                    TEPositionHoofd(jQuery(".te_banner_item"));
                });
            }
        }
    },
    closePermanently: function () {
        this.e.slideUp();
        TEPositionBannerNavigation();
        jQuery.cookie('EHcp', '1', { expires: 365 });
        GoogleTrackEvent('Employers Header', 'Don\'t show again');
    },
    goToEmployers: function (link, type) {
        GoogleTrackEvent('Employers Header', 'Go to employers', type);
        window.location.href = link;
    },
    didUserClosePermanently: function () {
        if (jQuery.cookie('EHcp') == '1') {
            return true;
        } else {
            return false;
        }
    }
};

jQuery.cookie = function (name, value, options) {
    if (typeof value != 'undefined') {
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString();
        }
        var path = '; path=/';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else {
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};

var GoogleTrackEvent = function (category, action, opt_label, opt_value) {
    if (typeof (pageTracker) !== 'undefined') {
        pageTracker._trackEvent(category, action, opt_label, opt_value);
    }
    else if (typeof (_gaq) !== 'undefined') {
        _gaq.push(['_trackEvent', category, action, opt_label, opt_value]);
    }
    else {
        return false;
    }
};

var companyModule2012 = {
    current: '',
    init: function () {
        if (window.location.hash.replace('#', '').length == 0) {
            var tab = jQuery('#tab-menu2012 a:first-child').attr('href');
            if (typeof (tab) !== 'undefined') {
                window.location.hash = tab;
            }
        }

        companyModule2012.loadFromHash();

        jQuery('#tab-menu2012 a').click(function () {

            window.location.hash = jQuery(this).attr('href');

            GoogleTrackEvent('Company', 'Tab change', window.location.hash.replace('#', ''));

            companyModule2012.loadFromHash();

            return false;
        });

        jQuery('.tooltip').hover(function () {
            jQuery(this).parent().find('.tooltip-text').show();

            var oTooltipLink = jQuery(this).offset();
            var xTooltip = oTooltipLink.left + jQuery(this).width();
            var yTooltip = oTooltipLink.top;

            jQuery('.tooltip-text').css('left', (xTooltip + 25) + 'px');
            jQuery('.tooltip-text').css('top', (yTooltip - 13) + 'px');
        },
        function () {
            jQuery('.tooltip-text').hide();
        });
    },
    loadFromHash: function () {
        jQuery('#center2012 .tab').hide();
        jQuery('#tab-menu2012 a').removeClass('current');
        jQuery('#tab-menu2012 a[href="' + window.location.hash + '"]').addClass('current');
        jQuery('#center2012 .tab[name="' + window.location.hash.replace('#', '') + '"]').show('fast', function () {
            if (window.location.hash.replace('#', '') == 'interviews') {
                companyModule2012.loadInterviewsRotator();
            }
        });
    },
    loadInterviewsRotator: function () {
        jQuery('#interviewsRotator').junaRotator('clearTimer');
        jQuery('#interviewsRotator').junaRotator('init', {
            timeout: 7000,
            navigationPosition: 'bottomLeft',
            width: 622,
            height: 435,
            navigationImageInactive: '/Portals/_default/Skins/te_newdesign/images/company-module-2012-interview-inactive.jpg',
            navigationImageActive: '/Portals/_default/Skins/te_newdesign/images/company-module-2012-interview-active.jpg',
            navigationPosition: 'bottomCenter',
            navigationWidth: 50,
            nextButton: jQuery('#interviews-rotator-wrapper #navigation-right'),
            previousButton: jQuery('#interviews-rotator-wrapper #navigation-left'),
            startRandom: true
        });
    }
};
