function setCookie(name, value, expires, path, domain, secure) { document.cookie= name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : ""); } /** * Gets the value of the specified cookie. * * name Name of the desired cookie. * * Returns a string containing value of specified cookie, * or null if cookie does not exist. */ function getCookie(name) { var dc = document.cookie; var prefix = name + "="; var begin = dc.indexOf("; " + prefix); if (begin == -1) { begin = dc.indexOf(prefix); if (begin != 0) return null; } else { begin += 2; } var end = document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } return unescape(dc.substring(begin + prefix.length, end)); } /** * Deletes the specified cookie. * * name name of the cookie * [path] path of the cookie (must be same as path used to create cookie) * [domain] domain of the cookie (must be same as domain used to create cookie) */ 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 bookmark(){ var url = window.location; var title = document.title; if (window.sidebar) { // Mozilla Firefox Bookmark window.sidebar.addPanel(title, url,""); } else if( window.external ) { // IE Favorite window.external.AddFavorite( url, title); } else if(window.opera && window.print) { // Opera Hotlist return true; } } function hide_intro(){ Effect.Fade('intro'); Effect.Appear('title_links'); if($('intro_chkbox').checked){ setCookie('cebucoNoIntro', 'yes', new Date(new Date().getTime() + (30*24*60*1000))); } else { deleteCookie('cebucoNoIntro'); } } function show_intro(){ Effect.Appear('intro'); Effect.Fade('title_links'); var perm = getCookie('cebucoNoIntro'); if(perm == 'yes'){ deleteCookie('cebucoNoIntro'); } } function initPage(){ var perm = getCookie('cebucoNoIntro'); if(perm == 'yes'){ Element.hide('intro'); Element.show('title_links'); $('intro_chkbox').checked = true; } else{ Element.show('intro'); Element.hide('title_links'); $('intro_chkbox').checked = false; } } function filter_by_format(item){ if(item=='all') { enable_all(); return; } disable_all(); formats[item].each( function(el){ if(el) $('cd'+el).className = "icon"; } ); $('columns_im').selectedIndex =0; $('columns_ta').selectedIndex =0; $('columns_ga').selectedIndex =0; $('types').selectedIndex = 0; } function filter_by_types(t){ $('columns_im').selectedIndex =0; $('columns_ta').selectedIndex =0; $('columns_ga').selectedIndex =0; $('format').selectedIndex =0; Element.hide('c_im'); Element.hide('c_ga'); Element.hide('c_ta'); Element.show('c_'+t); var opts = $('columns_'+t).options; //console.log(opts); disable_all(); $A(opts).each( function(el){ //console.log(el); if(el.value > 0) $('cd'+el.value).className = "icon"; } ); } function enable_all(){ var disabled = document.getElementsByClassName('icon_inactive'); if(disabled.length) disabled.each( function(el){ el.className = 'icon'; } ); } function disable_all(){ var enabled = document.getElementsByClassName('icon'); if(enabled.length) enabled.each( function(el){ el.className = 'icon_inactive'; } ); } function select_format(el){ if(el.className == 'icon_inactive') return false; else gototitles(el.id.substr(2), true); } function gotohome(){ window.location = 'http://www.rreporter.nl/CDM/page_a.php'; return; window.scrollTo(0,0); var myAjax = new Ajax.Updater( {success: 'cebuco_tool'}, 'http://www.rreporter.nl/CDM/page_a.php', { method: 'post', evalScripts: true, onComplete: publishHeight() } ); } function toggle_all(chk){ toggle_national(chk); toggle_regional(chk); $('select_national').checked = false; $('select_regional').checked = false; } function toggle_national(){ all_national = !all_national; var nats = $('national').getElementsByTagName('INPUT'); nats = $A(nats); nats.each( function(el){ if(!el.disabled) el.checked = all_national; } ); } function toggle_regional(){ all_regional = !all_regional; var nats = $('regional').getElementsByTagName('INPUT'); nats = $A(nats); nats.each( function(el){ if(!el.disabled) el.checked = all_regional; } ); } function select_titles(frm){ window.scrollTo(0,0); var ser =Form.serialize('sel_titles'); if(!ser.match(/.+title/)) { alert("Selecteer één of meerdere titels door het hokje voor de naam aan te kruisen. Doorgestreepte titels bieden het door u geselecteerde formaat niet aan en zijn daarom niet aankruisbaar. Alle andere titels bieden dit formaat wel aan."); return false; } window.location = 'http://www.rreporter.nl/CDM/page_c.php?'+'cd='+cd+ '&'+ ser; return; //alert( ser); //return; var myAjax = new Ajax.Updater( {success: 'cebuco_tool'}, 'http://www.rreporter.nl/CDM/page_c.php', { parameters: 'cd='+cd+ '&'+ ser, method: 'post', evalScripts: true, onComplete: publishHeight() } ); } function show_contact(cd){ if(Element.visible('contact'+cd)) Effect.Fade('contact'+cd); else Effect.Appear('contact'+cd); } function gototitles(id, nrp){ //window.scrollTo(0,0); var campign = nrp? 'national' : 'regional'; window.location = 'http://www.rreporter.nl/CDM/page_b.php?'+"cd=" +id +'&campign='+campign; return; var myAjax = new Ajax.Updater( {success: 'cebuco_tool'}, 'http://www.rreporter.nl/CDM/page_b.php', { method: 'post', parameters: "cd=" +id +'&campign='+campign, evalScripts: true, onComplete: publishHeight() } ); }