var intro = 750; var outro = 3500; var metro = 2000; var quick = 500; var slide = 0; var morph = 1500;
var questions = ["Siri, get me a table for two tonight at a good steakhouse", "Siri, who's playing at Madison Square Garden?", "Siri, funny movies playing this weekend near my home", "Siri, call me a cab", "Siri, where’s the nearest Starbucks?", "Siri, will it be sunny tomorrow?", "Siri, AA Flights today from JFK to PDX", "Siri, where can I get Dim Sum around here", "Siri, live music next weekend in Atlanta", "Siri, what’s the name of that Matt Damon movie?", "Siri, where can I find parking near the Boston airport?", "Siri, what’s the weekend forecast in Phoenix?"];
var answers = ["Ok, I found these recommended steak restaurants with open tables for 2 tonight", "I looked for events at Madison Square Garden...here’s what I found", "Here are comedy movies for this weekend playing near your home", "I just need a few details and then I can get you a taxi", "Nearest Starbucks is at 6312 La Vista Dr., Dallas", "Here's the forecast for Chicago, IL (mmm, not so nice... you might want to get out your umbrella!)", "Here's a list of AAL direct flights from JFK to PDX for today from this morning to tonight", "Ok, here are some dim sum restaurants within a few miles of here", "Ok, here are some concerts for this weekend in Atlanta, GA", "Here are movies starring Matt Damon playing near here", "Ok, here are some parking lots within a few miles", "Here's the weather forecast for Phoenix, AZ"];
var categories = ["Restaurant", "Event", "Movie", "Taxi", "Local", "Weather", "Flight", "Restaurant", "Event", "Movie", "Local", "Weather"];

function switchPhonesOut() {
//	if($("#phone1").hasClass('current')) {
//		$("#phone1").removeClass('current'); $("#phone2").addClass('current');
//		$("#phone1").fadeOut(morph); $("#phone2").fadeIn(morph);
//	}
//	else {
		$("#phone2").removeClass('current'); $("#phone1").addClass('current');
		$("#phone2").fadeOut(morph); $("#phone1").fadeIn(morph);
//	}
}
function fadeDialog() {
	$("#question").fadeOut(intro);
	$("#answer").fadeOut(intro);
}
function doSlideAsk() {
	$(".storm").css("backgroundPosition","0 0");
	$("#phone2").fadeOut(0);	
	$("#ask").fadeIn(intro);
	$("#question h5").removeClass(); $("#question h5").toggleClass('q01');
	$("#question h5").html("<i>You ask: "+questions[0]+"</i>");
	$("#question").fadeIn(intro, function(){setTimeout('doSlideAnswer()', metro);});
}
function doSlideAnswer() {
	$("#does").fadeIn(intro);
	$("#answer h5").removeClass(); $("#answer h5").toggleClass('a01');
	$("#answer h5").html("<i>Siri does: "+answers[0]+"</i>");
	$("#answer").fadeIn(intro);
	$("li.act"+categories[0]+" span").fadeIn(intro);
	$("li.act"+categories[0]).animate({
		top:"-20px",
		opacity:"1"
	},intro, "easeOutCirc", setTimeout('doSlideOut()', outro));
}
function doSlideOut() {
	fadeDialog();
	$("li.act"+categories[slide]+" span").fadeOut(intro);
	$("li.act"+categories[slide]).animate({
		top:"0",
		opacity:"0.25"
	},intro, "easeInCirc", setTimeout('doSlideInQ()', intro));
}
function doSlideInQ() {
	++slide;
	if(slide == 11) {slide = 0;}
	if(slide > 8) {var classNumber = (slide + 1) + "";}
	else {var classNumber = "0" + (slide + 1);}
	$("#question h5").removeClass(); $("#question h5").toggleClass('q'+classNumber);
	$("#question h5").html("<i>You ask: "+questions[slide]+"</i>");
	$("#question").fadeIn(intro, function(){setTimeout('doSlideInA()', metro);});
//	if(slide%3 == 0) {switchPhonesOut();}
}
function doSlideInA() {
	if(slide > 8) {var classNumber = (slide + 1) + "";}
	else {var classNumber = "0" + (slide + 1);}
	$("#answer h5").removeClass(); $("#answer h5").toggleClass('a'+classNumber);
	$("#answer h5").html("<i>Siri does: "+answers[slide]+"</i>");
	$("#answer").fadeIn(intro);
	$("li.act"+categories[slide]+" span").fadeIn(intro);
	$("li.act"+categories[slide]).animate({
		top:"-20px",
		opacity:"1"
	},intro, "easeOutCirc", setTimeout('doSlideOut()', outro));
}