pass_cleared = [0,0,0];
email_cleared = [0,0,0];

function clear_pass(form, num) {
  if (pass_cleared[num] == 0) {
    pass_cleared[num] = 1;
    form.pass.value='';  
  }
}

function clear_email(form, num) {
  if (email_cleared[num] == 0) {
    email_cleared[num] = 1;
    form.email.value='';
  }
}

function popup(input_url,w,h,s) {
 window.open(input_url,"_blank","height="+h+",width="+w+",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars="+s+",status=0,toolbar=0");
}

// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'images/banner_home.jpg'
theImages[1] = 'images/banner_home2.jpg'
theImages[2] = 'images/banner_home3.jpg'
theImages[3] = 'images/banner_home4.jpg'

// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img alt="" src="'+theImages[whichImage]+'" alt="Wedding Planning Tools Wedding Dresses Wedding Cakes Flowers Reception Venues" height="180" width="786">');
}


$(document).ready(function() {

  // top nav member login
  $('#member-login-box').hide();
  $('#top-nav a.members').toggle(
    function() {
      $('#member-login-box').slideDown();
    },
    function() {
      $('#member-login-box').slideUp();
    }
  );
  
  // Start planning form - nuke fields onFocus
  $('#start-form input').focus(function() {
    if ($(this).val() == 'DAY' || $(this).val() == 'YEAR') {
      $(this).val('');
    }
  });
  
  // Sidebar categories - slidedown
  $('#side-directory-expando').hide();
  $('#side-directory li.down a').toggle(
    function() {
      $('#side-directory-expando').slideDown();
      $(this).parent().removeClass('down').addClass('up');
      $(this).text('Show less...');
      return false;
    },
    function() {
      $('#side-directory-expando').slideUp();
      $(this).parent().removeClass('up').addClass('down');
      $(this).text('See all categories...');
      return false;
    }
  );
  
  // Twitter & Facebook open
  $('#follow-facebook').hide();
  $('#footer a.facebook').click(function() {
    $('#follow-twitter').fadeOut();
    $('#follow-facebook').fadeIn();
    return false;
  });
  
  $('#follow-twitter').hide();
  $('#footer a.twitter').click(function() {
    $('#follow-facebook').fadeOut();
    $('#follow-twitter').fadeIn();
    return false;
  });
});

