/*** Fix bug outerHTML in Mozilla ***/
if(window.HTMLElement)
{
	window.HTMLElement.prototype.__defineGetter__("outerHTML", function() {
		var span = document.createElement("span"); span.appendChild(this.cloneNode(true));
		return span.innerHTML;
	});

	window.HTMLElement.prototype.__defineSetter__("outerHTML", function(html) {
		var range = document.createRange();
		this.innerHTML = html;
		range.selectNodeContents(this);
		var frag = range.extractContents();
		this.parentNode.insertBefore(frag, this);
		this.parentNode.removeChild(this);
	});
};
/*** End Fix bug outerHTML in Mozilla ***/

/*--------------------------------------------*/

function show(id){ document.getElementById(id).style.display = 'block';}
function hide(id){ document.getElementById(id).style.display = 'none';}

function showorhide(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}
	else {
		el.style.display = 'block';
	}
}
//This is used in Recently View control.
function HideWait(hover)
{   
    
    var t = setTimeout(function()
                {
                    var a = getReference(hover);
                    if (a != null)
                    {
                        a.style.display = 'none';        
                    }                    
                }
    , 900);
}

function CohortWindowOpen1(url) {
    var result = window.open(url);
    if (result == null)
        window.alert('Cohort popup window was blocked. Please disable popup blocker software in order to run Cohort.');
    return result;
}

function CohortWindowOpen(url, name, features) {
    if (name == null)
        return CohortWindowOpen1(url);
    
    var result = window.open(url, name, features);
    if (result == null)
        window.alert('Cohort popup window was blocked. Please disable popup blocker software in order to run Cohort.');
    return result;
}
