﻿// JScript File

function HandleReadOnlyUpdate(TextBoxId, HiddenFieldId)
{
    var Temp2=document.getElementById(TextBoxId);
    var Temp3=document.getElementById(HiddenFieldId);
    
    var Temp1=prompt('Please enter the new Reference',Temp2.value);
    
    if(Temp1!=null && Temp1!='undefined')
    {
        Temp2.value=Temp1;
        Temp3.value=Temp1;
    }
    
    return false;
}

var popUp;

function OpenPopupPage(pageUrl, controlID, isPostBack, startYear, endYear)
{
    var currentDate = document.getElementById(controlID).value;
    popUp=window.open(pageUrl + '?controlID=' + controlID + '&isPostBack=' + isPostBack + '&currentDate=' + escape(currentDate) + '&startyear=' + startYear + '&endyear=' + endYear, 'amanzipopupcal', 'width=250,height=300,left=200,top=250'); 
}

function SetControlValue(controlID, newDate, isPostBack)
{
    popUp.close();
    document.forms[0].elements[controlID].value=newDate;
    // __doPostBack(controlID,''); // not sure why we'd need to do this
}


