function OW(strName,iW,iH,TOP,LEFT,R,S,SC,T,TB,URL,TYPE,dArg)
{
	if (TYPE=="modal" || TYPE=="modalIframe")
	{
	var sF=""
	var _rv
	sF+=T?'unadorned:'+T+';':'';
	sF+=TB?'help:'+TB+';':'';
	sF+=S?'status:'+S+';':'';
	sF+=SC?'scroll:'+SC+';':'';
	sF+=R?'resizable:'+R+';':'';
	sF+=iW?'dialogWidth:'+iW+'px;':'';
	sF+=iH?'dialogHeight:'+(parseInt(iH)+(S?42:0))+'px;':'';
	sF+=TOP?'dialogTop:'+TOP+'px;':'';
	sF+=LEFT?'dialogLeft:'+LEFT+'px;':'';
	
	
	document.getElementById("wrap").style.filter = "alpha(opacity=30)";

	
	if (TYPE=="modal")
		_rv=window.showModalDialog(URL+"&r="+Math.round(Math.random()*1000000),dArg?dArg:"",sF);
	else
	{
		var da=new Object()
		da.w=iW;
		da.h=iH;
		da.url=URL;
		_rv=window.showModalDialog("/cgi-bin/dasp/ModalIframe.asp?r="+Math.round(Math.random()*1000000),da,sF);
	}

	if ("undefined" != typeof(_rv) )
		return _rv;
	}
	else
	{
		var sF=""
		sF+=iW?'width='+iW+',':'';
		sF+=iH?'height='+iH+',':'';
		sF+=R?'resizable='+R+',':'';
		sF+=S?'status='+S+',':'';
		sF+=SC?'scrollbars='+SC+',':'';
		sF+=T?'titlebar='+T+',':'';
		sF+=TB?'toolbar='+TB+',':'';
		sF+=TB?'menubar='+TB+',':'';
		sF+=TOP?'top='+TOP+',':'';
		sF+=LEFT?'left='+LEFT+',':'';
		return window.open(URL?URL:'about:blank',strName?strName:'',sF).focus()
	}
}

function EditTags(ID)
{
	// A will return 0 if nothing is selected
	var a = OW("E","475","300","","","no","no","yes","no","no","http://www.mycoolbackgrounds.com/index.cfm?&fuseaction=global.EditTags&id=" + ID + "&TagAssignmentTypeID=23","modal");
	// alert(a);
	
	document.getElementById("wrap").style.filter = "none";
	// self.location.reload(true);
	getCurrentTags();
}

function getCurrentTags(theBackgroundID)
{
	DWREngine._execute(_cfscriptLocation_Tags, null, 'getCurrentTags', theBackgroundID, 23, getCurrentTagsResult);
}

function getCurrentTagsResult(theResults)
{
	document.getElementById("CurrentTags").innerHTML = theResults;
}
