function CMSGetLocalGallery(s0,s13)
{
	var arrs13 = s13.split(':');
	var txtGuid=null;
	var txtDisp=null;
	if(arrs13.length>1)
	{
		txtGuid = document.getElementById('MetaData1_'+arrs13[1]);
		txtDisp = document.getElementById('MetaData1_'+s0);
		//prompt('MetaData1_'+arrs13[1],'MetaData1_'+arrs13[1]+' ['+txtGuid+']');
		//prompt('MetaData1_'+s0,'MetaData1_'+s0+' ['+txtDisp+']');
	}
	if(txtGuid&&txtDisp)
	{
		var ret = window.showModalDialog("/VELUXcommon/CustomDialogs/CustomResourceGalleryPicker.aspx?SelectedNodeGUID="+txtGuid.value,'help:no;status:no;resizable:no;scrollbars:no');
		if(ret)
		{
			var d=unescape(ret);
			var arrIDS = d.split('^~^');
			if(arrIDS.length>1)
			{
				txtDisp.value=arrIDS[0];
				txtGuid.value=arrIDS[1];
			}
			else
			{
				txtDisp.value='';
				txtGuid.value='(none)';
			}
		}
		else
		{
				txtDisp.value='';
				txtGuid.value='(none)';
		}
	}
}

function showImageMapDialog(imagedata, width, height)
{
	return window.showModalDialog('/veluxcommon/CustomDialogs/ImageMapEditDialog.aspx',imagedata,'dialogHeight:'+height+'px;dialogWidth:'+width+'px;help:no;status:no;resizable:yes;scroll:no;unadorned:yes;');
}

function CMSGetInternalLink(curlink)
{
	return window.showModalDialog( "/VELUXcommon/CustomDialogs/InternalLinksShort.aspx",curlink,'dialogTop:10000;dialogLeft:10000;dialogHeight:10;dialogWidth:10;help:no;status:no;resizable:no;scrollbars:no');
}

function CMSGetResourceGalleries(s0,s13)
{
	var arrs13 = s13.split(':');
	var txtGuid;
	var txtDisp;
	if(arrs13.length>1)
	{
		txtGuid = document.getElementById('MetaData1_'+arrs13[1]);
		txtDisp = document.getElementById('MetaData1_'+s0);
	}
	if(txtGuid&&txtDisp)
	{
		var ret = window.showModalDialog("/VELUXcommon/CustomDialogs/CustomResourceGalleryPicker.aspx?SelectedNodeGUID="+txtGuid.value,'help:no;status:no;resizable:no;scrollbars:no');
		if(ret)
		{
			var d=unescape(ret);
			var arrIDS = d.split('^~^');
			if(arrIDS.length>1)
			{
				txtDisp.value=arrIDS[0];
				txtGuid.value=arrIDS[1];
			}
			else
			{
				txtDisp.value='';
				txtGuid.value='(none)';
			}
		}
		else
		{
				txtDisp.value='';
				txtGuid.value='(none)';
		}
	}
}



function CloseMainWindow()
{
	window.opener = self;
	window.close();
}