function clearForms()
{
  var i;
  for (i = 0; (i < document.forms.length); i++) {
    document.forms[0].reset();
  }
}
      
function setFontSize() { 
    var maxFontSize = 11; 
    var fontSize = Math.floor(Math.random() * maxFontSize + 12) + 'px'; 
    return fontSize; 
} 

function setOffsets() { 
    var offsets = {}; 
    var randTop = Math.floor(Math.random() * 10); 
    var randLeft = Math.floor(Math.random() * 10); 
    var maxTop = Math.floor(Math.random() * randTop) + 'px'; 
    var maxLeft = Math.floor(Math.random() * randLeft) + 'px'; 

    offsets.top = maxTop; 
    offsets.left = maxLeft; 

    return offsets;     
}        

$(document).ready(function() { 
    
$('#tagcloud li').each(function() { 
        var $a = $(this).find('span'); 
        var cssFontSize = setFontSize(); 
        var linkOffsets = setOffsets(); 

       $a.css({fontSize: cssFontSize, top: linkOffsets.top, left: linkOffsets.left}); 
    }); 
});     

$(function(){
    $('#slides').slides({
        generatePagination: false,
        pagination: false,        
        effect: 'fade',
        start: 1,
        preload: true,
        randomize: true,
        preloadImage: '../workspace/images/loading.gif',
        play: 12000,
        pause: 2500,
        hoverPause: true,
        animationStart: function(current){
            $('.caption').animate({
                bottom:-575
            },100);

        },
        animationComplete: function(current){
            $('.caption').animate({
                bottom:-205
            },100);
        },
        slidesLoaded: function() {
            $('.caption').animate({
                bottom:-205
            },10);
        }
    });
});

var active_color = '#000'; // Colour of user provided text
var inactive_color = '#999'; // Colour of default text

$(document).ready(function() {  
  $("input.default-value").css("color", inactive_color);
  var default_values = new Array();
  $("input.default-value").focus(function() {
    if (!default_values[this.id]) {
      default_values[this.id] = this.value;
    }
    if (this.value == default_values[this.id]) {
      this.value = '';
      this.style.color = active_color;
    }
    $(this).blur(function() {
      if (this.value == '') {
        this.style.color = inactive_color;
        this.value = default_values[this.id];
      }
    });
  });
});

