/* javascript container for Consulting page */

Array.prototype.shuffle = function() {
var s = [];
while (this.length) s.push(this.splice(Math.random() * this.length, 1));
while (s.length) this.push(s.pop());
return this;
}

qLooper = new Object();
	qLooper.qList = new Array();
	qLooper.qList[0] = "What does my business look like from a mobile device?";
	qLooper.qList[1] = "What does a mobile advertising campaign look like?";
	qLooper.qList[2] = "How does the mobile space factor into my marketing campaign?";
	qLooper.qList[3] = "Is there really a practical use for Facebook or Twitter in business?";
	qLooper.qList[4] = "Besides the big 3 (Facebook, Twitter, LinkedIn), what other social media services are out there, and how can my business use them effectively?";
	qLooper.qList[5] = "What are some advantages to QR / DataMatrix codes, and how can I deploy them and track their effectiveness?";
	qLooper.qList[6] = "Are my salespeople using my website as one of their primary tools?";
	qLooper.qList[7] = "How can I measure the effectiveness of my campaigns on the web?";
	qLooper.qList[8] = "Where can I get my hands on market research, stats and figures about mobile browsing?";
	qLooper.qList[9] = "Is my website future-proofed for mobile devices and touch gestures?";
	qLooper.qList[10] = "How big a footprint do I have across the web, and how well is it managed?";
	qLooper.qList[11] = "How have social media and mobile browsing changed SEO?";
	qLooper.qList[12] = "Is it true that Macs don't have viruses?";
	qLooper.qList[13] = "Can I replace my laptop with an iPad?";
	qLooper.qList[14] = "Where can I get training courses on iPhone or iPad apps, with a focus on business?";
	qLooper.qList[15] = "What are the most useful apps for business?";
	qLooper.qList[16] = "Can I integrate iPhones and iPads with my Microsoft Exchange server?";
	qLooper.qList[17] = "How much will it cost to switch my office to Macs?";
	qLooper.qList[18] = "Are Macs compatible with PCs?  What about running Windows software?";
	qLooper.qList[19] = "Does Apple make servers?  Can I run my business from a Mac server?";
	qLooper.qList[20] = "What is NFC, and how can it make me money?";
	qLooper.qList[21] = "Can my employees use iPhones without having iTunes installed?";
	qLooper.qList[22] = "Can I limit what kind of content my employees can access with an iPhone?";
	qLooper.qList[23] = "Isn't the iPad just a big iPhone?  How can it make my employees more productive?";
	qLooper.qList[24] = "Are Macs more expensive than PCs?  I've heard they cost less to support.";
	qLooper.qList[25] = "Can I run accounting software on a Mac?";
	qLooper.qList[26] = "Can my employees access shared documents using an iPad in the field?";
	qLooper.qList[27] = "Do I need a full time employee to manage IT?";
	qLooper.qList[28] = "Is it true that iPads don't need 3G data contracts?";
	qLooper.qList[29] = "How secure is an iPhone?  Can I remote wipe one if it gets stolen?";
	qLooper.qList[30] = "Aren't Apple products just for hipsters and people concerned with their image?";
	qLooper.qList[31] = "Is it possible to have a paperless office?  Seriously.";
	qLooper.qList[32] = "Does Android have viruses?  Can I get a virus by downloading apps?";
	qLooper.qList[33] = "What is the Apple TV?  Is it just for entertainment?";
	qLooper.qList[34] = "Will Apple keep inventing revolutionary technology without Steve Jobs?";
	qLooper.qList[35] = "Who's going to win the lawsuit between Oracle and Google?";
	qLooper.qList[36] = "What's the difference between all the Android phones and tablets?";
	qLooper.qList[37] = "How many countries can Apple buy with its cash reserves? Seriously.";
	qLooper.qList[38] = "Will the iPad ever play Adobe Flash?";
	qLooper.qList[39] = "How much does it cost to develop a mobile website?";
	qLooper.qList[40] = "Does my business need its own app?";
	qLooper.qList[41] = "What's the best place to eat on Barrington Street?";
	qLooper.qList[42] = "What's the noon gun?";
	qLooper.qList[43] = "What's this I hear about 'Beer Friday'?";
	qLooper.qList[44] = "What's the best TV show I've never heard of?";
	qLooper.qList[45] = "How many Mac users does it take to install Windows?";
	qLooper.qList[46] = "Where can I get half-price Scotch every Wednesday?";
	qLooper.qList[47] = "Can Mac OS X Server function as a node for Active Directory?";
	qLooper.qList[48] = "Why would I use reverse proxy SSL vs. VPN?";
	qLooper.qList[49] = "How many of Nielsen's heuristics does my website unabashedly violate?";
	qLooper.qList[50] = "Why is Adobe Flash a dead technology?";
	qLooper.qList[51] = "Why do Macs dominate film and television?";
	qLooper.qList[52] = "Aren't Macs just for designers and creative types?";
	qLooper.qList[53] = "Besides rock concerts, what makes grown adults stand in line?";
	qLooper.qList[54] = "Besides rock concerts, what else makes Halifax lose money?";
	qLooper.qList[55] = "Is there an app to make Peter Kelly tell the truth?";
	qLooper.qList[56] = "How many Nova Scotia MLAs have a background in ICT?";
	qLooper.qList[57] = "What's with the gigantic hole in the ground by your office?";
	qLooper.qList[58] = "Is the Heritage Trust happy with the 'rubble and ruins' look on Argyle Street?";
	qLooper.qList[59] = "Has connectivism matured as a pedagogical theory yet?";
	qLooper.qList[60] = "Tumblr or Posterous?";
	qLooper.qList[61] = "Instapaper or Read It Later?";
	qLooper.qList[62] = "What's the best e-Learning platform on the market?";
	qLooper.qList[63] = "Eventbrite or Upcoming?";
	qLooper.qList[64] = "Does a burr grinder really make a difference?";
	qLooper.qList[65] = "Do all programmers live in caves?";
	qLooper.qList[66] = "Are first names with three letters generally easier or harder to pronounce?";
	qLooper.qList[67] = "Does Chris Marriott own any hotels, or is he not a billionaire like I've heard?";
	qLooper.qList[68] = "Is it true that one of your clients' names is Baron Von Deinish?";
	qLooper.qList[69] = "I'm looking for a decent martini in Halifax. Suggestions?";
	
	qLooper.qList.shuffle();
	qLooper.next = function(){
		$('q_detail').fade(
			{
				duration: 0.2, 
				queue: 'end',
				afterFinish: function(){
					obj = this.qList.shift();
					this.qList.push(obj);
					qBlock = "<p>" + this.qList[0] + "</p>";
					$('q_detail').innerHTML = qBlock;
					$('q_detail').appear({duration: 0.2, queue: 'end'});
					qtn = this.qList[0];
					updateShareButtons(qtn);
				}.bind(this)
			});
		
	}
	qLooper.prev = function(){
		$('q_detail').fade(
			{
				duration: 0.2, 
				queue: 'end', 
				afterFinish: function(){
					obj = this.qList.pop();	
					this.qList.unshift(obj); 
					qBlock = "<p>" + this.qList[0] + "</p>";	
					$('q_detail').innerHTML = qBlock;
					$('q_detail').appear({duration: 0.2, queue: 'end'});
					qtn = this.qList[0];
					updateShareButtons(qtn);
				}.bind(this)
			});		
	}
	

function launchTwitterShare(query){
	//variables for updating Twitter
	 var url = "http://www.torusoft.com";
	 var via = "Torusoft";
		window.open("http://twitter.com/share?url="+url+ "&via=Torusoft&text=\'"+unescape(query)+"\'", 'share', 'height=500,width=500,resizable=0,toolbars=0,status=0');
	}


function updateShareButtons(wat){
		
	 //variable for email
	 var subject = "Just wondering..."
	
	$('updateFacebook').innerHTML = "<a id='facebookSprite' href='#' onclick='postFBStatus(\"" + escape(wat) + "\");' onmouseover='btnHover(\"updateFacebook\");' onmouseout='btnOut(\"updateFacebook\");'>Facebook</a>"; //"<a id='facebookSprite' href='http://www.facebook.com/dialog/feed?app_id="+aid+"&redirect_uri="+ruri+"&message="+msg+"&display=iframe' target='fbcontainer'>Facebook</a>";
 	$('updateTweet').innerHTML = "<a id='twitterSprite' href='#' onclick='launchTwitterShare(\"" + escape(wat) + "\");' onmouseover='btnHover(\"updateTweet\");' onmouseout='btnOut(\"updateTweet\");'>Tweet</a>";
	/*$('updateEmail').innerHTML = "<a id='emailSprite' href='mailto:?subject="+subject+"&body="+escape(wat)+"' onmouseover='btnHover(\"updateEmail\");' onmouseout='btnOut(\"updateEmail\");'>Email</a>";*/
	$('getAnswerdiv').innerHTML = "<a id='getAnswer' href='mailto:?to=info@torusoft.com&subject="+subject+"&body="+escape(wat)+"' onmouseover='btnHover(\"getAnswerdiv\");' onmouseout='btnOut(\"getAnswerdiv\");'>Email</a>";
}

function updateShareButtons2(){
	
	var ask = "Besides the big 3 (Facebook, Twitter, LinkedIn), what other social media services are out there, and how can my business use them effectively?";	
	 //variable for email
	 var subject = "Just wondering..."
	
	$('updateFacebook2').innerHTML = "<a id='facebookSprite2' href='#' onclick='postFBStatus(\"" + escape(qLooper.qList[0]) + "\");' onmouseover='btnHover(\"updateFacebook2\");' onmouseout='btnOut(\"updateFacebook2\");'>Facebook</a>"; //"<a id='facebookSprite' href='http://www.facebook.com/dialog/feed?app_id="+aid+"&redirect_uri="+ruri+"&message="+msg+"&display=iframe' target='fbcontainer'>Facebook</a>";
 	$('updateTweet2').innerHTML = "<a id='twitterSprite2' href='#' onclick='launchTwitterShare(\"" + escape(qLooper.qList[0]) + "\");' onmouseover='btnHover(\"updateTweet2\");' onmouseout='btnOut(\"updateTweet2\");'>Tweet</a>";
	$('updateEmail2').innerHTML = "<a id='emailSprite2' href='mailto:?subject="+subject+"&body="+escape(qLooper.qList[0])+"' onmouseover='btnHover(\"updateEmail2\");' onmouseout='btnOut(\"updateEmail2\");'>Email</a>";
	/*$('getAnswerdiv').innerHTML = "<a id='getAnswer' href='mailto:?to=info@torusoft.com&subject="+subject+"&body="+escape(wat)+"' onmouseover='btnHover(\"getAnswerdiv\");' onmouseout='btnOut(\"getAnswerdiv\");'>Email</a>";*/
}


postIt = {};
postIt.index = 0;
postIt.delay = 5000;
postIt.start = function(){postIt.intervalID = setInterval('postIt.swapFade()',postIt.delay);}
postIt.buttons = false;
postIt.initialize = function(){
	this.start();
}
postIt.swapFade = function(){

	$('q_detail2').fade(
			{
				duration: 0.2, 
				queue: 'end',
				afterFinish: function(){
					qBlock = "<p>" + qLooper.qList[this.index] + "</p>";
					$('q_detail2').innerHTML = qBlock;
					$('q_detail2').appear({duration: 0.2, queue: 'end'});
					this.updateShares();
					this.index++;
					if (this.index == (qLooper.qList.length)) {this.index = 0;};
				}.bind(this)
			});

	
}
postIt.updateShares=function()
	{
	var ask = qLooper.qList[this.index];
	 //variable for email
	 var subject = "Just wondering..."
	
	$('updateFacebook2').innerHTML = "<a id='facebookSprite2' href='#' onclick='postFBStatus(\"" + escape(qLooper.qList[this.index]) + "\");' onmouseover='btnHover(\"updateFacebook2\");' onmouseout='btnOut(\"updateFacebook2\");'>Facebook</a>"; //"<a id='facebookSprite' href='http://www.facebook.com/dialog/feed?app_id="+aid+"&redirect_uri="+ruri+"&message="+msg+"&display=iframe' target='fbcontainer'>Facebook</a>";
	$('updateTweet2').innerHTML = "<a id='twitterSprite2' href='#' onclick='launchTwitterShare(\"" + escape(qLooper.qList[this.index]) + "\");' onmouseover='btnHover(\"updateTweet2\");' onmouseout='btnOut(\"updateTweet2\");'>Tweet</a>";
	$('updateEmail2').innerHTML = "<a id='emailSprite2' href='mailto:?subject="+subject+"&body="+escape(qLooper.qList[this.index])+"' onmouseover='btnHover(\"updateEmail2\");' onmouseout='btnOut(\"updateEmail2\");'>Email</a>";
	/*$('getAnswerdiv').innerHTML = "<a id='getAnswer' href='mailto:?to=info@torusoft.com&subject="+subject+"&body="+escape(wat)+"' onmouseover='btnHover(\"getAnswerdiv\");' onmouseout='btnOut(\"getAnswerdiv\");'>Email</a>";*/
}

