var isNotShit = ( !$.browser.msie || ($.browser.msie && parseInt($.browser.version) > 8))

$(document).ready(function(){
	//menu animations
	$('#menu li a').click(function(){
		var href = $(this).attr('href');
		scrollToPage(href);
		return false;
	});
	
	
	
	parseRSS();
	/*$("a, img, .tip").not('.footer a').tipTip({
		fadeIn:200,
		fadeOut: 400,
		delay: 10
	});*/
    
});

function getOrder(selector,oThis){
	var order = 1;
	var i = 1;
	$(selector).each(function(){
		if($(this).is($(oThis))){
			order= i;
			return;
		}
		i++;
	});
	
	return order;
}

function parseRSS(url, callback) {
	$.get('/system/pages/getRemoteRss/',{feed:'http://mycz.tumblr.com/rss'},function(xml){ 
		$('.blog-box .pr28').html('');
		$('item',xml).each(function(){
			$('.blog-box .pr28').append('<a href="'+$(this).find('link').text()+'" class="item" title="'+$(this).find('title').text()+'">'+$(this).find('title').text()+'</a>');
		});
		$.post('/system/pages/saveFeed/',{feed:$('.blog-box .pr28').html()},function(data){});
	});
	
}

function scrollToPage(href){
	var nextPageTop = $(href).offset().top-80;

	$("html, body").animate({
		"scrollTop": nextPageTop
	},{
		"complete": function(){
			
		}
	},1800);
	
	return true;
}
