function openWindow(add, lang)
{
    var win = window.open("Calculator.aspx?lang=" + lang + "&p=1&f=" + add, "ECP","width=820,height=500,status=no,resizable=0,toolbar=no,menubar=no,scrollbars=no");
}

function openPrivacy(page)
{
    var win = window.open(page, "ECPP","width=433,height=500,status=no,resizable=0,toolbar=no,menubar=no,scrollbars=yes");
}

function print(header, div, outerclass, printtext, closetext)
{
    var a = window. open('','','scrollbars=yes,width=500,height=600');

    a.document.open("text/html");
    a.document.write('<html><head><link rel="stylesheet" href="/include/styles.css" />');
    a.document.write('<!--[if IE]><link rel="stylesheet" type="text/css" href="/include/stylesie.css"><![endif]-->');
    a.document.write('<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="/include/stylesie6.css" /><![endif]-->');
    a.document.write('<link rel="stylesheet" href="/include/print.css" /></head><body><div class="'+outerclass+'">');
    a.document.write('<a href="javascript:;" onclick="window.print();">'+printtext+'</a> / <a href="javascript:;" onclick="window.close();">'+closetext+'</a>');
    a.document.write('<h1>'+header+'</h1><hr>');
    a.document.write(document.getElementById(div).innerHTML);
    a.document.write('</div></body></html>');
    a.document.close();
    a.print();
}

/*stop onclick accordion*/
function stopEvent(e) {
	if(!e) var e = window.event;

    //IE
	e.cancelBubble = true;
	e.returnValue = false;

	//FireFox
	if (e.stopPropagation) {
		e.stopPropagation();
		e.preventDefault();
	}
	return false;
}

/*goal slider*/
function pageLoad(sender, e) 
{
    var slider = $find('uxGoalSliderBehavior');
    if (slider != null)
    {
        var t = document.createElement('DIV');
        slider._handle.appendChild(t);
        t.innerHTML = "<div id='handle_perc_outer'><span id='handle_perc'></span></div>";
        setVisibleValue();
        slider.add_valueChanged(onValueChanged);
    }
}

function onValueChanged(sender, e) 
{
    setVisibleValue();
}

function setVisibleValue()
{
    var value = $find('uxGoalSliderBehavior')._value;
    document.getElementById('handle_perc').innerHTML = -value + '%';
}

function IsIe()
{
    return navigator.userAgent.indexOf("MSIE");
}
