$(document).ready(function(){
    $(".sidebar-posts").accordion({"autoHeight": false});
    $("#formtabs").tabs();

    $("body.contact-us .cform legend").parent().find('ol').hide();

    $("body.contact-us .cform legend").click(function()
    {
    	$(this).parent().find('ol').toggle('slow');	
	$(this).toggleClass('fieldset-open');
    });
 
    var index=1;
    $('body.contact-us .cform input[type=radio]').parent().each(function(i){
    	$(this).wrap('<div class="radiogroup-'+ index++ + '"></div>');
    });
    
    $('body.contact-us .cform input[type=checkbox]').parent().each(function(i){
    	$(this).wrap('<div class="checkbox-'+ index++ + '"></div>');
    });
    
     $('body.contact-us .cform input[type=radio]').parent().each(function(i){
    	$(this).wrap('<div class="radiogroup-'+ index++ + '"></div>');
    });
     
     $('body.gift-vouchers fieldset').each(function(i) {
        $(this).wrap('<div class="fieldset-'+ i +'"></div>');
     });

    $('.gift-vouchers fieldset.cf-fs1 label').after('<br/>');
    $('.gift-vouchers fieldset.cf-fs2 label').after('<br/>');
    $('.gift-vouchers fieldset.cf-fs3 label').after('<br/>');

/**
    $('.cform select').each(function(){
        var l = $(this).parent().find('label');
        var t = $(l).text();
 
        if(t.indexOf('[')){
            var m = t.substring(t.indexOf('[')+1,t.indexOf(']'));
 
            if(m == "multifield"){
                nt=t.substr(0,t.indexOf('['));
 
                $(l).text(nt);
                $(this).after('<br/><a href="#" id="add-'+nt+'">Add '+ nt +'</a>');
                $("a#add-"+nt).cloneField($(this),{labelAfter:"<br/>"});

            }
        }
    });
    **/
});



	
