/* M$M$1$M$M
This file is part of Mooffanka, a Web Content Management System
Copyright (C) 2000-2005 Francesco Sullo, email: sullof@sullof.com, Rome/Italy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Mooffanka; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
For further information about Mooffanka: www.mooffanka.org
*/

function openClose(divd,prefix) {
	if (prefix) eval("var nodeOC = "+prefix+"nodeOC;var O = "+prefix+"O;var C = "+prefix+"C")
	var idiv = getElement('div_'+divd)
	if (idiv) {
		var ibut = getElement('but_'+divd)
		idiv.style.display = idiv.style.display == 'block' ? 'none' : 'block'
		ibut.src = mooHref+"pic/a"+(nodeOC[divd]?'a':'m')+"_.gif"
		nodeOC[divd] = nodeOC[divd] ? false : true
	}
}


function setAll(prefix) {
	if (prefix) eval("var nodeOC = "+prefix+"nodeOC;var O = "+prefix+"O;var C = "+prefix+"C")
	var preLoad = getElement(prefix+'preLoad')
	if (preLoad && preLoad.style) preLoad.style.display = 'none'
	var o = []
	var x=0
	while (O) {
		o[O] = true
		O = O.replace(/[0-9]+_$/,'')
		x++
		if (x == 10) break
	}
	for (var c in C) {
		var idiv = getElement('div_'+c)
		if (idiv) {
			var ibut = getElement('but_'+c)
			if (o[c]) {
				idiv.style.display = 'block'
				if (ibut) ibut.src = mooHref+"pic/am_.gif"
				nodeOC[c] = true
			}
			else {
				idiv.style.display = 'none'
			}
		}
	
	}
}

function selectCheck(cid,prefix) {
	if (prefix) eval("var nodeOC = "+prefix+"nodeOC;var O = "+prefix+"O;var C = "+prefix+"C")
	var inp = getElement('i_'+cid)
	var but = getElement('cb_'+cid)
	var isCkd = but.src.indexOf("oo_.gif") != -1 ? true : false
	inp.value = isCkd?"":"1"
	but.src = mooHref+"pic/o"+(isCkd?'':'o')+"_.gif"
}

