var ie = (document.all) ? true : false;
var ie6 = (navigator.appVersion.indexOf("MSIE 6") != -1) && ie;


function setContentHeight(is500)
{
	var ull = document.getElementById("ull"),
		ulr = document.getElementById('ulr');
	if (ull && ulr)
	{
		ulr.style.height = ull.offsetHeight + 'px';
		ull.style.height = ull.offsetHeight + 'px';
	}

    is500 = is500 || 0;
    windowHeight = getWindowHeight();
    bodyHeight = document.getElementById('body').offsetHeight;
    if(windowHeight > bodyHeight)
    {
        divToResize = document.getElementById('wrapper3');
        divToResize2 = document.getElementById('aux3');
        newHeight = windowHeight - 353;
//        if(ie && !ie6) newHeight += 210;
//        if(is500) newHeight += 93;
        divToResize.style.height = newHeight + 'px';
        divToResize2.style.height = newHeight + 'px';
    }    
}

function getWindowHeight() 
{
    var windowHeight=0;
    if(typeof(window.innerHeight) == 'number') windowHeight = window.innerHeight;
    else 
    {
        if(document.documentElement && document.documentElement.clientHeight) 
            windowHeight = document.documentElement.clientHeight;
        else 
            if(document.body&&document.body.clientHeight) windowHeight = document.body.clientHeight;
    }
    return windowHeight;
}

function checkEqual()
{
    frm = document.forms['personal'];
    pass1 = document.forms['personal']['password'];
    pass2 = document.forms['personal']['password2'];
    msg = document.getElementById('passEqual');
    if(pass1.value == pass2.value && pass1.value != '') msg.style.visibility = 'visible';
    else msg.style.visibility = 'hidden';
}

function showForm(alias, must_login) {
  if (must_login) {
          window.open("/login/?window=1&alias="+alias, null, 'width=650,height=320,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
  } else {
	document.getElementById('form_'+alias).style.display = 'block';
	document.getElementById('form_button_'+alias).style.display = 'none';
	if (document.getElementById('comments')) document.getElementById('comments').style.display = 'block';
  }
}

function recover() {
          window.open("/recover-password/", null, 'width=650,height=450,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1');
}