$(document).ready(function() {
	$.Juitter.start({
		searchType:"fromUser", // needed, you can use "searchWord", "fromUser", "toUser"
		searchObject:"BGEHurlingU21", // needed, you can insert a username here or a word to be searched for, if you wish multiple search, separate the words by comma.

		// The values below will overwrite the ones on the Juitter default configuration. 
		// They are optional here.
		// I'm changing here as a example only
		lang:"en", // restricts the search by the given language
		live:"live-15", // the number after "live-" indicates the time in seconds to wait before request the Twitter API for updates.
		placeHolder:"juitterContainer", // Set a place holder DIV which will receive the list of tweets example <div id="juitterContainer"></div>
		loadMSG: "Loading messages...", // Loading message, if you want to show an image, fill it with "image/gif" and go to the next variable to set which image you want to use on 
		//imgName: "loader.gif", // Loading image, to enable it, go to the loadMSG var above and change it to "image/gif"
		total: 1, // number of tweets to be show - max 100
		readMore: "Read more", // read more message to be show after the tweet content
		nameUser:"none", // insert "image" to show avatar of "text" to show the name of the user that sent the tweet 
		openExternalLinks:"newWindow" // here you can choose how to open link to external websites, "newWindow" or "sameWindow"
          
	});
	
	jQuery("#enterprediction").validate({
		invalidHandler: function(e, validator) {
			var errors = validator.numberOfInvalids();
			if (errors) {
				var message = errors == 1
					? 'You have not selected 1 compulsory field'
					: 'You have not selected ' + errors + ' compulsory fields';
				jQuery("div.error span").html(message);
				jQuery("div.error").show("slow");
			} else {
				jQuery("div.error").hide("slow");
			}
		},		
		rules: {
			joesverdict: "required",
			gersverdict: "required",
			joesmargin: "required",
			gersmargin: "required"
		}, 
		messages:{
			joesverdict: "You have not entered a verdict for Joe",
			gersverdict: "You have not entered a verdict for Ger",
			joesmargin: "You have not entered a points margin for Joe",
			gersmargin: "You have not entered a points margin for Ger"
		}
	});

	/*$('a.iframe2').fancybox({
		'hideOnContentClick' : false,
		'width': 560,
		'height': 425,
		'autoDimensions': false
	});*/
	
	jQuery('a.iframe').fancybox({
		'hideOnContentClick' : false,
		'width': 560,
		'height': 425
	});
	
	jQuery('.predictions').jqTransform({imgPath:'../images/quiz/'});
	
	//$('#sysmsg').hide(4000);

	$('#sysmsg').slideUp(3000).delay(8000).fadeOut(200);
});

