$(document).ready(function() {

	$('#arrow-left').click(function sx() {
		var y = $('#focus ul').css('left');
		var yy = (y.substring(0,y.length-2))/768;
		if (yy < 0) {
			$('#focus ul').animate({left: "+=768px"});
		    return false;
		}	
	});
	
	$('#arrow-right').click(function dx() {
		var childCount = $('#focus ul li').length;
		var gall_width = ((childCount) * -192 / 768)+1;
		var y = $('#focus ul').css('left');
		var yy = (y.substring(0,y.length-2))/767;
		if (yy > gall_width) {
			$('#focus ul').animate({left: "-=768px"});
		    return false;
		}
	});

$.jGFeed('http://www.completence.com/CLAll/06rss/feed/novita.xml',
function(feeds){
  // Check for errors
  if(!feeds){
    // there was an error
    return false;
  }
  // do whatever you want with feeds here
  for(var i=0; i<feeds.entries.length; i++){
    var entry = feeds.entries[i];
    // Entry title
var entrydate=new Date(feeds.entries[i].publishedDate); //get date of entry
var entrydatestr=' '+entrydate.getDate()+"/"+(entrydate.getMonth()+1)+"/"+entrydate.getFullYear();
var title = entry.title;
var link = entry.link;
var description = entry.content;
	$('#news-01 div').append('<p><a href="'+link+'" target="_blank"> > '+title+'</a><br />'+entrydatestr+'</p>');
  }
});
$.jGFeed('http://gdata.youtube.com/feeds/base/users/rosimp/uploads?alt=rss&amp;v=2&amp;orderby=published&amp;client=ytapi-youtube-profile',
function(feeds){
  // Check for errors
  if(!feeds){
    // there was an error
    return false;
  }
  // do whatever you want with feeds here
  for(var i=0; i<feeds.entries.length; i++){
    var entry = feeds.entries[i];
    // Entry title
var entrydate=new Date(feeds.entries[i].publishedDate); //get date of entry
var entrydatestr=' '+entrydate.getDate()+"/"+(entrydate.getMonth()+1)+"/"+entrydate.getFullYear();
var title = entry.title;
var link = entry.link;
var description = entry.content;
	$('#news-02 div').append('<p><a href="'+link+'" target="_blank"> > '+title+'</a><br />'+entrydatestr+'</p>');
  }
});

});

