﻿// JScript File
var popUp; 
function SetValueForSelect(FormName,ControlId, value, pB)
{
	eval('var theform = document.' + FormName + ';');	
	popUp.close();
	theform.elements[ControlId].value = value;		
	if (pB)
		__doPostBack('btnReload','');
}
function OpenWindowForSelect(idForm,idName,pB)
{	
	rand = (Math.round((Math.random()*99999)+1))
	popUp = window.open(idForm + '?formname=' + document.forms[0].name + 
	'&Control=' + idName + '&valor=' + document.forms[0].elements[idName].value + '&pB=' + pB,
	rand,"top=150,left=250,height=280,width=220,status=yes,toolbar=no,menubar=no,resizable=no" );
}

function OpenWindowList(idForm,idName,idResource, pB, Cn2)
{
	rand = (Math.round((Math.random()*99999)+1))	
	popUp = window.open(idForm + '?formname=' + document.forms[0].name + '&Control=' + idName + '&value=' + document.forms[0].elements[idName].value + '&pB=' + pB + '&Resource=' + idResource + '&Cn2=' + Cn2,rand,"top=100,left=150,height=450,width=600,resizable=yes,scrollbars=no,status=yes");
}
function CloseWindow()
            {
                self.close();
            }	

function SetList(FormName, ControlId, value, pB)
{   
	eval('var theform = document.' + FormName + ';');
	popUp.close();
	theform.elements[ControlId].value = value;	
	theform.elements["ctl00$ContentPlaceHolder1$hidControl"].value = ControlId
	if (pB)
		__doPostBack('ctl00$ContentPlaceHolder1$btnReload','');
}	

