// JavaScript Document // shortcut for the $(document).ready(callback) notation $(function() {$("li:has(ul)").children("ul").css({display:"none",width:"17em"}); // NAV - enhance CSS dropdown $("li:has(ul)").hoverIntent(function(){$(this).children("ul").css({display:"none",width:"17em"}).slideDown("normal"); }, function(){$(this).children("ul").slideUp("fast");}); // FLASH $('#banner').flash({ src: 'http://www.reallywelsh.com/flash/daffodil_banner.swf', width: 954, height: 162 }, { version: 8, update: false }); $('#how_welsh').flash({ src: 'http://www.reallywelsh.com/flash/how_welsh.swf', width: 918, height: 358 }, { version: 8, update: false }); $('#flash_map').flash({ src: 'http://www.reallywelsh.com/flash/map.swf', width: 450, height: 565 }, { version: 8, update: false }); // VALIDATE FORM // set the debug option to true, so the data is not commited to enable outcome to be reviewed $.validator.setDefaults({ debug: false }); // validate the comment form when it is submitted $("#form").validate(); $("#comment_form").validate(); // SECURE FORM // remove JavaScript warning $('.warning').remove(); // simple GET request to the server to retrieve the text $.get('http://www.reallywelsh.com/scripts/token.php',function(txt) { // find element with class="secure" $('.secure') // append hidden input with server time (from AJAX call) .append(''); }); });