priceable = function () {
        var pack = $('#WebDesignPackageId').val();
        var extra = $('#WebDesignExtraPages').val();
        var seo;
        if (pack == '') {
            pack = 0;
        }
        if (extra == '') {
            extra = 0;
        }
        if ($('#WebDesignSeo').is(':checked')) {
            seo = 1;
        } else {
            seo = 0;
        }
        $.get(webPriceUrl + pack + '/' + extra + '/' + seo, function (data) {
            $('#wd-content .order-price').html(data);
        })
    }
$(document).ready(function () {
    $('.radio :input').change(function () {
    	if($(this).attr('id')=='WebDesignType4' || $(this).attr('id')=='WebDesignType3' || $(this).attr('id')=='WebDesignType2' || $(this).attr('id')=='WebDesignType1') {
	        if ($(this).val() == '4') {
	            $('#WebDesignOther').parent().show();
	        } else {
	            $('#WebDesignOther').parent().hide();
	        }
    	}
    	if($(this).attr('id')=='WebDesignType24' || $(this).attr('id')=='WebDesignType23' || $(this).attr('id')=='WebDesignType22' || $(this).attr('id')=='WebDesignType21') {
	        if ($(this).val() == '4') {
	            $('#WebDesignOther2').parent().show();
	        } else {
	            $('#WebDesignOther2').parent().hide();
	        }
    	}
    });
    if ($('#WebDesignType4').attr('checked')) {
        $('#WebDesignOther').parent().show();
    }
    if ($('#WebDesignType24').attr('checked')) {
        $('#WebDesignOther2').parent().show();
    }
    
    $('.wd-add-item').live('click', function (event) {
        event.preventDefault();
        var cl = $(this).parent().clone();
        cl.find(':input').val('');
        $(this).parent().parent().append(cl);
        $(this).remove();
    });
    $('#WebDesignPackageId').change(function () {
       var last = $(this).find('option').last().val();
       if (last == $(this).val()) {
           $('#WebDesignExtraPages').parent().show();
       } else {
           $('#WebDesignExtraPages').parent().hide().find('select').val("");
       }
    });
    $('.priceable').change(priceable).change();
    $('.priceable:checkbox').click(priceable);
});
