
function set_services_position() {

    var parHeight = jQuery("#header-services").height();
    if (parHeight < 60) {
        var margintop = 64;
        var line = 19;
        var margin = margintop + line;
        jQuery("#header-services").css('margin-top', margin + 'px');
    }
    else {
        jQuery("#header-services .items").each(function() {
            var chHeight = jQuery(this).height();
            var parHeight = jQuery("#header-services").height();

            if (chHeight < parHeight) {
                var offset = parHeight - chHeight;
                jQuery(this).css('margin-top', offset + 'px');
            }
        });
    }
}


jQuery(document).ready(function() {

    set_services_position();

    jQuery("#promo-right-box .left, #promo-right-box .right, #nav-top-sites .last").hover(
  	function() {
  	    jQuery(this).addClass('hover');
  	},
    function() {
        jQuery(this).removeClass('hover');
    }
	);

    jQuery("#header-services ul li").hover(
  	function() {
  	    if (jQuery(this).hasClass('infinity')) {
  	        jQuery(this).addClass('infinity-hover');
  	    }
  	    else {
  	        jQuery(this).addClass('hover');
  	    }
  	},
    function() {
        if (jQuery(this).hasClass('infinity')) {
            jQuery(this).removeClass('infinity-hover');
        }
        else {
            jQuery(this).removeClass('hover');
        }
    }
	);



    jQuery("#nav-top-regions, #top-regions").hover(
  	function() {
  	    var parentOffset = jQuery("#nav-top-regions").offset();
  	    var parentWidth = jQuery("#nav-top-regions").width();
  	    var childWidth = jQuery("#top-regions").width();
  	    var childOffset = parentOffset.left + parentWidth - childWidth - 1;
  	    jQuery("#top-regions").css('top', '34px');
  	    jQuery("#top-regions").css('left', childOffset + 'px');
  	    jQuery("#top-regions").css('display', 'block').fadeIn("slow");
  	    //jQuery("#top-regions").fadeIn("slow");
  	},
    function() {
        jQuery("#top-regions").css('display', 'none');
    }
  );


    jQuery("#panel-drop-down, #panel-drop-down-content").hover(
  	function() {
  	    jQuery("#panel-drop-down-content").css('display', 'block');
  	},
    function() {
        jQuery("#panel-drop-down-content").css('display', 'none');
    }
  );


    jQuery("#left-column-business-2 ul li.colored, #left-column-2 ul li.colored").hover(
  	function() {
  	    jQuery(this).addClass('hover');
  	},
    function() {
        jQuery(this).removeClass('hover');
    }
  );





});

