//
// Shadowbox setup must execute before page loads
//
if (window.Shadowbox) {
  Shadowbox.loadSkin("classic", "/script/skin");
  $(function() {
    //
    // Need to add page extension to iframe.  Only way to do so seems to be to 
    // copy this lot in it's entirety.
    //
    Shadowbox.init({
      initialWidth:100,
      initialHeight:100,
      ext: {
        img:        ['png', 'jpg', 'jpeg', 'gif', 'bmp'],
        swf:        ['swf'],
        flv:        ['flv'],
        qt:         ['dv', 'mov', 'moov', 'movie', 'mp4'],
        wmp:        ['asf', 'wm', 'wmv'],
        qtwmp:      ['avi', 'mpg', 'mpeg'],
        iframe:     ['asp', 'aspx', 'cgi', 'cfm', 'htm', 'html', 'pl', 'php',
                    'php3', 'php4', 'php5', 'phtml', 'rb', 'rhtml', 'shtml',
                    'txt', 'vbs' ,'page']         
      }
    });
  });
}

$(function() {
  $("#skyscraperLinks").rotator();
  $("#galleryLinks").rotator();
  $(".bannerBlock .advert ul").rotator({startDelay:1000});
  $(".bannerBlock .sponsor ul").rotator({startDelay:1000});  
 
  $("#contact #submit").click(function() {
  
      var checkbox = $("#termsCheckbox");
      var textfield = $("#textfield");
      var emailRe = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
      var error = '';
      if (!emailRe.test(textfield.val())) {
        textfield.focus();
        error += 'Please enter a valid email address\n';
      }
      if (!checkbox.val()) {
        checkbox.focus();
        error += 'Please accept the terms and conditions to continue\n';
      }

      if (error) {
        alert(error);
        return false;
      }  
  
  });
  
  
  
});

