jQuery.extend({init_news:function(a){a=$.extend({firstname:"",secondname:"",thirdname:"",fourthname:"",playingtitle:"Now Playing:",nexttitle:"Next News:",prevtitle:"Prev News:",newsspeed:6000,effectis:0,mouseover:true,effectspeed:600,imagedir:"",newscountname:"",disablenewscount:false},a);var A=a.firstname;var u=a.secondname;var E=a.thirdname;var d=a.fourthname;var s=a.newsspeed;var f=a.effectis;var l=a.playingtitle;var D=a.nexttitle;var z=a.prevtitle;var H=a.mouseover;var B=a.effectspeed;var v=a.imagedir;var n=a.newscountname;var c=a.disablenewscount;if(n){var w=1}if(c===true){var m=1}f=parseInt(f,10);B=parseInt(B,10);var G=$("#"+d+" #news_prev").attr("src");if(!G){G=v+"prev.gif"}var e=$("#"+d+" #news_next").attr("src");if(!e){e=v+"next.gif"}var C=$("#"+d+" #news_pause").attr("src");if(!C){C=v+"pause.gif"}var t=$("#"+d+" #news_prev0").attr("src");if(!t){t=v+"prev0.gif"}var r=$("#"+d+" #news_next0").attr("src");if(!r){r=v+"next0.gif"}var b=$("#"+d+" #news_pause0").attr("src");if(!b){b=v+"pause0.gif"}var y,o,F,x,g,j,q,p;F=$("#"+A+" .news_style").size();x=$("#"+A+" .news_style").eq(0).html();g=$("#"+A+" .news_style").eq(1).attr("rel");j=0;$("#"+u).append(x);if(w===1&&m!=1){$("#"+n).html("1/"+F)}if(w!=1&&m!=1){$("#"+E).html("&nbsp;&nbsp;"+l+"1/"+F+"&nbsp;&nbsp;<br>")}$("#"+E).append(D+g);$("#"+d+" #news_next").click(function(){clearTimeout(q);$(this).attr({src:r});$("#"+d+" #news_prev").attr({src:G});$("#"+d+" #news_pause").attr({src:C});j=j+1;if(j==F){j=0}var L=j+1;var K=$("#"+A+" .news_style").eq(j).html();var I=L;if(I==F){I=0}var J=$("#"+A+" .news_style").eq(I).attr("rel");switch(f){case 0:$("#"+u).fadeOut(B,function(){$("#"+u).empty();$("#"+u).html(K);if(w===1&&m!=1){$("#"+n).html(L+"/"+F);$("#"+E).html(D+J)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+L+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(D+J)}if(m===1){$("#"+E).html(D+J)}$("#"+u).fadeIn(B)});break;case 1:$("#"+u).slideUp(B,function(){$("#"+u).empty();$("#"+u).html(K);if(w===1&&m!=1){$("#"+n).html(L+"/"+F);$("#"+E).html(D+J)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+L+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(D+J)}if(m===1){$("#"+E).html(D+J)}$("#"+u).slideDown(B)});break;case 2:$("#"+u).animate({width:"0px",opacity:0.33},B,function(){$("#"+u).empty();$("#"+u).html(K);$("#"+u).animate({width:"100%",opacity:1},B,function(){if(w===1&&m!=1){$("#"+n).html(L+"/"+F);$("#"+E).html(D+J)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+L+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(D+J)}if(m===1){$("#"+E).html(D+J)}})});break;case 3:$("#"+u).html(K);if(w===1&&m!=1){$("#"+n).html(L+"/"+F);$("#"+E).html(D+J)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+L+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(D+J)}if(m===1){$("#"+E).html(D+J)}break;default:$("#"+u).fadeOut(B,function(){$("#"+u).empty();$("#"+u).html(K);if(w===1&&m!=1){$("#"+n).html(L+"/"+F);$("#"+E).html(D+J)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+L+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(D+J)}if(m===1){$("#"+E).html(D+J)}$("#"+u).fadeIn(B)});break}q=setTimeout(k,s,j)});$("#"+d+" #news_prev").click(function(){clearTimeout(q);$(this).attr({src:t});$("#"+d+" #news_next").attr({src:e});$("#"+d+" #news_pause").attr({src:C});j=j-1;if(j<0){j=F-1}var K=j+1;var L=K-2;if(L<0){L=F-1}var J=$("#"+A+" .news_style").eq(j).html();var I=$("#"+A+" .news_style").eq(L).attr("rel");switch(f){case 0:$("#"+u).fadeOut(B,function(){$("#"+u).empty();$("#"+u).html(J);if(w===1&&m!=1){$("#"+n).html(K+"/"+F);$("#"+E).html(z+I)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+K+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(z+I)}if(m===1){$("#"+E).html(z+I)}$("#"+u).fadeIn(B)});break;case 1:$("#"+u).slideUp(B,function(){$("#"+u).empty();$("#"+u).html(J);if(w===1&&m!=1){$("#"+n).html(K+"/"+F);$("#"+E).html(z+I)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+K+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(z+I)}if(m===1){$("#"+E).html(z+I)}$("#"+u).slideDown(B)});break;case 2:$("#"+u).animate({width:"0px",opacity:0.33},B,function(){$("#"+u).empty();$("#"+u).html(J);$("#"+u).animate({width:"100%",opacity:1},B,function(){if(w===1&&m!=1){$("#"+n).html(K+"/"+F);$("#"+E).html(z+I)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+K+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(z+I)}if(m===1){$("#"+E).html(z+I)}})});break;case 3:$("#"+u).html(J);if(w===1&&m!=1){$("#"+n).html(K+"/"+F);$("#"+E).html(z+I)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+K+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(z+I)}if(m===1){$("#"+E).html(z+I)}break;default:$("#"+u).fadeOut(B,function(){$("#"+u).empty();$("#"+u).html(J);if(w===1&&m!=1){$("#"+n).html(K+"/"+F);$("#"+E).html(D+I)}if(w!=1&&m!=1){$("#"+E).empty().html("&nbsp;&nbsp;"+l+""+K+"/"+F+"&nbsp;&nbsp;<br>");$("#"+E).append(z+I)}if(m===1){$("#"+E).html(z+I)}$("#"+u).fadeIn(B)});break}q=setTimeout(i,s,j)});$("#"+d+" #news_pause").click(function(){$(this).attr({src:b});$("#"+d+" #news_next").attr({src:e});$("#"+d+" #news_prev").attr({src:G});clearTimeout(q)});if(H===true){$("#"+u).hover(function(){clearTimeout(q);y=$("#"+d+" #news_next").attr("src");o=$("#"+d+" #news_prev").attr("src");$("#"+d+" #news_pause").attr({src:b});$("#"+d+" #news_next").attr({src:e});$("#"+d+" #news_prev").attr({src:G})},function(){$("#"+d+" #news_pause").attr({src:C});if(y==e&&o==G){q=setTimeout(k,100,j)}if(y==r){q=setTimeout(k,100,j)}if(y==e&&o==t){q=setTimeout(i,100,j)}})}var h=window.setTimeout;window.setTimeout=function(J,K){if(typeof J=="function"){var I=Array.prototype.slice.call(arguments,2);var L=(function(){J.apply(null,I)});return h(L,K)}return h(J,K)};function k(I){if(!I){I=0}myend=$("#"+A+" .news_hide_style").size();myend=myend-1;if(I>=myend){I=0}$("#"+d+" #news_next").eq(I).click();I=I+1}function i(I){if(!I){I=0}myend=$(".news_hide_style").size();myend=myend-1;if(I>=myend){I=0}$("#"+d+" #news_prev").eq(I).click();I=I+1}q=setTimeout(k,s,1)}});
