$(function(){
	var newsHeight = $('#newsBlock').height();
	var videoHeight = $('#videoBlock').height();
	if (videoHeight > newsHeight)
	{
	    var difference = newsHeight - $('#newsBlock .content').height();
	    $('#newsBlock .content').height(videoHeight - difference);
	}
	else if (newsHeight > videoHeight)
	{
	    var difference = videoHeight - $('#videoBlock .content').height();
	    $('#videoBlock .content').height(newsHeight - difference);
	}
	
	
	
	$.each($(".odd"), function() {
		var oddHeight = $(this).height();
		var evenHeight = $(this).next('.even').height();
		
		if (evenHeight > oddHeight)
		{
			var difference = oddHeight - $(this).children('.content').height();
			$(this).children('.content').height(evenHeight - difference);
		}
		else if (oddHeight > evenHeight)
		{
			var difference = evenHeight - $(this).next('.even').children('.content').height();
			$(this).next('.even').children('.content').height(oddHeight - difference);
		}
	});

});

var existingOnload = window.onload;
window.onload = function()
{
    if (typeof existingOnload == 'function')
    {
         existingOnload();
    }

    setupPopups();
}


function setupPopups()
{
    var map = document.getElementById('Map');
    if (!map)
    {
        return;
    }
    
    var areas = map.getElementsByTagName('area');
    for (var i = 0; i < areas.length; i++)
    {
        areas[i].onclick = function() 
        { 
            return popup( this, 'notes' );  
        }
    }
    
}
var cnt=0;
function popup(mylink, windowname)
{
	cnt++;
    if (!window.focus)
    {
        return true;
    }
    var href = (typeof mylink == 'string') ?  myLink : mylink.href;
    window.open(href, (cnt), 'width=820,height=350,scrollbars=yes' );
    return false;
}


