/*
 * \brief jquery/javascript functions for cb-translations.com
 * \author ros
 * \date 13-Jul-2011
 */ 


$(document).ready(function() {
    $('#contactUs').click(function() {
         $('#dialog').dialog({modal: true});
    });
});
   
$(document).ready(function() {

        var aLanguages = [ 'English', 'French', 'Spanish' ];

        var words = new Array();

        words['English'] = new Array ('at home', 'a friend', 'happy', 'work', 'a child', 'tomorrow', 'today',
                                  'now', 'the weather', 'great', 'a car', 'to eat', 'meat', 'to drink',
                                  'I like', 'I love', 'fish', 'a dog', 'a company', 'my husband', 'my wife',
                                  'Monday', 'the summer', 'the holidays'
                       );

        words['French'] = new Array ('&#224; la maison', 'un ami', 'content(e)', 'le travail', 'un enfant', 'demain', "aujourd'hui",
                                 'maintenant', 'le temps', 'super', 'une voiture', 'manger', 'la viande', 'boire',
                                 "j'aime", "j'adore", 'le poisson', 'un chien', 'une entreprise', 'mon mari', 'ma femme',
                                 'lundi', "l'&#232;t&#232;", 'les vacances'
                       );

        words['Spanish'] = new Array ('en casa', 'un amigo/una amiga', 'contento/a', 'el trabajo', 'un ni&#241;o/una ni&#241;a', 'ma&#241;ana',
                                  'hoy', 'ahora', 'el tiempo', 'estupendo', 'un coche', 'comer', 'la carne', 'beber',
                                  'me gusta', 'me encanta', 'el pescado', 'un perro', 'una empresa', 'mi marido', 'mi esposa',
                                  'lunes', 'el verano', 'las vacaciones' );

        var iSize = words['English'].length;
        var iRand = Math.floor(Math.random()*iSize);

        jQuery.each( aLanguages,
            function(key, value) {
                var sText = value + ' : ' + words[value][iRand] + '<br>';
                $("div#potd" + value).html(sText);
            }
        );
        }
    );

