/* parts.js - Coolkie control - Footer setting - Textsize change - Print view control - Current status control for menu --------------------------------------------------------- */ ////////// cookie control var Cookie = { set: function(name,val) { if(val) { theDate = (new Date()).getDate(); setDate = new Date(); setDate.setTime(setDate.getTime() + (theDate*1000*60*60*24*3));// valid for 3 days expDate = setDate.toGMTString(); document.cookie = name + "=" + escape(val) + ";path=/;expires=" + expDate; return true; } return false; }, get: function(name) { theCookie = document.cookie + ";"; name += "="; start = theCookie.indexOf(name); if(start>-1) { end = theCookie.indexOf(";",start); return unescape(theCookie.substring(start + name.length,end)); } return false; } }; ////////// footer setting var Bindfooter = { set: function() { footer = document.getElementById('area-footer').offsetHeight; document.getElementById('blank-footer').style.height = footer + 'px'; if (document.getElementById('page')) document.getElementById('page').style.marginBottom = footer * -1 + 'px'; } }; ////////// textsize change var Textsize = { start: function() { if (bindobj.printstate) return; Textsize.effects(); }, effects: function() { if (!bindobj.isLegacy) { var resize = new Fx.Style($E('body'), 'font-size', {duration: 250, fps: 60, unit: 'px'}).set(12); $$('.bindtexts').addEvent('click', function() { resize.start(10); return false;}); $$('.bindtextm').addEvent('click', function() { resize.start(12); return false;}); $$('.bindtextl').addEvent('click', function() { resize.start(14); return false;}); } else { as = document.getElementsByTagName('a'); var resize = function(size) { document.body.style.fontSize = size;} for (i=0;i'; ///// prepare numbers var billbowidth = billboard ? billboard.offsetWidth : 0; var contentswidth = contents ? contents.offsetWidth : 0; mainwidth = main ? main.offsetWidth : 0; sideAwidth = sideA ? sideA.offsetWidth : 0; sideBwidth = sideB ? sideB.offsetWidth : 0; var addpx = function(val) { val += 'px'; return val;} ///// change id for print printpage.id = 'area-print'; printpage.style.width = billbowidth < contentswidth ? addpx(contentswidth) : addpx(billbowidth); if (document.getElementById) { printpage.style.minWidth = printpage.style.width; printpage.style.width = '80%';} ///// hide elements 2 billboard.style.display = 'none'; contents.style.display = 'none'; if (billboard) { table1 = document.createElement('table'); table1.style.width = addpx(billbowidth); printpage.appendChild(table1); if (!bindobj.ie60 && document.getElementById) { table1.style.minWidth = addpx(billbowidth); table1.style.width = '100%';} tbody1 = document.createElement('tbody'); table1.appendChild(tbody1); tr1 = document.createElement('tr'); tbody1.appendChild(tr1); td1 = document.createElement('td'); td1.id = 'area-billboard'; td1.innerHTML = billboard.innerHTML; tr1.appendChild(td1); } table2 = document.createElement('table'); table2.style.width = addpx(contentswidth); printpage.appendChild(table2); if (!bindobj.ie60 && document.getElementById) { table2.style.minWidth = addpx(contentswidth); table2.style.width = '100%';} tbody2 = document.createElement('tbody'); table2.appendChild(tbody2); tr2 = document.createElement('tr'); tbody2.appendChild(tr2); widthrate = Math.floor(640/contentswidth * 100) / 100; if (bindobj.ie60) { img = document.getElementsByTagName('img'); for (i=0;i-1) { spans[i].onclick = function() { w = bindobj.ie60 ? 710 : 880; url = document.URL.replace(/#.*$/,'$1'); window.open(url + '?printstate=true','_blank','width=' + w + ',resizable=1,menubar=1,scrollbars=1'); return false; } } } } }; ////////// current status control for menus var Bindmenu = { set: function() { Bindmenu.control(); }, control: function() { url = document.URL.replace(/#.*$/,''); url = url.replace(/\?.*$/,''); if (url.charAt(url.length-1)=='/') url += 'index.html'; menus = $$('.menuh'); menus.extend($$('.menuv')); for (i=0;i-1) { parents.className += ' cr'; match = true; } else parents = parents.parentNode; } } };