var newsitems;
var curritem=0;
var iPause=0;
$(document).ready(function(){
    var tickerSelector = "ul#ticker li";
    newsitems = $(tickerSelector).hide().hover(
        function(){
            $(this).addClass("hovered");
            iPause=1;
        },
        function(){
            $(this).removeClass("hovered");
            iPause=0;
        }
    ).filter(":eq(0)").show().add(tickerSelector).size();
    setInterval(ticknews,15000); //time in milliseconds
});
function ticknews() {
  if (iPause==0){
    $("#ticker li:eq("+curritem+")").fadeOut("slow",function(){$(this).hide();});
    curritem = ++curritem%newsitems;
    $("#ticker li:eq("+curritem+")").fadeIn("slow");
    }
}
function dpSmartLink(u,n,w,h,p) { // v1.4 by David Powers
  var a,j,k,x,y,f='';if(!n){n='';}if(w){f+='width='+w+',';}if(h){f+='height='+h+',';}
  if(p){p=p.split(':');if(p[0]!='z'){p[0]=='c'?(x=(screen.width-w)/2):x=p[0];f+='left='+x+',';}
  if(p[1]!='z'){if(p[0]=='c'){y=(screen.height-h-p[1])/2;if(navigator.appName.indexOf('Op')!=-1){
  y-=96;y=y<0?0:y;}}else{y=p[1];}f+='top='+y+',';}}a=arguments.length;if(a>5){for (k=5;k<a;k++){
  switch(arguments[k]){case 'all':f+='toolbar,menubar,location,scrollbars,status,resizable,';break;
  case 't':f+='toolbar,';break; case 'm':f+='menubar,';break;case 'l':f+='location,';break;
  case 'sc':f+='scrollbars,';break;case 's':f+='status,';break;case 'r':f+='resizable,';}}}
  if(f.charAt(f.length-1)==','){f=f.slice(0,-1);}j=window.open(u,n,f);j.focus();
  document.MM_returnValue=false;
}