
		dojo.require("dijit.Dialog");
	
		var _dialog = null;

		function closeIFrameDialog(){
				_dialog.destroy();
		}
		
		function openIFrameDialog(title, src, width, height){
				if(dijit.byId("_myDialog") != null)
					dijit.byId("_myDialog").destroy();
				
				var divEle = document.createElement("div");
				divEle.id = "dialogDiv";
				var iframeEle = document.createElement("iframe");
				iframeEle.id = "_myIFrame";
				iframeEle.style.width = width + "px";
				iframeEle.style.height = height + "px";
				iframeEle.src = src;
				divEle.appendChild(iframeEle);
				document.body.appendChild(divEle);
				
				_dialog = new dijit.Dialog({ id : "_myDialog", title: title, draggable: false}, divEle);
				_dialog.show();
		}
		
		function changeContentSize(){
			calcHeight("_myIFrame");
		}
		
		function changeIFrameDialogSize(width, height){
			
			var iframeEle = document.getElementById("_myIFrame");
			iframeEle.style.width = width + "px";
			iframeEle.style.height = height + "px";
		} 
		
		function calcHeight(the_iframe){
			
			var iframeElement = document.getElementById(the_iframe);
			//var h = 100;
			//var w = 100;
			if(document.getElementById && !(document.all)) {
				h = iframeElement.contentDocument.documentElement.scrollHeight;
				w = iframeElement.contentDocument.documentElement.scrollWidth;
				iframeElement.style.height = (h + 5) + 'px';
				iframeElement.style.width = (w+5) + 'px';
			}else{
				h = document.frames(the_iframe).document.body.scrollHeight;
				w = document.frames(the_iframe).document.body.scrollWidth;
				document.all(the_iframe).style.height = (h + 5);
				document.all(the_iframe).style.width = (w + 5);
			}
			
			
			
			//window view port
			var viewportwidth;
			 var viewportheight;
			 
			 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
			 
			 if (typeof window.innerWidth != 'undefined')
			 {
			      viewportwidth = window.innerWidth,
			      viewportheight = window.innerHeight
			 }
			 
			// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

			 else if (typeof document.documentElement != 'undefined'
			     && typeof document.documentElement.clientWidth !=
			     'undefined' && document.documentElement.clientWidth != 0)
			 {
			       viewportwidth = document.documentElement.clientWidth,
			       viewportheight = document.documentElement.clientHeight
			 }
			 
			 // older versions of IE
			 
			 else
			 {
			       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
			       viewportheight = document.getElementsByTagName('body')[0].clientHeight
			 }

			//dojo.style(_dialog.domNode, "top", "30px");
			dojo.style(_dialog.domNode, "left", ((viewportwidth - w)/2) + "px");
		}
