function fadeitmother(div, num, click) { var title = new Array(); var image = new Array(); var excerpt = new Array(); var preListName = ''; var postListName = ''; var prevNum = 0; var postNum = 0; var numText = 'Num = '+num+'\n'; max = 4; image[1] = ''; title[1] = '

Hounds on the loose: Pullman batters Rams in GNL contest

'; excerpt[1] = '

'; image[2] = ''; title[2] = '

'Big dance' mania on the Palouse

'; excerpt[2] = '

Residents turn out for first day of March Madness

'; image[3] = ''; title[3] = '

All the fun that will fit

'; excerpt[3] = '

Kids' Kamp keeps Moscow children busy during spring break

'; image[4] = ''; title[4] = '

Local an eyewitness to political activism - Thailand style

'; excerpt[4] = '

Moscow man gets a close look at anti-government protests

'; if(num > max) { num = 1; }else{ num = num; } if(num <= 1) { prevNum = max; }else{ prevNum = num - 1; } //alert('Num: '+num+'isNum'+isNaN(num)); document.getElementById(div).innerHTML=image[num]+title[num]+excerpt[num]; for(x=1;x<=max;x++) { if(x != num) { document.getElementById('top'+x).className= 'test'; } } postListName = 'top'+num; document.getElementById(postListName).className="selected"; num++; clearTimeout(); setTimeout("fadeitmother('homepagechange',"+num+")",10000); } /* addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html */ function addEvent( obj, type, fn ) { if (obj.addEventListener) obj.addEventListener( type, fn, false ); else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent( "on"+type, obj[type+fn] ); } } /* createElement function found at http://simon.incutio.com/archive/2003/06/15/javascriptWithXML */ function createElement(element) { if (typeof document.createElementNS != 'undefined') { return document.createElementNS('http://www.w3.org/1999/xhtml', element); } if (typeof document.createElement != 'undefined') { return document.createElement(element); } return false; } function insertTop(obj) { // Create the two div elements needed for the top of the box d=createElement("div"); d.className="bt"; // The outer div needs a class name d2=createElement("div"); d.appendChild(d2); obj.insertBefore(d,obj.firstChild); } function insertBottom(obj) { // Create the two div elements needed for the bottom of the box d=createElement("div"); d.className="bb"; // The outer div needs a class name d2=createElement("div"); d.appendChild(d2); obj.appendChild(d); } function initCB() { // Find all div elements var divs = document.getElementsByTagName('div'); var cbDivs = []; for (var i = 0; i < divs.length; i++) { // Find all div elements with cbb in their class attribute while allowing for multiple class names if (/\bcbb\b/.test(divs[i].className)) cbDivs[cbDivs.length] = divs[i]; } // Loop through the found div elements var thediv, outer, i1, i2; for (var i = 0; i < cbDivs.length; i++) { // Save the original outer div for later thediv = cbDivs[i]; // Create a new div, give it the original div's class attribute, and replace 'cbb' with 'cb' outer = createElement('div'); outer.className = thediv.className; outer.className = thediv.className.replace('cbb', 'cb'); // Change the original div's class name and replace it with the new div thediv.className = 'i3'; thediv.parentNode.replaceChild(outer, thediv); // Create two new div elements and insert them into the outermost div i1 = createElement('div'); i1.className = 'i1'; outer.appendChild(i1); i2 = createElement('div'); i2.className = 'i2'; i1.appendChild(i2); // Insert the original div i2.appendChild(thediv); // Insert the top and bottom divs insertTop(outer); insertBottom(outer); } } if(document.getElementById && document.createTextNode) { addEvent(window, 'load', initCB); } function viewPhoto(imgID, imgHeight, imgWidth){ new_height = imgHeight + 200; window.open("http://www.dnews.com/viewPhoto.php?imgID="+ imgID,'','height=' + new_height + ',width=750,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes'); } function emailArticle(id, news){ var temp = "http://www.dnews.com/email.php?id=" + id + "&news=" + news; window.open(temp,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=500, height=500"); } function printerFriendly(id, news){ var temp = "http://www.dnews.com/print.php?id=" + id + "&news=" + news; window.open(temp,"_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width=400, height=400"); } function openWindow(URL,height,width){ window.open(URL,'','height='+height+',width='+width+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'); } function BNPhoto(imgID, imgHeight, imgWidth){ window.open("http://www.dnews.com/bn_viewPhoto.php?imgID="+ imgID,'','height=' + imgHeight + ',width=' + imgWidth +',toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no'); } function viewGallery(gID){ var newwin = window.open("http://www.dnews.com/images/photo-gallery/"+gID+"/small.html", "newwin", "width=480,height=400,toolbar=false,locationbar=true,directories=false,status=false,menubar=false,scrollbars=false,resizable=true,copyhistory=false"); } //start the comment stuff function textLimit(field) { var maxlen = 1000; if (field.value.length > maxlen) field.value = field.value.substring(0, maxlen); } function updateScore(id, score, u) { var url = 'http://www.dnews.com/includes/comments/update_score.php'; var pars = 'id='+id+'&score='+score+'&userid='+u; var myAjax = new Ajax.Updater( 'score'+id, url, { method: 'get', parameters: pars, success: 'score'+id } ); } function digg(id, user) { //gave a thumbs up to the comment //add one to the counter //disable all images and change their src's if(document.getElementById('digg'+id).src=='http://www.dnews.com/templates/default/images/c-digg.png') { //disable both thumbs up and down document.getElementById('bury'+id).disabled = true; document.getElementById('digg'+id).disabled = true; //update comment score updateScore(id, 1, user); //change image src's to indicate they are inactive document.getElementById('bury'+id).src = 'http://www.dnews.com/templates/default/images/c-bury-off.png'; document.getElementById('digg'+id).src = 'http://www.dnews.com/templates/default/images/c-digg-off.png'; } else { //do nothing //alert('disabled'); } } function bury(id, user) { //thumbs down //subtract one from the counter //disable images and change their src's if(document.getElementById('bury'+id).src=='http://www.dnews.com/templates/default/images/c-bury.png') { //slide the comment up to hide it Effect.BlindUp("comment"+id); //disable both thumbs up and down document.getElementById('bury'+id).disabled = true; document.getElementById('digg'+id).disabled = true; //update comment score updateScore(id, -1, user); //change image src's to indicate they are inactive document.getElementById("bury"+id).src = "http://www.dnews.com/templates/default/images/c-bury-off.png"; document.getElementById("digg"+id).src = "http://www.dnews.com/templates/default/images/c-digg-off.png"; document.getElementById("reply"+id).innerHTML = ''; } else { //do nothing //alert('disabled'); } } function toggleShow(link, comment) { if(document.getElementById(link).innerHTML == 'show comment') { Effect.BlindDown(comment); document.getElementById(link).innerHTML = 'hide comment'; } else { Effect.BlindUp(comment); document.getElementById(link).innerHTML = 'show comment'; } } function replyForm(id, one, two, md, user, storyid) { var form = ''; form += 'Reply to this comment:
'; form += '
'; if(user != '') { form += ''; }else{ form += 'Display Name:
'; } form += ''; form += ''; form += '
'; form += ''; form += 'Security Question: '+one+' + '+two+' =
'; form += '
'; //set the paragraph to something new document.getElementById('reply'+id).innerHTML = form; } function checkUsername(name){ var url = 'http://www.dnews.com/includes/checkname.php'; var pars = 'name='+name; var myAjax = new Ajax.Updater( 'name_available', url, { method: 'get', parameters: pars, success: 'name_available' } ); } /* =2)){w=e;ts=0;}if(oc=="all"||oc=="main"){ww=e;th=0;}}if(!l){l=1;qm_th=th;sd=document.getElementById("qm"+sd);if(window.qm_pure)sd=qm_pure(sd);sd[w]=function(e){qm_kille(e)};document[ww]=qm_bo;if(oc=="main"){qm_ib=true;sd[e]=function(event){qm_ic=true;qm_oo(new Object(),qm_la,1);qm_kille(event)};document.onmouseover=function(){qm_la=null;clearTimeout(qm_tt);qm_tt=null;};}sd.style.zoom=1;if(sh)x2("qmsh",sd,1);if(!v)sd.ch=1;}else if(sh)sd.ch=1;if(oc)sd.oc=oc;if(sh)sd.sh=1;if(fl)sd.fl=1;if(ft)sd.ft=1;if(rl)sd.rl=1;sd.style.zIndex=l+""+1;var lsp;var sp=sd.childNodes;for(var i=0;i ");x2("qmparent",lsp,1);lsp.cdiv=b;b.idiv=lsp;if(qm_n&&qm_v<8&&!b.style.width)b.style.width=b.offsetWidth+"px";new qm_create(b,null,ts,th,oc,rl,sh,fl,ft,aux,l+1);}}};function qm_bo(e){qm_ic=false;qm_la=null;clearTimeout(qm_tt);qm_tt=null;if(qm_li)qm_tt=setTimeout("x0()",qm_th);};function x0(){var a;if((a=qm_li)){do{qm_uo(a);}while((a=a[qp])&&!qm_a(a))}qm_li=null;};function qm_a(a){if(a[qc].indexOf("qmmc")+1)return 1;};function qm_uo(a,go){if(!go&&a.qmtree)return;if(window.qmad&&qmad.bhide)eval(qmad.bhide);a.style.visibility="";x2("qmactive",a.idiv);};;function qa(a,b){return String.fromCharCode(a.charCodeAt(0)-(b-(parseInt(b/2)*2)));}eval();;function qm_oo(e,o,nt){if(!o)o=this;if(qm_la==o&&!nt)return;if(window.qmv_a&&!nt)qmv_a(o);if(window.qmwait){qm_kille(e);return;}clearTimeout(qm_tt);qm_tt=null;qm_la=o;if(!nt&&o.qmts){qm_si=o;qm_tt=setTimeout("qm_oo(new Object(),qm_si,1)",o.qmts);return;}var a=o;if(a[qp].isrun){qm_kille(e);return;}if(qm_ib&&!qm_ic)return;var go=true;while((a=a[qp])&&!qm_a(a)){if(a==qm_li)go=false;}if(qm_li&&go){a=o;if((!a.cdiv)||(a.cdiv&&a.cdiv!=qm_li))qm_uo(qm_li);a=qm_li;while((a=a[qp])&&!qm_a(a)){if(a!=o[qp]&&a!=o.cdiv)qm_uo(a);else break;}}var b=o;var c=o.cdiv;if(b.cdiv){var aw=b.offsetWidth;var ah=b.offsetHeight;var ax=b.offsetLeft;var ay=b.offsetTop;if(c[qp].ch){aw=0;if(c.fl)ax=0;}else {if(c.ft)ay=0;if(c.rl){ax=ax-c.offsetWidth;aw=0;}ah=0;}if(qm_o){ax-=b[qp].clientLeft;ay-=b[qp].clientTop;}if(qm_s2&&!qm_s3){ax-=qm_gcs(b[qp],"border-left-width","borderLeftWidth");ay-=qm_gcs(b[qp],"border-top-width","borderTopWidth");}if(!c.ismove){c.style.left=(ax+aw)+"px";c.style.top=(ay+ah)+"px";}x2("qmactive",o,1);if(window.qmad&&qmad.bvis)eval(qmad.bvis);c.style.visibility="inherit";qm_li=c;}else if(!qm_a(b[qp]))qm_li=b[qp];else qm_li=null;qm_kille(e);};function qm_gcs(obj,sname,jname){var v;if(document.defaultView&&document.defaultView.getComputedStyle)v=document.defaultView.getComputedStyle(obj,null).getPropertyValue(sname);else if(obj.currentStyle)v=obj.currentStyle[jname];if(v&&!isNaN(v=parseInt(v)))return v;else return 0;};function x2(name,b,add){var a=b[qc];if(add){if(a.indexOf(name)==-1)b[qc]+=(a?' ':'')+name;}else {b[qc]=a.replace(" "+name,"");b[qc]=b[qc].replace(name,"");}};function qm_kille(e){if(!e)e=event;e.cancelBubble=true;if(e.stopPropagation&&!(qm_s&&e.type=="click"))e.stopPropagation();};function qm_pure(sd){if(sd.tagName=="UL"){var nd=document.createElement("DIV");nd.qmpure=1;var c;if(c=sd.style.cssText)nd.style.cssText=c;qm_convert(sd,nd);var csp=document.createElement("SPAN");csp.className="qmclear";csp.innerHTML=" ";nd.appendChild(csp);sd=sd[qp].replaceChild(nd,sd);sd=nd;}return sd;};function qm_convert(a,bm,l){if(!l)bm[qc]=a[qc];bm.id=a.id;var ch=a.childNodes;for(var i=0;i */