function menuIn(width, height,expand) {

    var dm = $('menu');

    dm.style.width=width+"px";

    dm.style.height=height+"px";

    if (expand==1) {

        $$('select').each(function(obj){obj.hide();})

        $$('iframe').each(function(frame){

        sels = frame.contentWindow.document.getElementsByTagName('select');

        for(i=0;i< sels.length;i++) {

            Element.hide(sels[i]);

        }

        })

    }

    else {

        $$('select').each(function(obj){obj.show();})

        $$('iframe').each(function(frame){

        sels = frame.contentWindow.document.getElementsByTagName('select');

        for(i=0;i<sels.length;i++) {

            Element.show(sels[i]);

        }

        })

    }

}





function openWindow(url) {

     x = window.open(url,'_blank','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=auto,resizable=yes,copyhistory=no');

	 x.focus();

}



function openPopup(_url,_winName,_width,_height,_scroll,_return) {

	var _y = (screen.height - _height) / 2;

	var _x = (screen.width - _width) / 2;

    var x = window.open(_url,_winName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+_scroll+',resizable=no,copyhistory=no,top='+_y+',left='+_x+',screenY='+_y+',screenX='+_x+',width='+_width+',height='+_height);

	x.focus();

	if (_return)

	    return x;

}



function clickButton(e, buttonid) {

	var bt = document.getElementById(buttonid); 



	if(bt.tagName == "A") {

		if (e.keyCode == 13) {

			location.href = bt.href;

			return false;

		}

	}

	else {

		if (typeof bt == 'object') {

			if (e.keyCode == 13) {

				bt.click(); 

				return false; 

			}

		}

	}

}



var prev;

function debug(obj) {

	var msg = "";

	var i = 0;

	for(p in obj) {

		msg += p + " = " + obj[p] + "\n";

		if(++i == 20) {

			alert(msg);

			msg = "";

			i = 0;

		}

	}

	if(msg != "") {

		alert(msg);

	}

}
