
//==================================
// form handling functions
//==================================
//
// CONTENT FUNCTIONS
//
function showStaticContentForm() 
{
	var staticF = document.getElementById('StaticContentForm');
	//var linkF = document.getElementById('LinkContentForm');
	var moduleF = document.getElementById('ModuleContentForm');
	
	staticF.style.display = '';
	//linkF.style.display = 'none';
	moduleF.style.display = 'none';
}

/*function showLinkForm ()
{
	var staticF = document.getElementById('StaticContentForm');
	var linkF = document.getElementById('LinkContentForm');
	var moduleF = document.getElementById('ModuleContentForm');
	
	staticF.style.display = 'none';
	linkF.style.display = '';
	moduleF.style.display = 'none';
}*/

function showModuleForm ()
{
	var staticF = document.getElementById('StaticContentForm');
	//var linkF = document.getElementById('LinkContentForm');
	var moduleF = document.getElementById('ModuleContentForm');
	
	staticF.style.display = 'none';
	//linkF.style.display = 'none';
	moduleF.style.display = '';
}
//
// MENU FUNCTIONS
//
function showMenuTypeContent()
{
	var lLink = document.getElementById('linkLink');
	var cLink = document.getElementById('contentLink');
	
	lLink.style.display = 'none';
	cLink.style.display = '';
}

function showMenuTypeLink()
{
	var lLink = document.getElementById('linkLink');
	var cLink = document.getElementById('contentLink');
	
	lLink.style.display = '';
	cLink.style.display = 'none';
}
/////////////////////////////////////
// for asset manager
/////////////////////////////////////
function modalDialogShow_IE(url,width,height) //IE
{
	return window.showModalDialog(url,window,
		"dialogWidth:"+width+"px;dialogHeight:"+height+"px;edge:Raised;center:Yes;help:No;Resizable:Yes;Maximize:Yes");
}
function modalDialogShow_Moz(url,width,height) //Moz
{
    var left = screen.availWidth/2 - width/2;
    var top = screen.availHeight/2 - height/2;
    activeModalWin = window.open(url, "", "width="+width+"px,height="+height+",left="+left+",top="+top);
    window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
}
var sActiveAssetInput;
function setAssetValue(v) //required by the asset manager
{
    document.getElementById(sActiveAssetInput).value = v;
}
function openAsset(s, basePlus)
{
	sActiveAssetInput = s;
	if(navigator.appName.indexOf('Microsoft')!=-1)
		document.getElementById(sActiveAssetInput).value=modalDialogShow_IE("/admin/modules/base/Editor/assetmanager/assetmanager.php?sBasePlus=" + basePlus,640,465); //IE	
	else
		modalDialogShow_Moz("/admin/modules/base/Editor/assetmanager/assetmanager.php?sBasePlus=" + basePlus,640,465); //Moz	
}

/*function openWindow(url);
{
	//window.open(url,"");
}*/
