function openPopup(url, windowName, width, height)
{
    stopPlayer();

    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,scrollbars,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    var myWindow = window.open(url, windowName, windowFeatures);
    myWindow.focus();
}

//'domObjectType' param (boolean) to pass objects directly along with strings
//'collapse' param the collapsible object
//'trigger' param the trigger for that collapsible object
//'' param the actual MooTools slide object
function toggleMoreInfoDiv(strDivId, domObjectType, collapse, trigger, slideObject)
{
	if (domObjectType == true)
	{
		var objDiv = collapse;
	    var elImg = trigger.getElementsByTagName('img')[0].src;
	}else{
    	var objDiv = eval(strDivId + 'Div');
		var elImg = $(strDivId + 'Icon').src;
	}
	
    var imgExpand = strBaseHref + 'assets/' + strLanguage + '/images/icon-expand.gif';
    var imgCollapse = strBaseHref + 'assets/' + strLanguage + '/images/icon-collapse.gif';
    //var elImg = $(strDivId + 'Icon').src;
    if (elImg == imgExpand) {
		//Filter according to domObject type param (again to avoid the id scheme)
		if (domObjectType == true)
		{
        	trigger.getElementsByTagName('img')[0].src = imgCollapse;
		}else{
			$(strDivId + 'Icon').src = imgCollapse;
		}
    } else {
		//Filter according to domObject type param (again to avoid the id scheme)
		if (domObjectType == true)
		{
        	trigger.getElementsByTagName('img')[0].src = imgExpand;
		}else{
			$(strDivId + 'Icon').src = imgExpand;
		}
    }
    
	//Again, filter depending on scheme used
	if (domObjectType == true)
	{
		slideObject.toggle();
	}else{
		objDiv.toggle();
	}
}

function openFlashStatement()
{
    stopPlayer();

    return openPopup(strBaseHref + strLanguage + '/myaccount/mystatement/', 'popupMyStatement', 815, 620);
}

function openCalculator()
{
    stopPlayer();

    var day = new Date();
    return openPopup(strBaseHref + strLanguage + '/calculate/?' + day.getTime(), 'popupCalculator', 965, 655);
}

function openLink(link)
{
    return window.location.href = link ;
}
