

function popupContent (page, width , height)
{
	PopupDialog.OpenDialog ( 'popupDialog' , 'Page Dialog'  , page , width, height, '' , window ,'yes' ) ;
}




/* Helper Functions */


var PopupDialog = new Object() ;
var PopupBrowserInfo = new Object();
var sAgent = navigator.userAgent.toLowerCase() ;

	PopupBrowserInfo.IsIE			= ( sAgent.indexOf("msie") != -1 ) ;
	PopupBrowserInfo.IsGecko		= !PopupBrowserInfo.IsIE ;
	PopupBrowserInfo.IsSafari		= ( sAgent.indexOf("safari") != -1 ) ;
	PopupBrowserInfo.IsNetscape	    = ( sAgent.indexOf("netscape") != -1 ) ;

// This method opens a dialog window using the standard dialog template.
PopupDialog.OpenDialog = function( dialogName, dialogTitle, dialogPage, width, height, customValue , parentWindow, resizable )
{
	// Setup the dialog info.
	var oDialogInfo = new Object() ;
	oDialogInfo.Title = dialogTitle ;
	oDialogInfo.Page = dialogPage ;
	oDialogInfo.Editor = window ;
	oDialogInfo.CustomValue = customValue ;		// Optional
	
	var sUrl = dialogPage ;
	
	this.Show( oDialogInfo, dialogName, sUrl, width, height, parentWindow, resizable ) ;
}



if (PopupBrowserInfo.IsGecko)
{

PopupDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow, resizable )
{
	
	try{ScreenWidth=screen.width;ScreenHeight=screen.height;}catch (e){ScreenWidth=800;ScreenHeight=600;}
	
	var iTop  = (ScreenHeight - dialogHeight) / 2 ;
	var iLeft = (ScreenWidth  - dialogWidth)  / 2 ;

	var sOption  = "location=no,menubar=no,toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes" +
		",resizable="  + ( resizable ? 'yes' : 'no' ) +
		",width="  + dialogWidth +
		",height=" + dialogHeight +
		",top="  + iTop +
		",left=" + iLeft ;

	if ( !parentWindow )
		parentWindow = window ;
	
	var oWindow = parentWindow.open( '', 'FCKeditorDialog_' + dialogName, sOption, true ) ;
	oWindow.moveTo( iLeft, iTop ) ;
	oWindow.resizeTo( dialogWidth, dialogHeight ) ;
	oWindow.focus() ;
	oWindow.location.href = pageUrl ;
	
	oWindow.dialogArguments = dialogInfo ;

	
}


}
else
{


PopupDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow )
{
	if ( !parentWindow )
		parentWindow = window ;

	parentWindow.showModalDialog( pageUrl, dialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ;
}

}//end if is gecko



function GetXmlHttpObjectForShowContent(handler)
{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
		 {
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
	return objXMLHttp
}

function showContent(id , page , args)
{
	if (!document.getElementById(id))
	{ 
		return
	}
	
	xmlHttp=GetXmlHttpObjectForShowContent()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
		var url=page
		url=url+'?'+args
		url=url+"&sid="+Math.random()
		xmlHttp.onreadystatechange= function ()
		{
				if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
				{ 
					document.getElementById(id ).innerHTML=xmlHttp.responseText ;
				} 
				else
				{
					document.getElementById(id).innerHTML="<center><img src=\"/images/wait.gif\" height='16' style='vertical-align:middle;'><center>";
				}
			
		}
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
}