var MEMBERS_FILE = "/ERT/Xml/Members.xml";
var KEY_MESSAGE_FILE = "/ERT/Xml/WebItems.xml";
var NEWS_FILE = "/ERT/Xml/WebItemsNews.xml";
var DOCS_DIR = "/ERT/Docs";

var OFFLINE = false;

$(document).ready(function () {
	    //$('<div>test</div>').appendTo($("#SiteNoteBlocContent_Header"));
	    $('<ul><li><a href="https://www.myert.eu/irj/ert">Members\' Portal</a></li></ul>').appendTo(".siteNote-Menu");
	});

$("#PrintPage").live('click', function (event) { window.print(); });
	
function HideRightColumn() {
    $("#RightColumn").hide();
    $("#CenterColumn")[0].style.width = "760px";
   // $("#Content")[0].style.width = "760px";
}

function getUrlVars() {
    var vars = [], hash;
    var url = window.location.href;
    var qmPos = url.indexOf('?');
    var hashPos = url.indexOf('#');
	
    var hashString = hashPos > 0 ? 
		window.location.href.substring(qmPos + 1, hashPos) :
		window.location.href.substring(qmPos + 1) ;
    
    var hashes = hashString.split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

function ScrollToElement(elementId)
{
	if ($("#"+elementId).length == 0) return;

	//get the top offset of the target anchor
	var target_offset = $("#"+elementId).offset();
	var target_top = target_offset.top - 50;
	//goto that anchor by setting the body scroll top to anchor top
	$('html, body').animate({scrollTop:target_top}, 1500);
}

function BalanceColumns()
{
	var centerHeight = $("#CenterColumn").height();
	var rightHeight = $("#RightColumn").height();
	
	//alert("Heights: " + centerHeight + " / " + rightHeight);
	if (rightHeight > centerHeight)
	{
		$("#CenterColumn").height(rightHeight + 120);
	}
	
}



