test/emission_fichiers/rollover.js
changeset 0 c357d5b60635
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/emission_fichiers/rollover.js	Fri Feb 11 14:02:37 2011 +0100
@@ -0,0 +1,29 @@
+  $(document).ready(function(){  
+    
+	    $('.rollover').hover(function(){
+        if($(this).attr("src").indexOf("-hover") == -1) {
+			var newSrc = $(this).attr("src").replace(".png","-hover.png");
+			$(this).attr("src",newSrc);}},
+	function(){
+            if($(this).attr("src").indexOf("-hover.png") != -1) {
+					var oldSrc = $(this).attr("src").replace("-hover.png",".png");
+					$(this).attr("src",oldSrc);}
+                                        });
+            
+            $('input[type="text"]').addClass("idleField");  
+            $('form:not([id="user-profile-form"]) input[type="text"]').focus(function() {
+        $(this).removeClass("idleField").addClass("focusField");  
+        if (this.value == this.defaultValue){  
+            this.value = '';  
+         }
+        if(this.value != this.defaultValue){  
+            this.select();  
+        }  
+    });  
+    $('input[type="text"]').blur(function() {  
+        $(this).removeClass("focusField").addClass("idleField");  
+        if (this.value == ''){  
+            this.value = (this.defaultValue ? this.defaultValue : '');  
+        }  
+    });   
+});