var resizeCallback = function() {
	var width = $(window).width();
	$('body').css('width', width);
	var offset = Math.floor((width - ($('#ss_frame').width() + $('#content').width())) / 2);
	$('#ss_frame').css('left',  function(index, value) {
		var newValue = offset - 30;
		if (newValue > -50) {
			return newValue;
		}
		return value;	
	});
	$('#content').css('margin-left',  function(index, value) {
		var newValue = offset + 330;
		if (newValue > 310) {
			return newValue;
		}
		return value;				
	});
	$('#iPhone').css('left',  function(index, value) {
		var newValue = offset + 60;
		if (newValue > 40) {
			return newValue;
		}
		return value;
	});
};

var onLoadCallback = function() {
	var width = $(window).width();
	$('body').css('width', width);
	var offset = Math.floor((width - ($('#ss_frame').width() + $('#content').width())) / 2);
	$('#ss_frame').css('left',  function(index, value) {
		return parseFloat(value) + offset;
	});
	$('#content').css('margin-left',  function(index, value) {
		return parseFloat(value) + offset;
	});
	$('#iPhone').css('left',  function(index, value) {
		return parseFloat(value) + offset;
	});

	$('#iPhone').cycle({
		fx: 'fade',
		speed: 1000,
		pause: true
	});
};
