function activateParent(objli)
{
    //alert(objli.parentNode);
    objli.parentNode.parentNode.parentNode.className = "on";
}

function deactivateParent(objli)
{    
    objli.parentNode.parentNode.parentNode.className = "off";
}

function showPopUp(strID)
{
    var objDiv = document.getElementById(strID);
    objDiv.style.display = "block";
}
function hidePopUp(strID)
{
    var objDiv = document.getElementById(strID);
    objDiv.style.display = "none";
}
function hideCreateLogin()
{
    ShowHideDropdowns(true);

    var objDiv = document.getElementById("create-login-wrapper");
    objDiv.style.display = "none";
}

function showCreateLogin()
{
    //Hide dropdowns that will exist under the popup.  In IE they would normally appear on top of the popup.
    //ShowHideDropdowns(false);

    var objDiv = document.getElementById("create-login-wrapper");
    
    /* IT DOESN'T LOOK LIKE WE NEED THIS.  WE DON'T NEED TO OVER-COMPLICATE THINGS 
    //sets the transparent background to the size of the window
    var height = -1;
    if(document.height) height = document.height;
    else if(document.body.offsetHeight) height = document.body.offsetHeight;
    
    if(height > -1) objDiv.style.height = height + 'px';
    */
    //display inputs
    objDiv.style.display = "block";
}

function ShowHideDropdowns(show)
{
    var display = show ? "visible" : "hidden";
    
    var ddContact = GetElement('ctl00_cphMain_ddReasons');
    if(ddContact) ddContact.style.visibility = display;
}

function popCal(id, e) {

    var x = e.screenX;
    var y = e.screenY;
	link = window.open("/webCal.aspx?id=" + id,"Cal","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=200,height=168,left=" + x + ",top=" + y + ",alwaysRaised=1");
	link.focus();

}

function getMouseCoords(e, axis) {
	var x = 0;
	var y = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY) 	{
		x = e.pageX;
		y = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		x = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		y = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	// posx and posy contain the mouse position relative to the document
	// Do something with this information
	
	if (axis == "Y") return y;
	if (axis == "X") return x;
}


function chkFilterDates(strStart, strEnd)
{
    var msg = "";
   
}

function GenerateGetElement()
{
	if (document.getElementById) return function(id) { return document.getElementById(id); }
	else if (document.all) return function(id) { return document.all[id]; }
	else if (document.layers) return function(id) { document.layers[id]; }
}
var GetElement;
GetElement = GenerateGetElement();

function uploadCompleted()
{
    var strFilename = document.rup.getResponse();
    if (GetElement("ucContractDetail_lblFilename") != null)
    {
        GetElement("ucContractDetail_lblFilename").innerHTML = strFilename;
        GetElement("ucContractDetail_hidFilename").value = strFilename;
    }
    if (GetElement("ucDocumentDetail_lblFilename") != null)
    {
        GetElement("ucDocumentDetail_lblFilename").innerHTML = strFilename;
        GetElement("ucDocumentDetail_hidFilename").value = strFilename;
    }
    if (GetElement("ucInvoiceDetail_lblFilename") != null)
    {
        GetElement("ucInvoiceDetail_lblFilename").innerHTML = strFilename;
        GetElement("ucInvoiceDetail_hidFilename").value = strFilename;
    }
    
    if (GetElement("ucSettingsDetail_lblFilename") != null)
    {
        GetElement("ucSettingsDetail_lblFilename").innerHTML = strFilename;
        GetElement("ucSettingsDetail_hidFilename").value = strFilename;
    }
    
    if (GetElement("lblFilename") != null)
    {
        GetElement("lblFilename").innerHTML = strFilename;
        GetElement("hidFilename").value = strFilename;
    }
    
    if (GetElement("ucBenchmarkDetail_lblFilename") != null)
    {
        //var imgGraphView = GetElement("ucBenchmarkDetail_lblFilename").src = strFilename;
        GetElement("ucBenchmarkDetail_hidFilename").value = strFilename;
        alert(GetElement("ucBenchmarkDetail_hidFilename").value);
        
    }
}