
function openCenterWin(url, windowname, width, height)
{
    var left = (screen.width - width) /2;
    var top = (screen.height - height) / 2;
    
	var settings  = 'height=' + height + ',';
	settings += 'width='+ width + ',';
	settings += 'top=' + top + ',';
	settings += 'left='+ left + ',';
	settings += 'scrollbars=yes,toolbar=no,resizable=yes';
	
	win = window.open(url, windowname, settings);
	
	if(parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();  
    }
}

function trapKeyDown(buttonId)
{
	var button = document.getElementById(buttonId);
	
	if (event.keyCode == 13)
	{ 
		event.returnValue=false;
		event.cancel = true;
		button.click();
	} 
}


function decryptHrefEmail(encrypted)
{
    parent.location = decrypt(encrypted);
}
function decryptTextEmail(encrypted)
{
    document.write(decrypt(encrypted));
}
function decrypt (encrypted)
{
    var allChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_@: ";
                    
    var plainText = "";
    for (i = 0; i < encrypted.length; i++)
    {
        var encryptedChar = encrypted.charAt(i);
        var index = allChars.indexOf(encryptedChar)
        if (index == -1)
        {
            decryptedChar = encryptedChar;
        }
        else
        {
            decryptedChar = allChars.charAt((index + 10) % allChars.length);
        }
        plainText += decryptedChar;
    }
    return plainText;
}
 
function popWin(href)
{
  var width = parseInt(screen.availWidth * .8);
  var height = parseInt(screen.availHeight * .8);
  var x = parseInt((screen.availWidth/2) - (width/2));
  var y = parseInt((screen.availHeight/2) - (height/2));
  var windowFeatures = "width=" + width + ",height=" + height + ",left=" + x +",screenX=" + x +",top=" + y + ",screenY=" + y;
  var openWindow = this.open(href, "Popup", windowFeatures);
}

function Toggle (sObj) {
    var cnt = 0;
    var mnu = document.getElementById('_ctl0_cphContent_ucSideMenu_rptLiLeftMenu__ctl' + cnt + '_R' + cnt);
    while ( mnu != null )
    {
        mnu.style.display = 'none';
        cnt++;
        mnu = document.getElementById('_ctl0_cphContent_ucSideMenu_rptLiLeftMenu__ctl' + cnt + '_R' + cnt);
    }
    
	obj = document.getElementById(sObj).style;
	if (obj.display == '') {
		obj.display = 'none';
	} else {
		obj.display = '';
	}
}

function ToggleWeightOver(sObj)
{
    var mnu = document.getElementById(sObj);

    if ( mnu != null && mnu.style.textDecoration != 'underline')
    {
        mnu.style.textDecoration = 'underline';
    }
}

function ToggleWeightOut(sObj){
    var mnu = document.getElementById(sObj);

    if ( mnu != null && sObj != currentnodelink)
    {
        mnu.style.textDecoration = 'none';
    }
}

function showAAALogo() {
    setTimeout("displayAAA();", 1000);
}

function displayAAA() {
    var aaa = document.getElementById("aaa");
    aaa.style.display = "block";
}

function showNewsletterForm(lang) {
	window.open("/NewsletterForm_" + lang + ".aspx",'nlwin','width=404,height=418,scrollbars=0,status=0,menubar=0,resizable=0,location=0');
}
