//Stretch 'RightContent' div to fill the remaining height
        window.onresize = ResizeToFit;
        window.onload = window.onresize;

        function ResizeToFit() {
        	var right_element = document.getElementById('RightContent');
        	var height = parseInt(right_element.offsetHeight);
        	if (height < (GetHeight() - 40)) {
        		right_element.style.height = (GetHeight() - 40) + 'px';
        	}
        }

        function ChangeLink() {
        	$('#blue').addClass('over');
        	$('#switch').addClass('over');
        }

        function ChangeLinkOut() {
        	$('#blue').removeClass('over');
        	$('#switch').removeClass('over');
        }

        function GetWidth() {
            var x = 0;
            if (self.innerHeight) {
                x = self.innerWidth;
            }
            else if (document.documentElement && document.documentElement.clientHeight) {
                x = document.documentElement.clientWidth;
            }
            else if (document.body) {
                x = document.body.clientWidth;
            }
            return x;
        }

        function GetHeight() {
            var y = 0;
            if (self.innerHeight) {
                y = self.innerHeight;
            }
            else if (document.documentElement && document.documentElement.clientHeight) {
                y = document.documentElement.clientHeight;
            }
            else if (document.body) {
                y = document.body.clientHeight;
            }
            return y;
        }

        var down = false;
        function AnimateClientLogin() {
            if (!down) {
                $('.ClientLogin').animate({ top: '0px' }, 700);
                down = true;
            }
            else {
                $('.ClientLogin').animate({ top: '-150px' }, 700);
                down = false;
            }
           }

           function RotateSlideshow(id, img_array) {
           	    var random = Math.floor(Math.random() * img_array.length);

           	    $('#' + id).css('opacity', 0);
           	    $('#' + id).attr('src', img_array[random]);

           	    //"Center" image vertically
           	    height = parseInt($('#' + id).css('height'));
								
				if(!$.browser.msie){
					new_height = (110 - height) / 2;
					$('#' + id).css('top', new_height);
				}

				$('#' + id).animate({ opacity: 1 }, 500);
           }
           
           function StartPressSlideShow() {
           	    var img_to_change = 2;
           	    var now = new Date();

           	    window.onload = function() {
           		    setInterval(function() {
           			    new_img = Math.round(Math.random(now.getSeconds() * img_to_change) * 2);

           			    while (new_img == img_to_change) {
           			    	new_img = Math.round(Math.random(now.getSeconds() * img_to_change) * 2);
           			    }

           			    img_to_change = new_img;

           			    RotateSlideshow('img' + img_to_change, imgs);
           		    }, 3000);
           	    }
           }


	company_ids = new Array("company", "joint", "development", "asset", "leasing");

	function ChangeAllOff(){
		for(i = 0; i < company_ids.length; i++){
   			$('#' + company_ids[i]).attr("src",'images/company/' + company_ids[i] + '.png');
			$('#' + company_ids[i] + "_text").css("display", "none");
		}
	}

	function ChangeOn(id){
		ChangeAllOff();
		$('#' + id).attr("src",'images/company/' + id + '-on.png');
		$('#' + id + "_text").css("display", "block");
	}

	