// JavaScript Document if (isJsEnabled()) { c2Calendars = new Array(); CalendarText = new Array(); document.write(''); } function c2CalendarCreate(id) { var container = document.getElementById(id+'-calendar-container'); if (container) { c2Calendars[id] = new Epoch((c2Calendars ? c2Calendars.length : '0'), 'popup', container, false, id); epoch_fix(c2Calendars[id], id, container); } } function c2CalendarToggle(id) { c2Calendars[id].toggle(); } /** * For a text based calendar */ function CalendarTextCreate(id) { var container = document.getElementById(id+'-calendar-text-container'); if (container) { CalendarText[id] = new Epoch('CalendarText', 'popup', container, false, id); epoch_fix(CalendarText[id], id, container); } } function CalendarTextToggle(id) { if (!CalendarText) {alert("CalendarText is null");} else { CalendarText[id].toggle(); } } //------------------------------------------------------------------------------------------------------------------------------------------------------ /** * the function to work with the Epoch_class.js */ function epoch_fix(obj, id, container) { obj.container = container; obj.drupaldateform = id; //display calendar if (obj.container) { obj.container.appendChild(obj.calendar); } obj.visible ? obj.show() : obj.hide(); } function open_news_article(id) { window.open('?q=news_article/'+id,id,"width=720,toolbar=no,resizable=yes,scrollbars=yes,menubar=no"); } function delete_news_article(id) { var conf=confirm("Are you sure you want to delete this article?"); if(conf==true){ HTTPPost('?q=news_article_delete/'+id,delete_news_article_receive, 0); } else {return;} } function delete_news_article_receive(string, xmlhttp, garbage) { if (xmlhttp.status != 200) { return alert('An HTTP error '+ xmlhttp.status +' occured.\n'); } alert('Article Successfully Deleted!'); location.reload(true); } function edit_news_article(id,day,month,year) { document.getElementById('edit-news_id').value=id; document.getElementById('edit-date-day').value=day; document.getElementById('edit-date-month').value=month; document.getElementById('edit-date-year').value=year; document.getElementById('edit-headline').value=document.getElementById('edit-headline_hidden_'+id).value; document.getElementById('edit-text').value=document.getElementById('edit-text_hidden_'+id).value; window.frames[0].location.reload(true); } function news_type_change(object) { //HTML Article, Set hidden value to HTML if(object.value=='H') { document.getElementById('edit-type_val').value='H'; document.getElementById('edit-pdf_upload').style.visibility='hidden'; } else if(object.value=='P') { document.getElementById('edit-type_val').value='P'; document.getElementById('edit-pdf_upload').style.visibility='visible'; } } //scroller width var swidth=180; //scroller height var sheight=75; //background color var sbcolor=''; //scroller's speed var sspeed=2; var resumesspeed=sspeed; function start() { if (document.all) iemarquee(ticker); else if (document.getElementById) ns6marquee(document.getElementById('ticker')); } function iemarquee(whichdiv){ iediv=eval(whichdiv); sheight += 50; iediv.style.pixelTop=sheight; iediv.innerHTML=document.getElementById('ticker').innerHTML; sizeup=iediv.offsetHeight; ieslide(); } function ieslide(){ if (iediv.style.pixelTop+500>=sizeup*(-1)){ iediv.style.pixelTop-=sspeed; setTimeout("ieslide()",100); } else{ iediv.style.pixelTop=sheight; ieslide(); } } function ns6marquee(whichdiv){ ns6div=eval(whichdiv); sheight += 50; ns6div.style.top=sheight + "px"; ns6div.innerHTML=document.getElementById('ticker').innerHTML; sizeup=ns6div.offsetHeight; ns6slide(); } function ns6slide(){ if (parseInt(ns6div.style.top)>=sizeup*(-1)){ theTop = parseInt(ns6div.style.top)-sspeed; ns6div.style.top = theTop + "px"; setTimeout("ns6slide()",100); } else { ns6div.style.top = sheight + "px"; ns6slide(); } }