/*
 * $Id: common.js,v 1.1 2006-05-18 15:48:37 sven Exp $
 */
function newWindow(mypage,myname,w,h,features) {
	if(screen.width){
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
	}
	else{winl = 0;wint =0;}
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;

	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += features;
	win = window.open(mypage,myname,settings);
	win.window.focus();
}

// Disable or enable a QuickForm generated date field by name.
function limoDisableFormDateSet (itemName, falseOrTrue) {
	limoDisableFormItem(itemName + "[d]", falseOrTrue);
	limoDisableFormItem(itemName + "[F]", falseOrTrue);
	limoDisableFormItem(itemName + "[Y]", falseOrTrue);
	limoDisableFormItem(itemName + "[H]", falseOrTrue);
	limoDisableFormItem(itemName + "[i]", falseOrTrue);
}

// Disable or enable an item on thefirst form.
function limoDisableFormItem(itemName, falseOrTrue){
	document.forms[0][itemName].disabled = falseOrTrue;
	//document.getElementById('psmForm').elements["eind[d]"].disabled = false;
}


var actionAttacher = pDomApi.getActionAttacher();
pDomApi.addEvent(window, 'domload', function() {
	pDomApi.addEvent('logo', 'click', function() { location.href='/'; } )	} );