var xmlhttp=Ajax.getTransport(),xmlhttp_load=Ajax.getTransport(),sel_article=0,sel_prev=0,sel_title="",timerID,now=new Date;now.setTime(now.getTime()+31536E6);expStr=";expires="+now.toGMTString()+";";function xmlhttp_ready(a){return a.readyState==4||a.readyState==0||!a.readyState}function param_escape(a){return typeof encodeURIComponent!="undefined"?encodeURIComponent(a):escape(a)}
function toggle_setting(a){a&&a.blur();var b=document.getElementById("feeds-holder");a=document.getElementById("headlines-frame");if(b.style.display==""){b.style.display="none";a.style.marginLeft="0px";document.cookie="St=0"+expStr}else{b.style.display="";b=0;if(navigator.appName.indexOf("Internet Explorer")!=-1){b=navigator.appVersion.split("MSIE");b=parseFloat(b[1])}if(b!=7&b!=6)a.style.marginLeft="146px";document.cookie="St=1"+expStr}}
function chng_disp(){var a=document.getElementsByClassName("hlUpdated");if(a){var b=document.getElementById("ChkUpdated"),c=b.checked?"":"none";if(a[0].style.display!=c)for(var d=0,e=a.length;d<e;d++)a[d].style.display=c;document.cookie="Ck="+b.checked+expStr}}
function chng_vis(a,b,c){c&&c.blur();c=true;if(!xmlhttp_ready(xmlhttp)){if(b!="")return;c=false}for(var d=document.getElementsByClassName("feedCheck"),e=0,g=d.length;e<g;e++){var f=d[e].getAttribute("feed");if(b=="all_news"){d[e].checked=true;document.cookie="Fd"+f+"="+d[e].checked+expStr}else if(f==a){if(b=="link_set"||!c)d[e].checked=!d[e].checked;document.cookie="Fd"+f+"="+d[e].checked+expStr}}c&&viewfeed()}
function init(){if(!arguments.callee.done){arguments.callee.done=true;var a=new Date((new Date).getFullYear(),0,1,0,0,0,0),b=a.toGMTString();b=new Date(b.substring(0,b.lastIndexOf(" ")-1));document.cookie="Tz="+(a-b)/36E5+expStr;a="/webnews/backend.php?op=feeds";if(navigator.userAgent.match("Opera")){b=Math.round((new Date).getTime()/1E3);a=a+"&ts="+b}if(xmlhttp_ready(xmlhttp)){xmlhttp.open("GET",a,true);xmlhttp.onreadystatechange=feedlist_callback;xmlhttp.send(null)}}}
function feedlist_callback(){if(xmlhttp.readyState==4){document.getElementById("feeds-frame").innerHTML=xmlhttp.responseText;typeof correctPNG!="undefined"&&correctPNG();viewfeed()}}
function viewfeed(a,b){b&&b.blur();a="/webnews/backend.php?op=viewfeed&subop="+param_escape(a);if(sel_article!=0)a+="&id="+param_escape(sel_article)+"&title="+param_escape(sel_title);if(document.getElementById("search_form"))a+="&"+Form.serialize("search_form");if(xmlhttp_ready(xmlhttp)){notify("updating, please wait...",true);xmlhttp.open("GET",a,true);xmlhttp.onreadystatechange=headlines_callback;xmlhttp.send(null)}}
function headlines_callback(){if(xmlhttp.readyState==4){var a=document.getElementById("headlines-frame");if(a){a.innerHTML=xmlhttp.responseText;typeof correctPNG!="undefined"&&correctPNG();notify("");if(a=document.getElementById("artCnt")){var b=document.getElementById("headlinesList");a.firstChild.nodeValue=b.rows.length;timerID&&clearTimeout(timerID);timerID=setTimeout("updatefeed()",3E5)}}}}
function updatefeed(){if(xmlhttp_ready(xmlhttp_load)){xmlhttp_load.open("GET","/webnews/backend.php?op=viewfeed",true);xmlhttp_load.onreadystatechange=viewfeed;xmlhttp_load.send(null)}}
function article_callback(){if(xmlhttp.readyState==4){var a=document.getElementById("RART-"+sel_article);if(a){a.innerHTML=xmlhttp.responseText;typeof correctPNG!="undefined"&&correctPNG();if(sel_prev!=0)var b=document.getElementById("RART-"+sel_prev),c=document.getElementById("RCLO-"+sel_prev);if(a.style.display!=""){var d=false;if(b){sel_prev=0;if(b.style.display!="none")d=true}new Effect.BlindDown(a,{duration:0.2,afterFinish:display_close});if(d){c.style.display="none";new Effect.BlindUp(b,{duration:0.2})}}}}}
function display_close(){document.getElementById("RCLO-"+sel_article).style.display=""}function close_article(a){a&&a.blur();a=document.getElementById("RART-"+sel_article);var b=document.getElementById("RCLO-"+sel_article);sel_article=0;sel_title="";if(a){new Effect.BlindUp(a,{duration:0.2,afterFinish:remove_highlite});new Effect.BlindUp(b,{duration:0.1})}}
function remove_highlite(){var a=document.getElementsByClassName("evenSelected");if(a){i=0;for(j=a.length;i<j;i++)a[i].className="even"}if(a=document.getElementsByClassName("oddSelected")){i=0;for(j=a.length;i<j;i++)a[i].className="odd"}}
function view(a,b){b&&b.blur();if(b=document.getElementById("RROW-"+a)){var c="/webnews/backend.php?op=view&id="+param_escape(a);if(xmlhttp_ready(xmlhttp)){remove_highlite();sel_prev=sel_article;sel_article=a;sel_title=b.getAttribute("title2");b.className+="Selected";xmlhttp.open("GET",c,true);xmlhttp.onreadystatechange=article_callback;xmlhttp.send(null)}}}var notify_hide_timerid=false,notify_last_doc=false;
function hide_notify(){if(notify_last_doc)notify_last_doc.getElementById("notify").style.display="none"}
function notify(a,b){var c=document.getElementById("notify"),d=document.getElementById("notify_body");if(c&&d){notify_hide_timerid&&window.clearTimeout(notify_hide_timerid);notify_last_doc=document;notify_opacity=1;if(a==""){if(c.style.display=="block")notify_hide_timerid=window.setTimeout("hide_notify()",0)}else{c.style.display="block";c="";if(b)c=" style='position: relative; top: -4px;'";d.innerHTML="<span"+c+">"+a+"</span>";b||(notify_hide_timerid=window.setTimeout("hide_notify()",3E3))}}};