/**
 *	ASFWindowPopup represents a standard popup.
 *	@author	Nino Camdzic
 *	@date	31-07-2008
 */
function ASFWindowPopup(a_strName)
{
	/**
	 *	Displays a popup in an existing popup or a new one if no
	 *	popup name is specified.
	 *	@param a_strUrl - URL that should be displayed in the popup.
	 *	@param a_nDescriptor - Object in JSON format which describes the behaviour of the popup.
	 *
	 *	Example:
	 *	ASFWindowPopup("myPopup").show("http://", {width: 500, height: 400, toolbar: 1})
	 */
	this.show = function(a_strUrl, a_nDescriptor)
	{
		var strPopupSettings = "";
		var iPropertyCount = 0;
		var iPropertyStep = 0;
		
		if(!a_strUrl)
		{
			throw new Error("ASFWindowPopup error: No url specified!");
		}
		
		for(var nProperty in a_nDescriptor)
		{
			iPropertyCount += 1;
		}
		
		for(var nProperty in a_nDescriptor)
		{
			iPropertyCount++;
			strPopupSettings += nProperty + "=" + a_nDescriptor[nProperty] + (iPropertyStep < iPropertyCount ? "," : "");
		}
		
		window.open(a_strUrl, a_strName, strPopupSettings);
	}

	return this;
}
