var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isDyn = (isDOM || isIE4 || isNS4);

function getRef(id)
{
 if (isDOM) return document.getElementById(id);
 if (isIE4) return document.all[id];
 if (isNS4) return document.layers[id];
}


function openWindow(url,name,width,height) {
    x = (640 - width)/2, y = (480 - height)/2;

	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}

	name = window.open(url,name,'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
	name.focus();
}

function OpenCalendar(pageName,idname, postBack)
{
	var popUp = window.open(pageName +'?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=165,height=250,left=200,top=250');
}
