var popUp; 

function OpenCalendar(idname, postBack)
{
	popUp = window.open('../Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=165,height=208,left=200,top=250');
}

function SetDate(formName, id, newDate, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newDate;
	if (postBack)
		__doPostBack(id,'');
}		

var NewWindow = '';

function OpenWindow(URL)
{
	if (!NewWindow.closed && NewWindow.location)
	{
		NewWindow.location.href = URL;
	}
	else
	{
		NewWindow = window.open(URL,'Product','height=700,width=630,resizable=yes,left=10,top=10,scrollbars=yes');
		if (!NewWindow.opener) NewWindow.opener = self;
	}
	if (window.focus) {NewWindow.focus()}
}

var Image = '';

function OpenImage(URL)
{
	if (!Image.closed && Image.location)
	{
		Image.location.href = URL;
	}
	else
	{
		Image = window.open(URL,'Image','height=700,width=630,resizable=yes,left=30,top=30,scrollbars=yes');
		if (!Image.opener) Image.opener = self;
	}
	if (window.focus) {Image.focus()}
}

function to_old_win(url)
{
	opener.location.href = url;
	if (window.focus) {opener.focus()}
}
