
$(document).ready(function(){
    
 $('#m3fbrp__66').change(function(){    
    $('#m3fbrp__66_val').val(  $('#m3fbrp__66 option:selected').html() );   
 });   
 $('#m3fbrp__81').change(function(){    
    $('#m3fbrp__81_val').val(  $('#m3fbrp__81 option:selected').html() );   
 });    
 $('#m3fbrp__88').change(function(){    
    $('#m3fbrp__88_val').val(  $('#m3fbrp__88 option:selected').html() );   
 });    
 $('#m3fbrp__141').change(function(){    
    $('#m3fbrp__141_val').val(  $('#m3fbrp__141 option:selected').html() );   
 });     
 $('#m3fbrp__136').change(function(){    
    $('#m3fbrp__136_val').val(  $('#m3fbrp__136 option:selected').html() );   
 });     
 $('#m3fbrp__119').change(function(){    
    $('#m3fbrp__119_val').val(  $('#m3fbrp__119 option:selected').html() );   
 });          
 $('#m3fbrp__120').change(function(){    
    $('#m3fbrp__120_val').val(  $('#m3fbrp__120 option:selected').html() );   
 });           
/*$('input, textarea, select').focus(function(){$(this).css('border', '2px solid #A3610A');});
$('input, textarea, select').blur(function(){$(this).css('border', '1px solid #A3610A');});*/

 $("fieldset.wedding").hide();
 $("fieldset.catering").hide();
 $("fieldset.corporate").hide();
 $(".othertype").hide();
 $(".referral").hide();
 $(".referral2").hide();
 $(".coordinator").hide();
 $(".bridalconsultant").hide(); 
 $(".referralother").hide(); 

  $('input[type="text"]').css('width', '230px');
  $('div.mid input[type="text"]').css('width', '120px');
  $('div.indent input[type="text"]').css('width', '200px');
  $('div.short input[type="text"]').css('width', '60px');
  
  $('input[type="file"]').attr('size', '20');
  $('input[type="textarea"]').css('width', '230px');
 
  $("input[id^='m3fbrp__70']").click(function(){

   var x=$(this).val();

    switch(x)  {

    case ('1'):
      $("fieldset.wedding").show();
      $("fieldset.catering").hide();
      $("fieldset.corporate").hide();
      $(".othertype").hide();
	  $("div.bridalparty label:first,div.music label:first,div.music2 label:first").after("<br />");
      $("div.bridalparty div:first,div.music div:first,div.music2 div:first").css("clear","left");	  
      $("div.bridalparty div:even,div.music div:even,div.music2 div:even").css("margin-left","175px");
      $(".referral").show();
	  $(".referral").appendTo($("fieldset.wedding"));
	  $(".referral2").appendTo($("fieldset.wedding"));      
      $("#m3fbrp__77").datepicker({ dateFormat: 'MM d, yy' });      
      break;

    case ('2'):
      $("fieldset.wedding").hide();
      $("fieldset.catering").hide();
      $("fieldset.corporate").show();
	  $(".corporate legend").text("Corporate");	  
	  $(".othertype").hide();
      $(".referral").show();
	  $(".referral").appendTo($("fieldset.corporate"));
	  $(".referral2").appendTo($("fieldset.corporate"));        
      $("#m3fbrp__132_2").datepicker({ dateFormat: 'MM d, yy' });      
      break;

    case ('3'):
      $("fieldset.wedding").hide();
      $("fieldset.catering").show();
      $("fieldset.corporate").hide();
 	  $(".othertype").hide();
	  $(".referral").appendTo($("fieldset.catering"));
	  $(".referral2").appendTo($("fieldset.catering"));        
      $(".referral").show();
	  $("div.catering_options label:first").after("<br />");
      $("div.catering_options div:first").css("clear","left");
      $("div.catering_options div:even").css("margin-left","175px");
      $("#m3fbrp__115").datepicker({ dateFormat: 'MM d, yy' });            

     break;

    case ('4'):
      $("fieldset.wedding").hide();
      $("fieldset.catering").hide();
      $("fieldset.corporate").show();
	  $(".othertype").show();
	  $(".corporate legend").text("Other");
      $(".referral").show();
	  $(".referral").appendTo($("fieldset.corporate"));
	  $(".referral2").appendTo($("fieldset.corporate"));        

      break;
   }
  });

    $("div.otherfood").hide();

   $("#m3fbrp__120").change(function(){
   var y=$("#m3fbrp__120").val();
   if (y==4) {
      $("div.otherfood").show();
   } else {
      $("div.otherfood").hide();
   }     
   });
   
   $('#m3fbrp__141').change(function(){
        if ( ( $('#m3fbrp__141').val() == 5 ) || ( $('#m3fbrp__141').val() == 6 ) )
            $('#name_2').show(); else $('#name_2').hide();
   });
   
    $(".indent").hide();
   
   $("input[id^='m3fbrp__86']").click(function(){
   var aa=$(this).val();
   if (aa==1) {
      $("div.indent").show();
   } else {
      $("div.indent").hide();
   }     
   });
   
   
    $("input[id^='m3fbrp__78']").click(function(){
   var wc=$(this).val();
   if (wc==1) {
      $("div.coordinator").show();
   } else {
      $("div.coordinator").hide();
   }     
   });
  
   
   
    $(".decor").hide();
   
   $("input[id^='m3fbrp__123']").click(function(){
   var de=$(this).val();
   if (de==1) {
      $("div.decor").show();
   } else {
      $("div.decor").hide();
   }     
   });
   
   $(".bnumbers, .gnumbers").hide();
   
   $("#m3fbrp__89_0").click(function() {
    if ($("#m3fbrp__89_0").is(":checked")) {
	 $(".bnumbers").show();
	 $(".bnumbers").appendTo($("#m3fbrp__89_0").parent());
	} else {
	 $(".bnumbers").hide();          
	}
	
   });
   $("#m3fbrp__89_1").click(function() {
    if ($("#m3fbrp__89_1").is(":checked")) {
	 $(".gnumbers").show();
	 $(".gnumbers").appendTo($("#m3fbrp__89_1").parent());
	} else {
	 $(".gnumbers").hide();          
	}	
   });
   
   $("div.fileupload:not(div.first),div.attachmore:not(div.attachmore:first)").hide();
     
   $(".pic1").click(function () {
      $("div.pic2, div.file2").show();
	  $(".pic1").hide();
    });
  $(".pic2").click(function () {
      $("div.pic3, div.file3").show();
	  $(".pic2").hide();
    });
 $(".pic3").click(function () {
      $("div.pic4, div.file4").show();
	  $(".pic3").hide();
    });
 $(".pic4").click(function () {
      $("div.pic5, div.file5").show();
	  $(".pic4").hide();
    });
	
 $("#m3fbrp__141").change(function() {
   if ($("#m3fbrp__141").val() == 6 || $("#m3fbrp__141").val() == 5 )
   {
      $("div.referralother").show();
   } else {
      $("div.referralother").hide(); 
   }
  });
 
 
	$('.refno').cluetip({local:true,splitTitle: '|', topOffset:25, leftOffset:35,arrows:true});

    // date picker
    $(".datepicker input[type='text']").datepicker({ dateFormat: 'MM d, yy' });

   
});

