var caution = falsefunction setCookie(name, value, expires, path, domain, secure) {var curCookie = name + "=" + escape(value) +((expires) ? "; expires=" + expires.toGMTString() : "") +((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +((secure) ? "; secure" : "")if (!caution || (name + "=" + escape(value)).length <= 4000)document.cookie = curCookieelseif (confirm("Cookie exceeds 4KB and will be cut!"))document.cookie = curCookie}function getCookie(name) {var prefix = name + "="var cookieStartIndex = document.cookie.indexOf(prefix)if (cookieStartIndex == -1)return nullvar cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)if (cookieEndIndex == -1)cookieEndIndex = document.cookie.lengthreturn unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))}function deleteCookie(name, path, domain) {if (getCookie(name)) {document.cookie = name + "=" + ((path) ? "; path=" + path : "") +((domain) ? "; domain=" + domain : "") +"; expires=Thu, 01-Jan-70 00:00:01 GMT"}}function fixDate(date) {var base = new Date(0)var skew = base.getTime()if (skew > 0)date.setTime(date.getTime() - skew)}function item(parent, text, depth) {this.parent = parent this.text = text this.depth = depth }function makeArray(length) {this.length = length }function makeDatabase() {outline = new makeArray(7)outline[0] = new item(true, '<font color="#333333">Cataloghi (pdf)</font>', 0)	outline[1] = new item(false, '<A HREF="pdf/cataloghi/antintrusione.pdf" target="_blank">Antintrusione</A>', 1)	outline[2] = new item(false, '<A HREF="pdf/cataloghi/antintrusione_via_radio.pdf" target="_blank">Antintrusione via radio</A>', 1)	outline[3] = new item(false, '<A HREF="pdf/cataloghi/antincendio_e_gas.pdf" target="_blank"">Antincendio</A>', 1)	outline[4] = new item(false, '<A HREF="pdf/cataloghi/antitaccheggio.pdf" target="_blank"">Antitaccheggio</A>', 1)	outline[5] = new item(false, '<A HREF="pdf/cataloghi/controllo_accessi.pdf" target="_blank"">Controllo Accessi</A>', 1)    outline[6] = new item(false, '<A HREF="pdf/cataloghi/Tvcc.pdf" target="_blank"">Tvcc</A>', 1)	setStates()setImages()}function setStates() {var storedValue = getCookie("outline")if (!storedValue) {for (var i = 0; i < outline.length; ++i) {if (outline[i].depth == 0)outline[i].state = trueelseoutline[i].state = false}} else {// extract current states from cookie (0 => false, 1 => true)for (var i = 0; i < outline.length; ++i) {if (storedValue.charAt(i) == '1')outline[i].state = trueelseoutline[i].state = false}}}function setImages() {for (var i = 0; i < outline.length; ++i) {if (outline[i].state)if (outline[i].parent) if (outline[i + 1].state) // outline[i] is explodedoutline[i].pic = '<A HREF="javascript:toggle(' + i + ')"><IMG SRC="images/exploded.gif" BORDER=0></A>'else outline[i].pic = '<A HREF="javascript:toggle(' + i + ')"><IMG SRC="images/collapsd.gif" BORDER=0></A>'else // outline[i] is only a child (not a parent)outline[i].pic = '<IMG SRC="images/child.gif" BORDER=0>'}}function toggle(num) {for (var i = num + 1; i < outline.length && outline[i].depth >= outline[num].depth + 1; ++i) {if (outline[i].depth == outline[num].depth + 1)outline[i].state = !outline[i].state // toggle state}setStorage()history.go(0)}function setStorage() {var text = ""for (var i = 0; i < outline.length; ++i) {text += (outline[i].state) ? "1" : "0"}setCookie("outline", text)}makeDatabase()