$(function(){
		   
	Cufon.replace($('.sf-menu a'), { 
		fontFamily: 'Myriad Pro', 
		textShadow: '1px 1px #FFFFFF',
		fontSize: '18px',
		color: '#84888C',
		hover: {		
			color: '#F27A1E'		
		} 
		});	
	 
	Cufon.replace($(':header'), { 
		fontFamily: 'Cantarell',
		color: '#87888E'
		
		});
		Cufon.replace($('.post_date'), { 
		fontFamily: 'Cantarell',
		color: '#BBBCBE'
		});     

	$('.navigation div').addClass('pages');		
	$(".pages").corner({tl:{radius: 4}, tr:{radius:4}, bl:{radius: 4}, br:{radius:4},  antiAlias:true,  autoPad: true});  

		$('.pages a').each(function() {
var hreflink = $(this).attr("href");
if (hreflink.toLowerCase()==location.href.toLowerCase()) {
	$(this).removeAttr('href').parent().addClass('selected');
	
}
});
		
		
		
		
	
		var twitter_user = 'your twitter account';
		var flickr_user = 'your flickr account';
		
		
		
/*		   
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?ids="+flickr_user+"&lang=en-us&format=json&jsoncallback=?", function(data){
	  $.each(data.items, function(index, item){
	             
		if (index >8){return false;}
		$("<img/>").attr("src", item.media.m).appendTo("#flickr").wrap("<div class='img_frame_min'><a href='" + item.link + "'></a></div>");	
		  	  
		$('.img_frame_min img').hover(
  				function () {$(this).stop().css('zIndex','1000').animate({width: 180, height:180, marginTop:-55,marginLeft:-55 }, 500);},
				function () {$(this).stop().css('zIndex','986').animate({width: 70, height:70,marginTop:0,marginLeft:0 }, 500, function () {$(this).css('zIndex','985');});}
  
		);
	});
});

*/

     

//$.getJSON('http://twitter.com/status/user_timeline/'+twitter_user+'.json?count=10&callback=?', function(data){
//		$.each(data, function(index, item){
//							  
//		if (index >7){return false;}
//			$('#twitter').append('<li class="tweet">'  /*relative_time(item.created_at)*/ + item.text.linkify() + '</li>');		
//	
//			});
//	
//	$('.tweet:last').after('<li id="tweet_last"></li>'); 
//	
//});		  
	
//		function relative_time(time_value) {
//	  var values = time_value.split(" ");
//	  time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
//	  var parsed_date = Date.parse(time_value);
//	  var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
//	  var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
//	  delta = delta + (relative_to.getTimezoneOffset() * 60);
//	  
//	  var r = '';
//	  if (delta < 60) {
//		r = 'a minute ago';
//	  } else if(delta < 120) {
//		r = 'couple of minutes ago';
//	  } else if(delta < (45*60)) {
//		r = (parseInt(delta / 60)).toString() + ' minutes ago';
//	  } else if(delta < (90*60)) {
//		r = 'an hour ago';
//	  } else if(delta < (24*60*60)) {
//		r = '' + (parseInt(delta / 3600)).toString() + ' hours ago';
//	  } else if(delta < (48*60*60)) {
//		r = '1 day ago';
//	  } else {
//		r = (parseInt(delta / 86400)).toString() + ' days ago';
//	  }
//	  
//	  return r; 
//	}	
	String.prototype.linkify = function() {
		return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/, function(m) {
			return m.link(m);
		});
	};	  
	
		
	
		  

$('#icons li').clone().appendTo('#icons').wrapAll('<ul id="icons_wpap"></ul>'); 
 
$('#icons img').hover(						  
					function(){$(this).stop().animate({'opacity': 0 }, 600);},	  
					function(){$(this).stop().animate({'opacity': 1}, 600);}
				);
	
	
	  
$('#search_input').focus( function () {$('#search').css({ 'backgroundPosition': '0 -42px' });});
$('#search_input').blur( function () {$('#search').css({ 'backgroundPosition': '0 -4px' });});
		
		

$('.gall_b').hover(
			function(){$(this).stop().animate({height:'200px'});}, 
			function() {$(this).stop().animate({height:'120px'});}
			);
		
		
	  
//$('ul.sf-menu').superfish();
//$('.sf-menu > li > ul > li:last-child').addClass('b_ll').after('<li class="bottom_main"></li>');
//$('.sf-menu > li > ul > li > ul > li:last-child').addClass('b_ll').after('<li class="bottom_sub"></li>');
			
    
$('#sidebar_r ul li').prepend('<div class="bg_arrow"></div>');



$('.foot_box ul li:last-child:lt(2)').after('<li>');
$('#sidebar_r ul li:last-child').after('<li>');
			
twitter_scroll.init();
			
});


var twitter_scroll = {
	init: function() {
		$.fn.hoverscroll.params = $.extend($.fn.hoverscroll.params, {
			debug: false
		});
		
		
		$('#twitter').hoverscroll({
			vertical: true,
			width: 220,
			height: 152
		});
		
		
		
		
	}
};
		
		
		
		
