
function reloadExplorerTree() {
    window.top.frames.explorer.frames.explorerTree.location.href = '/NdSite/Ctrl/CMS/displayExplorerTree';
}

function clearOnLineCache() {
	var url = '/NdSite/Ctrl/CMS/clearOnLineCache';
    document.location.href = url;		
}



/*-----------------------------------------------------------------------------------------------*/


/****************************************************************
 *
 *			C M S : : C m s S e c t i o n : : A c t i o n s .
 *
 ****************************************************************/
 

function displaySection(section) {
	var url = '/NdSite/Ctrl/CMS/displaySection/' + section;
	window.top.frames.main.location.href = url;
}
 
function newSection(section) {
    var url = '/NdSite/Ctrl/CMS/newSection/' + section;
    window.open(url,'','height=475, width=400');
}

function editSection(section) {
	var url = '/NdSite/Ctrl/CMS/editSection/' + section;
    window.open(url,'','height=400, width=400');
}

function delSection(section) {
    if (confirm("Seguro que desea eliminar esta seccion???")) {
        var url = '/NdSite/Ctrl/CMS/delSection/' + section;
    	document.location.href = url;
    }
}

function dropSection(section) {
    if (confirm("Seguro que desea eliminar definitivamente esta seccion de la papelera?")) {
        var url = '/NdSite/Ctrl/CMS/dropSection/' + section;
    	document.location.href = url;
    }
}

function restoreSection(section) {
	var url = '/NdSite/Ctrl/CMS/restoreSection/' + section;
	document.location.href = url;
}

function newSectionPage(section)  {
	var url = '/NdSite/Ctrl/CMS/newSectionPage/' + section;
	window.open(url,'','height=400, width=400');
	//document.location.href = url;
}

function selectSectionPages(section) {
    var url = '/NdSite/Ctrl/CMS/selectSectionPages/' + section;
    window.open(url,'','height=400, width=400, scrollbars=yes');
}

function selectSectionTemplate(section) {
    var url = '/NdSite/Ctrl/CMS/selectSectionTemplate/' + section;
    window.open(url,'','height=400, width=400');
}

function selectSectionOrder(section) {
	var url = '/NdSite/Ctrl/CMS/selectSectionOrder/' + section;
    window.open(url,'','height=400, width=400, resizable');	
}

function publishSection() {
    document.cmsForm.action.value = 'publishSection';
    document.cmsForm.submit();
}

function previewSection() {
    var url = '/NdSite/Ctrl/CMS/previewSection/' + section;
    window.open(url,'','height=400, width=400, scrollbars=yes'); 
}

function displaySectionACLs(section) {
    var url = '/NdSite/Ctrl/SYS/displayObjectACLs/CmsSection/' + section;
	top.main.mainContent.location.href = url;
}

function cutSection(section) {
	window.top.NdSiteClipBoard.cut('CmsSection',section);
}

function copySection(section) {
    window.top.NdSiteClipBoard.copy('CmsSection',section);
}

function pasteOnSection(section) {
	if (window.top.NdSiteClipBoard.obj.className == 'CmsPage') {	
		if (window.top.NdSiteClipBoard.action == 'copy') {	// Paste Copy Page to Section.			
			document.location.href = '/NdSite/Ctrl/CMS/pasteCopyPageToSection/' +  window.top.NdSiteClipBoard.obj.oId + '/' + section;
			window.top.NdSiteClipBoard.reset();
		} else if (window.top.NdSiteClipBoard.action == 'cut') {	
			if (window.top.NdSiteClipBoard.objFrom.className == 'CmsSection') { // Paste Cut Page From section To Section.
				document.location.href = '/NdSite/Ctrl/CMS/pasteCutPageFromSectionToSection/' +  window.top.NdSiteClipBoard.obj.oId + '/' + window.top.NdSiteClipBoard.objFrom.oId + '/' + section;
				window.top.NdSiteClipBoard.reset();	
			} else if (window.top.NdSiteClipBoard.objFrom.className == 'CmsPage') {	// Paste Cut Page From section To Section.
				document.location.href = '/NdSite/Ctrl/CMS/pasteCutPageFromPageToSection/' +  window.top.NdSiteClipBoard.obj.oId + '/' + section;
				window.top.NdSiteClipBoard.reset();		
			}
		}
	} else if (window.top.NdSiteClipBoard.obj.className == 'CmsSection') {	
		if (window.top.NdSiteClipBoard.action == 'copy') {	// Paste Copy Section to Section
			document.location.href = '/NdSite/Ctrl/CMS/pasteCopySection/' +  window.top.NdSiteClipBoard.obj.oId + '/' + section;
			window.top.NdSiteClipBoard.reset();		
		} else if (window.top.NdSiteClipBoard.action == 'cut') {	// Paste Cut Section To Section
			document.location.href = '/NdSite/Ctrl/CMS/pasteCutSection/' +  window.top.NdSiteClipBoard.obj.oId + '/' + section;
			window.top.NdSiteClipBoard.reset();				
		} 
	}
}

function displaySectionProperties(section) {
	var url = '/NdSite/Ctrl/CMS/displaySectionProperties/' + section;
    window.open(url,'','height=400, width=400, scrollbars=yes');	
}

function setSectionStatus(section,status) {
	var url = '/NdSite/Ctrl/CMS/setSectionStatus/' + section + '/' + status;
    document.location.href = url;	
}

function displaySectionCVS(section) {
	var url = '/NdSite/Ctrl/CMS/displaySectionCVS/' + section; 
	window.top.frames.main.frames.mainContent.location.href = url;		
}



/*-----------------------------------------------------------------------------------------------*/


/***************************************************************
 *
 *			C M S : : C m s P a g e : : A c t i o n s .
 *
 ***************************************************************/
 

function displayPage(page,section) {
    var url = '/NdSite/Ctrl/CMS/displayPage/' + page + '/' + section;
	window.top.frames.main.location.href = url;
} 
 
function newPage(page) {
    var url = '/NdSite/Ctrl/CMS/newPage/' + page;
    window.open(url,'','height=400, width=400, scrollbars=yes');
}

function editPage(page) {
    var url = '/NdSite/Ctrl/CMS/editPage/' + page;
    window.open(url,'','height=400, width=400, scrollbars=yes');
}

function unLinkPageFromParent(page,pageParent) {
    if(confirm("¿Seguro que desea eliminar esta pagina?")) {
        var url = '/NdSite/Ctrl/CMS/unLinkPageFromParent/' + page + '/' + pageParent;
        document.location.href = url;
    }
}

function unLinkPageFromSection(page,section) {
    if(confirm("¿Seguro que desea eliminar esta pagina de la seccion?")) {
        var url = '/NdSite/Ctrl/CMS/unLinkPageFromSection/' + page + '/' + section;
        document.location.href = url;
    }
}

function delPage(page) {
    if(confirm("Seguro que desea eliminar esta pagina?")) {
        var url = '/NdSite/Ctrl/CMS/delPage/' + page;
		document.location.href = url;	
    }
}

function dropPage(page) {
    if(confirm("Seguro que desea eliminar definitivamente esta pagina de la papelera?")) {
        var url = '/NdSite/Ctrl/CMS/dropPage/' + page;
		document.location.href = url;	
    }
}

function restorePage(page) {
	var url = '/NdSite/Ctrl/CMS/restorePage/' + page;
	document.location.href = url;
}

function displayPageTemplate(page) {
    var url = '/NdSite/Ctrl/CMS/displayPageTemplate/' + page;
    window.open(url,'','height=400, width=400');
}

function selectPageTemplate(page) {
    var url = '/NdSite/Ctrl/CMS/selectPageTemplate/' + page;
    window.open(url,'','height=400, width=400');
}

function selectPageParent(page) {
    var url = '/NdSite/Ctrl/CMS/selectPageParent/' + page;
    window.open(url,'','height=400, width=400');
}

function selectPageOrder(page) {
	var url = '/NdSite/Ctrl/CMS/selectPageOrder/' + page;
    window.open(url,'','height=400, width=400, resizable');	
}

function displayPageModule(page) {
    var url = '/NdSite/Ctrl/CMS/displayModule/CmsPage/' + page;
    window.open(url,'','height=400, width=400');
}

function publishPage(page,section) {
	if(confirm("Desea desea publicar esta pagina?")) {
		parent.location.href = '/NdSite/Ctrl/CMS/publishPage/' + page + '/' + section;	
	}
}

function previewPage(page,section) {
    var url = '/NdSite/Ctrl/CMS/previewPage/' + page + '/' + section;
    window.open(url,'','height=800, width=950, scrollbars=yes, resizable=yes');
}

function reloadPage(page,section){                                                                                         
    parent.mainContent.location.href = '/NdSite/Ctrl/CMS/displayPageContent/' + page + '/' + section;                                                                         
}

function displayPageACLs(page) {
   	var url  = '/NdSite/Ctrl/SYS/displayObjectACLs/CmsPage/' + page;
	parent.mainContent.location.href = url;
}

function displayPageCVS(page,section) {
    var url  = '/NdSite/Ctrl/CMS/displayPageCVS/' + page + '/' + section;
    parent.mainContent.location.href = url;
}

function cutPageFromPage(page,pageFrom) {
	window.top.NdSiteClipBoard.cutFrom('CmsPage',page,'CmsPage',pageFrom);
}

function cutPageFromSection(page,section) {
	window.top.NdSiteClipBoard.cutFrom('CmsPage',page,'CmsSection',section);	
}

function copyPage(page) {
	window.top.NdSiteClipBoard.copy('CmsPage',page);
}

function pasteOnPage(page) {
	if ( window.top.NdSiteClipBoard.obj.className == 'CmsPage' ) {	
		if ( window.top.NdSiteClipBoard.action == 'copy' ) {	// Paste Copy Page to Page.			
			document.location.href = '/NdSite/Ctrl/CMS/pasteCopyPageToPage/' +  window.top.NdSiteClipBoard.obj.oId + '/' + page;
			window.top.NdSiteClipBoard.reset();
		} else if ( window.top.NdSiteClipBoard.action == 'cut' ) {	
			if ( window.top.NdSiteClipBoard.objFrom.className == 'CmsSection' ) { // Paste Cut Page From Section To Page.
				document.location.href = '/NdSite/Ctrl/CMS/pasteCutPageFromSectionToPage/' +  window.top.NdSiteClipBoard.obj.oId + '/' + window.top.NdSiteClipBoard.objFrom.oId + '/' + page;
				window.top.NdSiteClipBoard.reset();	
			} else if ( window.top.NdSiteClipBoard.objFrom.className == 'CmsPage' ) {	// Paste Cut Page From Section To Page.
				document.location.href = '/NdSite/Ctrl/CMS/pasteCutPageFromPageToPage/' +  window.top.NdSiteClipBoard.obj.oId + '/' + page;
				window.top.NdSiteClipBoard.reset();		
			}
		}
	}
}

function displayPageProperties(page) {
	var url = '/NdSite/Ctrl/CMS/displayPageProperties/' + page;
    window.open(url,'','height=400, width=400, scrollbars=yes');	
}

function setPageStatus(page,section,status) {
	var url = '/NdSite/Ctrl/CMS/setPageStatus/' + page + '/' + section + '/' + status;
    document.location.href = url;	
}

function openPageInExtEditor(page,section) {
	window.top.frames.main.frames.mainMenu.location.href = '/NdSite/Ctrl/CMS/displayPageMenu/' + page + '/' + section + '/startTimer';
    window.top.frames.main.frames.mainContent.location.href = '/NdSite/Ctrl/CMS/displayPageContent/' + page + '/' + section;
    document.location.href = '/NdSite/Ctrl/CMS/openPageInExtEditor/' + page;		
}



/*-----------------------------------------------------------------------------------------------*/


/*********************************************************************
 *
 *   	C M S : : C m s P a r a g r a p h : : A c t i o n s .
 *
 *********************************************************************/


function newParagraph(page,section) {
    var url = '/NdSite/Ctrl/CMS/newParagraph/' + page + '/' + section;
    parent.location.href = url;
}

function upParagraph(paragraph) {
	document.cmsForm.action = '/NdSite/Ctrl/CMS/upParagraph/' + paragraph;
    document.cmsForm.target = '_parent';	// Regargamos el menu.
    document.cmsForm.submit();
}

function downParagraph(paragraph) {
	document.cmsForm.action = '/NdSite/Ctrl/CMS/downParagraph/' + paragraph;
    document.cmsForm.target = '_parent';	// Regargamos el menu.
    document.cmsForm.submit();	
}

function selectParagraphTemplate(paragraph) {
    var url = '/NdSite/Ctrl/CMS/selectParagraphTemplate/' + paragraph;
    window.open(url,'','height=400, width=400');
}

function displayParagraphModule(paragraph) {
    var url = '/NdSite/Ctrl/CMS/displayModule/CmsParagraph/' +  paragraph;
    window.open(url,'','height=400, width=400');
}

function delParagraph(paragraph) {
    if (confirm("¿Desea eliminar este parrafo?")  == true) {
    	document.cmsForm.action = '/NdSite/Ctrl/CMS/delParagraph/' + paragraph;
        document.cmsForm.target = '_parent';	// Regargamos el menu.
        document.cmsForm.submit();
    }
}

function displayParagraphProperties(paragraph) {
    var url = '/NdSite/Ctrl/CMS/displayParagraphProperties/' +  paragraph;
    window.open(url,'','height=400, width=400');
}



/*-----------------------------------------------------------------------------------------------*/


/**********************************************************
 *
 *		C M S : : C m s B l o c k : : A c t i o n s
 *
 **********************************************************/


function newImageBlock(block) {
	var url = '/NdSite/Ctrl/CMS/newImageBlock/' + block;
    window.open(url,'','height=400, width=400');	
}
 
function editBlock(block,type,editor) {
	var section = document.cmsForm.section.value;
	switch (type) {
		case 'TXT':
		case 'HTML':
			if (editor == 'External') {
				parent.frames[0].startTimer();
			}
			document.cmsForm.action = '/NdSite/Ctrl/CMS/editBlock/' +  block + '/' + editor;
    		document.cmsForm.submit();
    		break;
    	case 'IMG': 
    	case 'FLA': 
    	case 'MOV':
    		var url = '/NdSite/Ctrl/CMS/editBlock/' + block + '/' + editor;
    		window.open(url,'','height=400, width=500, scrollbars=yes');
    		break;
    	default:
    	
    		break;
	}
}

function saveBlock(block,data) {
	document.cmsForm.action = '/NdSite/Ctrl/CMS/saveBlock/' + block;
    document.cmsForm.target = '_parent'; // Recarga del Menu.
    document.cmsForm.blockData.value = data;
    document.cmsForm.submit();
}

function displayBlockModule(block) {
    var url = '/NdSite/Ctrl/CMS/displayModule/CmsBlock/' +  block;
    window.open(url,'','height=400, width=400');
}

function linkBlock(block) {
	var url = '/NdSite/Ctrl/CMS/linkBlock/' + block;
	window.open(url,'','height=400, width=600, scrollbars=yes');
}		

// @deprecated ?À
function openBlockInExtEditor(block) {
    parent.frames[0].startTimer();
	document.location.href = '/NdSite/Ctrl/CMS/openBlockInExtEditor/' + block;	
}

function openBlockInSimpleEditor(block) {
	var url = '/NdSite/Ctrl/CMS/openBlockInSimpleEditor/' + block;
	window.open(url,'','height=400, width=600, scrollbars=yes');
}

function newLinkBlockHtmlSelection(block) {
	var url = '/NdSite/Ctrl/CMS/newLinkBlockHtmlSelection/' + document.cmsForm.section.value + '/' + document.cmsForm.page.value + '/' + block;
	window.open(url,'','height=400, width=600, scrollbars=yes');
}



/*-----------------------------------------------------------------------------------------------*/


/*********************************************************
 *
 *		C M S : : C m s M e n u : : A c t i o n s
 *
 *********************************************************/


function newMenu() {
    var url = '/NdSite/Ctrl/CMS/newMenu';
    window.open(url,'','height=600, width=800, scrollbars=yes');
}

function editMenu(menu) {
    var url = '/NdSite/Ctrl/CMS/editMenu/' + menu;
    window.open(url,'','height=600, width=800, scrollbars=yes');
}

function editMenuSourceCode(menu) {
    var url = '/NdSite/Ctrl/CMS/editMenuSourceCode/' + menu;
    window.open(url,'','height=600, width=800');	
}

function displayMenuACLs(menu) {
    var url = '/NdSite/Ctrl/SYS/displayObjectACLs/CmsMenu/' + menu;
	top.main.mainContent.location.href = url;
}



/*-----------------------------------------------------------------------------------------------*/


/***************************************************************
 *
 *		C M S : : C m s T e m p l a t e : : A c t i o n s
 *
 ***************************************************************/


function newTemplate(type) {
	var url = '/NdSite/Ctrl/CMS/newTemplate/' + type; 	
    window.open(url,'','height=400, width=400');
}
 
function editTemplate(template) {
    var url = '/NdSite/Ctrl/CMS/editTemplate/' + template;
    window.open(url,'','height=400, width=400');
}

function editTemplateSourceCode(template) {
    var url = '/NdSite/Ctrl/CMS/editTemplateSourceCode/' + template;
    window.open(url,'','height=600, width=800');	
}

function delTemplate(template) {
    if (confirm("Desea Eliminar esta Plantilla")) {
        var url = '/NdSite/Ctrl/CMS/delTemplate/' + template;	
    	document.location.href = url;
    }
}

function displayTemplateACLs(template) {
    var url = '/NdSite/Ctrl/SYS/displayObjectACLs/CmsTemplate/' + template;
	top.main.mainContent.location.href = url;
}

/*-----------------------------------------------------------------------------------------------*/


