/*
	Form Field Value Swap
*/
    
    
$(function() {

	swapValues = [];
	$(".clearform").each(function(i) {
		swapValues[i] = $(this).val();
		$(this).focus(function() {
			if ($(this).val() == swapValues[i]) {
				$(this).val("");
			}
		}).blur(function(){
			if ($.trim($(this).val()) == "") {
				$(this).val(swapValues[i]);
			}
		});
			
		
	 });

 
});

/*
	Champ de recherche google
*/
// 		 $('.googlebox').submit(function(){
// 	
// 		if ($('input.empty', this).val() == "" || $('input.empty',this).val() == "explorer les portails suisses avec Google") {
// 			alert('Vous devez taper des mots clés dans le champ de recherche');
// 			return false;
// 		}	
// 		    
// 	});
// });
	

   /*
        Confirmation de suppression
    */
    
$(document).ready(function(){
     $(".supprimer").click( function(event) {
	 if (confirm('Etes-vous certain de vouloir supprimer cette info ?!')==false)
 	{
  	return false;
  	}
 });
 });

/*
	Options form
*/

$(document).ready(function(){

     $('p').filter("[@id^=options]").toggle( function() {
       var myId='#' + $(this).attr("id");
  		var idreg = new RegExp( "[0-9]+", "g" ) ;
  		var idoption = myId.match(idreg);
  		$('#formCache' + idoption).css({'display':'block'}) }, function () {
  		var myId='#' + $(this).attr("id");
  		var idreg = new RegExp( "[0-9]+", "g" ) ;
  		var idoption = myId.match(idreg);
	 $('#formCache' + idoption).css({'display':'none'})
 });
 });