
// Don't steal, be inspired!


$(document).ready(function(){
		
	//$("#cardWrap").hide();

	//$("#cardWrap").delay(2000).animate({
	
	  //  'height' : 'toggle',
	  //  'opacity' : 'toggle'
	
	//}, 1000);
	
	
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
    	if (document.cookie.indexOf("iphone_redirect=false") == -1) window.location = "http://iphone.johnie.se"; 
    }
});
		
$(function() {

  $(".icon_margin").fadeTo(100, 0.5);
  
  $(".icon_margin").hover(function(){
  
  	$(this).stop().animate({
  	
  		'opacity' : '1',
  	
  	}, 250);
  
  }, function(){
  
  	$(this).stop().animate({
  	
  		'opacity' : '0.5',
  	
  	}, 250);
  
  });
  
  $('#socialbar a').click(function(){
        window.open(this.href);
        return false;
    });
  		
});

$(function(){

	$(".hiring").click(function(){
	
		$("#email").effect('shake', { times:3 }, 200);
		
	});

});

$(function(){

	$("#biggerJ").draggable();

	$("#johnie").click(function(){
	
		$("#biggerJ").fadeIn("slow");
	
	});
		
		$("#biggerJ").click(function(){
	
			$(this).fadeOut("slow");
			
		});
	
	$(window).resize(function(){
  
	  $("#biggerJ").css({
	    
	    position: 'absolute',
	    left: ($(window).width() - $("#biggerJ").outerWidth())/2,
	    top: ($(window).height() - $("#biggerJ").outerHeight())/2
	    
	  });
	  
	});
	
	$(window).resize();

});

$(function(){

	$.getJSON("http://twitter.com/statuses/user_timeline/johniehoney.json?callback=?", function(data) {
	     $("#tweets").html(data[0].text);
	});

});














/*$(document).ready(function(){
	
	if(navigator.userAgent.match(/iPhone/i)){
		window.location = "http://johnie.se";
	}
		
	// SLIDER
	
	// UP
	
	$("#usethenav").hide();
	
	$("#usethenav").fadeIn(1000);
	
	$("#home .down").click(function(){
		$("#usethenav").fadeOut(1000);	
	});
	
	$("#aboutme .up").click(function(){
		$('#scroll').animate({
			'margin-top' : '0px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | Simple is beautiful";
	});
	
	$("#aboutjw .up").click(function(){
		$('#scroll').animate({
			'margin-top' : '-240px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | about me";
	});
	
	$("#portfolio .up").click(function(){
		$('#scroll').animate({
			'margin-top' : '-480px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | about Johnie Webdesign";
	});
	
	$("#findme .up").click(function(){
		$('#scroll').animate({
			'margin-top' : '-720px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | my portfolio";
	});
	
	
	// DOWN
	
	$("#home .down").click(function(){
		$("#scroll").animate({
			'margin-top' : '-240px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | about me";
	});
	
	$("#aboutme .down").click(function(){
		$("#scroll").animate({
			'margin-top' : '-480px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | about Johnie Webdesign";
	});
	
	$("#aboutjw .down").click(function(){
		$("#scroll").animate({
			'margin-top' : '-720px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | my portfolio";
	});
	
	$("#portfolio .down").click(function(){
		$("#scroll").animate({
			'margin-top' : '-960px'
		}, 1000, 'swing');
		document.title = "Johnie Webdesign | find me elsewhere";
	});
				
}); */