
/*
----------------------------------------------------------------------------------------------------
Accessible News Slider
----------------------------------------------------------------------------------------------------
Author:
Brian Reindel, modified and adapted by Andrea Ferracani

Author URL:
http://blog.reindel.com, http://www.micc.unifi.it/ferracani

License:
Unrestricted. This script is free for both personal and commercial use.
*/

jQuery.fn.accessNews = function( settings ) {
settings = jQuery.extend({
headline : "Top Stories",
speed : "normal",
slideBy : 2
}, settings);
return this.each(function() {
jQuery.fn.accessNews.run( jQuery( this ), settings );
});
};

jQuery.fn.accessNews.run = function( $this, settings ) {
jQuery( ".javascript_css", $this ).css( "display", "none" );
var ul = jQuery( "ul:eq(0)", $this );
var li = ul.children();
if ( li.length > settings.slideBy ) {
var $next = jQuery( ".next > a", $this );
var $back = jQuery( ".back > a", $this );
var liWidth = jQuery( li[0] ).width();
var animating = false;
ul.css( "width", ( li.length * liWidth ) );
$next.click(function() {
if ( !animating ) {
animating = true;
offsetLeft = parseInt( ul.css( "left" ) ) - ( liWidth * settings.slideBy );
if ( offsetLeft + ul.width() > 0 ) {
$back.show();
ul.animate({
left: offsetLeft
}, settings.speed, function() {
if ( parseInt( ul.css( "left" ) ) + ul.width() <= liWidth * settings.slideBy ) {
}
animating = false;
});
} else {
animating = false;
}
}
return false;
});
$back.click(function() {
if ( !animating ) {
animating = true;
offsetRight = parseInt( ul.css( "left" ) ) + ( liWidth * settings.slideBy );
if ( offsetRight + ul.width() <= ul.width() ) {
$next.show();
ul.animate({
left: offsetRight
}, settings.speed, function() {
if ( parseInt( ul.css( "left" ) ) == 0 ) {

}
animating = false;
});
} else {
animating = false;
}
}
return false;
});

$next.show();
jQuery(".description").hide();
jQuery('#list').after( [ "<div class=\"view_all\"><span class=\"count\">", , , , " </span></div>" ].join( "" ) );
jQuery( ".back").appendTo('.view_all');
jQuery( ".next").appendTo('.view_all');
var date = jQuery('<div></div>');
var firstimg = jQuery( "ul li:eq(0) img", $this );
img = jQuery('<img></img>')
img.appendTo("#container1");
img.attr('src', firstimg.attr('src'));
para = jQuery('<div></div>');
para.appendTo("#container");
var firstli = jQuery( "#newsslider ul li:eq(0)");
para.html("<h1>" +  jQuery('a.title', firstli ).text() + "</h1>" + "<p id='paraText'>" + jQuery('p.description', firstli).html() + "</p>");
firstli.addClass('selected');
li.hover(
function () {
li.removeClass('selected')
var current = jQuery(this);
current.addClass('selected');
img.attr('src', current.find('img').attr('src'));
para.html("<h1>" +  jQuery('.title', current).text() + "</h1>" + "<p id='paraText'>" + jQuery('.description', current).html() + "</p>");
},
function () {
current.parent().css('backgroundColor', 'transparent');
}
);
}
};


// ................................................ //
function footer(){
	//document.write('');
    	document.write('<div id="productFamilyContent" class="proFmlyContent">');
      	document.write('<div class="subLinks">');
        document.write('<p>Olympics</p>');
        document.write('<a href="http://www.onlinesportsworld.com/london-olympics-2012/olympics-sports-events.html">Olympics Sports Events</a> ');
        document.write('<a href="http://www.onlinesportsworld.com/london-olympics-2012/olympics-flag.html">Olympics Flag</a> ');
        document.write('<a href="http://www.onlinesportsworld.com/london-olympics-2012/olympics-logo.html">Olympics Logo</a>');
        document.write('<a href="http://www.onlinesportsworld.com/london-olympics-2012/olympics-ceremonies.html">Olympics Ceremonies</a> ');
        document.write('<a href="http://www.onlinesportsworld.com/london-olympics-2012/olympics-games-tickets.html">Olympics Games Tickets</a>  ');
		document.write('</div>');
    	document.write('<!-- subLinks -->');
        document.write('<div class="subLinks">');
        document.write('<p>Cricket World Cup</p>');
        document.write('<a href="javascript:void">Schedule / Fixture</a> ');
        document.write('<a href="javascript:void">Teams</a> ');
        document.write('<a href="javascript:void">Venues</a>');
        document.write('<a href="javascript:void">Stadiums</a> ');
        document.write('<a href="javascript:void">Tournament Rules</a>  ');
		document.write('</div>');
    	document.write('<!-- subLinks -->');
        document.write('<div class="subLinks">');
        document.write('<p>Commonwealth Games 2014</p>');
        document.write('<a href="javascript:void">Schedule / Fixture</a> ');
        document.write('<a href="javascript:void">Countries</a> ');
        document.write('<a href="javascript:void">Venues</a>');
        document.write('<a href="javascript:void">Stadiums</a> ');
        document.write('<a href="javascript:void">Tournament Rules</a>  ');
		document.write('</div>');
    	document.write('<!-- subLinks -->');
  	   	document.write('</div><!-- proFmlyContent -->');
	    document.write('<div id="footer-page">');
	    document.write('<p></p>');
        document.write('<a href="http://www.onlinesportsworld.com/">Home &nbsp;|</a>');
        document.write('<a href="javascript:void;">About Us &nbsp;|</a>');
        document.write('<a href="javascript:void;">Contact Us &nbsp;|</a>');
        document.write('<a href="sitemap.xml">Sitemap</a>');
        document.write('<!-- <div class="social_iconbox">');
        document.write('<div class="social_icon"><a href="#"><img src="images/facebook.png" alt="" /></a></div>');
        document.write('<div class="social_icon"><a href="#"><img src="images/twitter.png" alt="" /></a></div>');
        document.write('<div class="social_icon"><a href="#"><img src="images/linkedin.png" alt="" /></a></div>');
       	document.write('<div class="social_icon"><a href="#"><img src="images/rss.png" alt="" /></a></div>');
        document.write('</div>');
     	document.write('-->');
       	document.write('<div class="powered">');
        document.write('<span>Powered by</span>');
        document.write('<div class="powered_logo"><a href="http://www.rudraitservices.com/" style="margin-left:0px; margin-right:0px; margin-top:0px; padding-left:0px; margin-right:]0px;"><img src="http://www.onlinesportsworld.com/images/powered.png" alt="Rudra IT Services." /></a>');
      	document.write('</div>');
        document.write('</div>');
    	document.write('<!-- powered -->');
    	document.write('</div>');
    	document.write('<!-- footer-page -->');
}
// ................................................ //

