web/static/res/js/incchoice.js
changeset 46 542252e0c615
parent 45 f7bfdc49982b
child 48 d92196482ad9
--- a/web/static/res/js/incchoice.js	Tue Dec 11 21:13:42 2012 +0100
+++ b/web/static/res/js/incchoice.js	Wed Dec 12 03:10:24 2012 +0100
@@ -32,10 +32,8 @@
 			$("#mot5").html("dieu");
 			$("#mot6").html("president");
 
-			// Set images for effect
-			//incMosaic.clear();
-	        //incMosaic.addImageUrl("static/res/img/" + this.image1);
-	        //incMosaic.addImageUrl("static/res/img/" + this.image2);
+			// class
+			// by default there is the calss blue
 
 		} else if (choiceIndex == 1) {
 			$("#mot1").html("actif");
@@ -45,10 +43,8 @@
 			$("#mot5").html("patrie");
 			$("#mot6").html("politique");
 
-			// Set images for effect
-			//incMosaic.clear();
-	        //incMosaic.addImageUrl("static/res/img/" + this.image2);
-	        //incMosaic.addImageUrl("static/res/img/" + this.image3);
+			// class
+			$("#choix").removeClass("blue").addClass("white");
 
 		} else {
 			$("#mot1").html("spleen");
@@ -58,13 +54,9 @@
 			$("#mot5").html("desir");
 			$("#mot6").html("bonheur");
 
-			// Set images for effect
-			//incMosaic.clear();
-	        //incMosaic.addImageUrl("static/res/img/" + this.image3);
-	        //incMosaic.addImageUrl("static/res/img/" + this.image1);			
+			// class
+			$("#choix").removeClass("white").addClass("red");
 		}
-
-	    //incMosaic.start("mosaic", effectSpeed, 9, 5, false, true, function() {incChoice.effectIsDone();});        					
 	};
 
 	this.selectWord = function(wordIndex)
@@ -98,18 +90,23 @@
 		incMosaic.UnpauseEffect(false);
 
 		// Fade the text
-		$('.big_txt').animate({opacity: 1}, 20000 * 1 / effectSpeed);
+		$('.big_txt').animate({opacity: 1}, 10000 * 1 / effectSpeed);
 
 		if (this.currentWorldIndex == 3) {
 			// The 3 words get choosen
 			location.href = "niv1_videoplayer.html";
 		}
-	}
+	};
+
+	this.getChoosenWords = function()
+	{
+		return [this.getCookie("niv1_world0"), this.getCookie("niv1_world1"), this.getCookie("niv1_world2")];
+	};
 
 	this.setCookie = function(name, value)
 	{
 		$.removeCookie(name);
-		$.cookie(name, value, { expires: 7, path: '/' });    	
+		$.cookie(name, value, { expires: 7, path: '/' }); 
     };
 
 	this.getCookie = function(name) {