var Program = function(){
	var dialog,iframe,zzztab;
		return {
			init : function(){
			},
			showDialog : function(tab,program,width,height,x,y,variable){
				if(!dialog){
					dialog = new YAHOO.ext.LayoutDialog("zzzprogram_dialog", { 
						modal:true,
						resizable:true,
						constraintoviewport:true,
						closable:true,
						width:width,
						height:height,
						minWidth:100,
						minHeight:800,
						draggable:true,
						autoScroll:true,
						center: {
							autoScroll:false
						}
					});
				var layout = dialog.getLayout();
					dialog.beginUpdate();
					iframe = YAHOO.ext.DomHelper.append(document.body, {tag: 'iframe', frameBorder: 0, width:'600', height:'500', scrolling:"auto", src: "rdummy.htm"});
					layout.add('center', new YAHOO.ext.ContentPanel(iframe, {title: 'Inner Tab', fitToFrame:true}));
					dialog.addListener("hide", this.closeTab,this,true) 
					dialog.endUpdate();
				}
				if(height>YAHOO.util.Dom.getViewportHeight()) height=YAHOO.util.Dom.getViewportHeight();
				if(width>YAHOO.util.Dom.getViewportWidth()) width=YAHOO.util.Dom.getViewportWidth();
				dialog.resizeTo(width,height);
				//dialog.el.center();
				dialog.onResize();
				dialog.show();
				dialog.el.center();
				zzztab=tab
				iframe.src="program.csp?tab="+tab+"&program="+program+"&variable="+variable;
			},
			hideDialog : function(){
				dialog.hide();
			},
			closeTab : function(){
				iframe.src="rdummy.htm"
				top.TabEvent("remove",zzztab);
			},
			textTab : function(text){
				getEl("zzzprogram_p_header").dom.innerHTML=text;
			}
		};
}();